diff --git a/README.md b/README.md index cfd970a..f41a7f8 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ You can find the latest SDK version at [central repository](https://repo1.maven. Add this dependency to your project's build file: ```groovy -implementation "com.corbado:corbado-java:1.0.7" +implementation "com.corbado:corbado-java:1.0.8" ``` #### Maven users @@ -38,7 +38,7 @@ Add this dependency to your project's POM: com.corbado corbado-java - 1.0.7 + 1.0.8 ``` diff --git a/VERSION b/VERSION index f9cbc01..337a6a8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.7 \ No newline at end of file +1.0.8 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3f41cb4..dcc4655 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.corbado corbado-java jar - 1.0.7 + 1.0.8 Corbado Java Corbado Java SDK https://github.com/corbado/corbado-java diff --git a/scripts/generate-openapi.sh b/scripts/generate-openapi.sh index 122b394..28949aa 100644 --- a/scripts/generate-openapi.sh +++ b/scripts/generate-openapi.sh @@ -28,7 +28,8 @@ docker run -v ${PWD}:/local --user $(id -u):$(id -g) openapitools/openapi-genera --additional-properties=invokerPackage=com.corbado.generated.invoker \ --additional-properties=modelPackage=com.corbado.generated.model \ --additional-properties=apiPackage=com.corbado.generated.api \ - --additional-properties=useSwaggerAnnotations=false + --additional-properties=useSwaggerAnnotations=false \ + --additional-properties=disallowAdditionalPropertiesIfNotPresent=false cp -r src/main/java/$SDK_PACKAGE_NAME/$GENERATED_PACKAGE_NAME/* ../../src/main/java/$SDK_PACKAGE_NAME/$GENERATED_PACKAGE_NAME cd .. diff --git a/src/main/java/com/corbado/generated/invoker/ApiException.java b/src/main/java/com/corbado/generated/invoker/ApiException.java index b3476a2..71bed90 100644 --- a/src/main/java/com/corbado/generated/invoker/ApiException.java +++ b/src/main/java/com/corbado/generated/invoker/ApiException.java @@ -22,7 +22,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ApiException extends Exception { private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/corbado/generated/invoker/Configuration.java b/src/main/java/com/corbado/generated/invoker/Configuration.java index 98f4403..0269ccc 100644 --- a/src/main/java/com/corbado/generated/invoker/Configuration.java +++ b/src/main/java/com/corbado/generated/invoker/Configuration.java @@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class Configuration { public static final String VERSION = "1.0.0"; diff --git a/src/main/java/com/corbado/generated/invoker/Pair.java b/src/main/java/com/corbado/generated/invoker/Pair.java index 757e566..de01c08 100644 --- a/src/main/java/com/corbado/generated/invoker/Pair.java +++ b/src/main/java/com/corbado/generated/invoker/Pair.java @@ -13,7 +13,7 @@ package com.corbado.generated.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class Pair { private final String name; private final String value; diff --git a/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java b/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java index 5ee11e8..6d6bec1 100644 --- a/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java +++ b/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java @@ -18,7 +18,7 @@ /** * Representing a Server configuration. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ServerConfiguration { public String URL; public String description; diff --git a/src/main/java/com/corbado/generated/invoker/ServerVariable.java b/src/main/java/com/corbado/generated/invoker/ServerVariable.java index 39ffcd8..fec8a8a 100644 --- a/src/main/java/com/corbado/generated/invoker/ServerVariable.java +++ b/src/main/java/com/corbado/generated/invoker/ServerVariable.java @@ -18,7 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ServerVariable { public String description; public String defaultValue; diff --git a/src/main/java/com/corbado/generated/invoker/StringUtil.java b/src/main/java/com/corbado/generated/invoker/StringUtil.java index 7bc65cc..a726fb1 100644 --- a/src/main/java/com/corbado/generated/invoker/StringUtil.java +++ b/src/main/java/com/corbado/generated/invoker/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java b/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java index 99db113..df190d8 100644 --- a/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java +++ b/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/com/corbado/generated/invoker/auth/Authentication.java b/src/main/java/com/corbado/generated/invoker/auth/Authentication.java index 4111c7f..e9255a1 100644 --- a/src/main/java/com/corbado/generated/invoker/auth/Authentication.java +++ b/src/main/java/com/corbado/generated/invoker/auth/Authentication.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public interface Authentication { /** * Apply authentication settings to header and query params. diff --git a/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java b/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java index 8d65880..f89c11d 100644 --- a/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java +++ b/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java @@ -22,7 +22,7 @@ import java.util.Optional; import java.util.function.Supplier; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class HttpBearerAuth implements Authentication { private final String scheme; private Supplier tokenSupplier; diff --git a/src/main/java/com/corbado/generated/model/AaguidDetails.java b/src/main/java/com/corbado/generated/model/AaguidDetails.java index 9fbfd30..c1347eb 100644 --- a/src/main/java/com/corbado/generated/model/AaguidDetails.java +++ b/src/main/java/com/corbado/generated/model/AaguidDetails.java @@ -50,7 +50,7 @@ /** * AaguidDetails */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class AaguidDetails { public static final String SERIALIZED_NAME_AAGUID = "aaguid"; @SerializedName(SERIALIZED_NAME_AAGUID) @@ -150,6 +150,50 @@ public void setIconDark(@javax.annotation.Nonnull String iconDark) { this.iconDark = iconDark; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AaguidDetails instance itself + */ + public AaguidDetails putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -164,12 +208,13 @@ public boolean equals(Object o) { return Objects.equals(this.aaguid, aaguidDetails.aaguid) && Objects.equals(this.name, aaguidDetails.name) && Objects.equals(this.iconLight, aaguidDetails.iconLight) && - Objects.equals(this.iconDark, aaguidDetails.iconDark); + Objects.equals(this.iconDark, aaguidDetails.iconDark)&& + Objects.equals(this.additionalProperties, aaguidDetails.additionalProperties); } @Override public int hashCode() { - return Objects.hash(aaguid, name, iconLight, iconDark); + return Objects.hash(aaguid, name, iconLight, iconDark, additionalProperties); } @Override @@ -180,6 +225,7 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" iconLight: ").append(toIndentedString(iconLight)).append("\n"); sb.append(" iconDark: ").append(toIndentedString(iconDark)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -220,14 +266,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AaguidDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AaguidDetails` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AaguidDetails.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -264,6 +302,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, AaguidDetails value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -271,7 +331,28 @@ public void write(JsonWriter out, AaguidDetails value) throws IOException { public AaguidDetails read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AaguidDetails instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java b/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java index 30b8c42..9710e1b 100644 --- a/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java @@ -21,7 +21,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/com/corbado/generated/model/AppendHistoryData.java b/src/main/java/com/corbado/generated/model/AppendHistoryData.java index a81539d..f4b9fd1 100644 --- a/src/main/java/com/corbado/generated/model/AppendHistoryData.java +++ b/src/main/java/com/corbado/generated/model/AppendHistoryData.java @@ -50,7 +50,7 @@ /** * AppendHistoryData */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class AppendHistoryData { public static final String SERIALIZED_NAME_DEFAULT_COUNT = "defaultCount"; @SerializedName(SERIALIZED_NAME_DEFAULT_COUNT) @@ -246,6 +246,50 @@ public void setAutoCooldown(@javax.annotation.Nonnull Boolean autoCooldown) { this.autoCooldown = autoCooldown; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AppendHistoryData instance itself + */ + public AppendHistoryData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -264,12 +308,13 @@ public boolean equals(Object o) { Objects.equals(this.defaultCooldown, appendHistoryData.defaultCooldown) && Objects.equals(this.afterErrorCooldown, appendHistoryData.afterErrorCooldown) && Objects.equals(this.afterHybridCooldown, appendHistoryData.afterHybridCooldown) && - Objects.equals(this.autoCooldown, appendHistoryData.autoCooldown); + Objects.equals(this.autoCooldown, appendHistoryData.autoCooldown)&& + Objects.equals(this.additionalProperties, appendHistoryData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(defaultCount, afterErrorCount, afterHybridCount, autoCount, defaultCooldown, afterErrorCooldown, afterHybridCooldown, autoCooldown); + return Objects.hash(defaultCount, afterErrorCount, afterHybridCount, autoCount, defaultCooldown, afterErrorCooldown, afterHybridCooldown, autoCooldown, additionalProperties); } @Override @@ -284,6 +329,7 @@ public String toString() { sb.append(" afterErrorCooldown: ").append(toIndentedString(afterErrorCooldown)).append("\n"); sb.append(" afterHybridCooldown: ").append(toIndentedString(afterHybridCooldown)).append("\n"); sb.append(" autoCooldown: ").append(toIndentedString(autoCooldown)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -324,14 +370,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AppendHistoryData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AppendHistoryData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AppendHistoryData.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -356,6 +394,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, AppendHistoryData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -363,7 +423,28 @@ public void write(JsonWriter out, AppendHistoryData value) throws IOException { public AppendHistoryData read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AppendHistoryData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/AuthEvent.java b/src/main/java/com/corbado/generated/model/AuthEvent.java index 2f97e9a..b3308b6 100644 --- a/src/main/java/com/corbado/generated/model/AuthEvent.java +++ b/src/main/java/com/corbado/generated/model/AuthEvent.java @@ -53,7 +53,7 @@ /** * AuthEvent */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class AuthEvent { public static final String SERIALIZED_NAME_AUTH_EVENT_I_D = "authEventID"; @SerializedName(SERIALIZED_NAME_AUTH_EVENT_I_D) @@ -249,6 +249,50 @@ public void setStatus(@javax.annotation.Nonnull AuthEventStatus status) { this.status = status; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthEvent instance itself + */ + public AuthEvent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -267,12 +311,13 @@ public boolean equals(Object o) { Objects.equals(this.method, authEvent.method) && Objects.equals(this.created, authEvent.created) && Objects.equals(this.createdMs, authEvent.createdMs) && - Objects.equals(this.status, authEvent.status); + Objects.equals(this.status, authEvent.status)&& + Objects.equals(this.additionalProperties, authEvent.additionalProperties); } @Override public int hashCode() { - return Objects.hash(authEventID, userID, username, eventType, method, created, createdMs, status); + return Objects.hash(authEventID, userID, username, eventType, method, created, createdMs, status, additionalProperties); } @Override @@ -287,6 +332,7 @@ public String toString() { sb.append(" created: ").append(toIndentedString(created)).append("\n"); sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -327,14 +373,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AuthEvent.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AuthEvent` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AuthEvent.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -377,6 +415,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, AuthEvent value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -384,7 +444,28 @@ public void write(JsonWriter out, AuthEvent value) throws IOException { public AuthEvent read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthEvent instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java b/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java index 4e33d19..f313f28 100644 --- a/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java +++ b/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java @@ -54,7 +54,7 @@ /** * AuthEventCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class AuthEventCreateReq { public static final String SERIALIZED_NAME_USERNAME = "username"; @SerializedName(SERIALIZED_NAME_USERNAME) @@ -178,6 +178,50 @@ public void setClientInformation(@javax.annotation.Nonnull ClientInformation cli this.clientInformation = clientInformation; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthEventCreateReq instance itself + */ + public AuthEventCreateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -193,12 +237,13 @@ public boolean equals(Object o) { Objects.equals(this.eventType, authEventCreateReq.eventType) && Objects.equals(this.method, authEventCreateReq.method) && Objects.equals(this.status, authEventCreateReq.status) && - Objects.equals(this.clientInformation, authEventCreateReq.clientInformation); + Objects.equals(this.clientInformation, authEventCreateReq.clientInformation)&& + Objects.equals(this.additionalProperties, authEventCreateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(username, eventType, method, status, clientInformation); + return Objects.hash(username, eventType, method, status, clientInformation, additionalProperties); } @Override @@ -210,6 +255,7 @@ public String toString() { sb.append(" method: ").append(toIndentedString(method)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -250,14 +296,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AuthEventCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `AuthEventCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AuthEventCreateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -293,6 +331,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, AuthEventCreateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -300,7 +360,28 @@ public void write(JsonWriter out, AuthEventCreateReq value) throws IOException { public AuthEventCreateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthEventCreateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/Challenge.java b/src/main/java/com/corbado/generated/model/Challenge.java index e419e85..73eff02 100644 --- a/src/main/java/com/corbado/generated/model/Challenge.java +++ b/src/main/java/com/corbado/generated/model/Challenge.java @@ -52,7 +52,7 @@ /** * Challenge */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class Challenge { public static final String SERIALIZED_NAME_CHALLENGE_I_D = "challengeID"; @SerializedName(SERIALIZED_NAME_CHALLENGE_I_D) @@ -200,6 +200,50 @@ public void setStatus(@javax.annotation.Nonnull ChallengeStatus status) { this.status = status; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Challenge instance itself + */ + public Challenge putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -216,12 +260,13 @@ public boolean equals(Object o) { Objects.equals(this.identifierValue, challenge.identifierValue) && Objects.equals(this.value, challenge.value) && Objects.equals(this.expires, challenge.expires) && - Objects.equals(this.status, challenge.status); + Objects.equals(this.status, challenge.status)&& + Objects.equals(this.additionalProperties, challenge.additionalProperties); } @Override public int hashCode() { - return Objects.hash(challengeID, type, identifierValue, value, expires, status); + return Objects.hash(challengeID, type, identifierValue, value, expires, status, additionalProperties); } @Override @@ -234,6 +279,7 @@ public String toString() { sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -274,14 +320,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Challenge.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `Challenge` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Challenge.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -319,6 +357,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Challenge value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -326,7 +386,28 @@ public void write(JsonWriter out, Challenge value) throws IOException { public Challenge read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Challenge instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java b/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java index 7cd149f..77dbc28 100644 --- a/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java +++ b/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java @@ -52,7 +52,7 @@ /** * ChallengeCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ChallengeCreateReq { public static final String SERIALIZED_NAME_CHALLENGE_TYPE = "challengeType"; @SerializedName(SERIALIZED_NAME_CHALLENGE_TYPE) @@ -176,6 +176,50 @@ public void setClientInformation(@javax.annotation.Nonnull ClientInformation cli this.clientInformation = clientInformation; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ChallengeCreateReq instance itself + */ + public ChallengeCreateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -191,12 +235,13 @@ public boolean equals(Object o) { Objects.equals(this.identifierValue, challengeCreateReq.identifierValue) && Objects.equals(this.challengeMetadata, challengeCreateReq.challengeMetadata) && Objects.equals(this.lifetimeSeconds, challengeCreateReq.lifetimeSeconds) && - Objects.equals(this.clientInformation, challengeCreateReq.clientInformation); + Objects.equals(this.clientInformation, challengeCreateReq.clientInformation)&& + Objects.equals(this.additionalProperties, challengeCreateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(challengeType, identifierValue, challengeMetadata, lifetimeSeconds, clientInformation); + return Objects.hash(challengeType, identifierValue, challengeMetadata, lifetimeSeconds, clientInformation, additionalProperties); } @Override @@ -208,6 +253,7 @@ public String toString() { sb.append(" challengeMetadata: ").append(toIndentedString(challengeMetadata)).append("\n"); sb.append(" lifetimeSeconds: ").append(toIndentedString(lifetimeSeconds)).append("\n"); sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -248,14 +294,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChallengeCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ChallengeCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChallengeCreateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -287,6 +325,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ChallengeCreateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -294,7 +354,28 @@ public void write(JsonWriter out, ChallengeCreateReq value) throws IOException { public ChallengeCreateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ChallengeCreateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java b/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java index 56d69c7..5ad4a30 100644 --- a/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java @@ -50,7 +50,7 @@ /** * ChallengeUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ChallengeUpdateReq { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -78,6 +78,50 @@ public void setValue(@javax.annotation.Nonnull String value) { this.value = value; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ChallengeUpdateReq instance itself + */ + public ChallengeUpdateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -89,12 +133,13 @@ public boolean equals(Object o) { return false; } ChallengeUpdateReq challengeUpdateReq = (ChallengeUpdateReq) o; - return Objects.equals(this.value, challengeUpdateReq.value); + return Objects.equals(this.value, challengeUpdateReq.value)&& + Objects.equals(this.additionalProperties, challengeUpdateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(value); + return Objects.hash(value, additionalProperties); } @Override @@ -102,6 +147,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ChallengeUpdateReq {\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -142,14 +188,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChallengeUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ChallengeUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChallengeUpdateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ChallengeUpdateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, ChallengeUpdateReq value) throws IOException { public ChallengeUpdateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ChallengeUpdateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ClientEnv.java b/src/main/java/com/corbado/generated/model/ClientEnv.java index c0e9293..5c996cb 100644 --- a/src/main/java/com/corbado/generated/model/ClientEnv.java +++ b/src/main/java/com/corbado/generated/model/ClientEnv.java @@ -50,7 +50,7 @@ /** * ClientEnv */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ClientEnv { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -294,6 +294,50 @@ public void setDeviceId(@javax.annotation.Nullable String deviceId) { this.deviceId = deviceId; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ClientEnv instance itself + */ + public ClientEnv putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -314,12 +358,13 @@ public boolean equals(Object o) { Objects.equals(this.userAgent, clientEnv.userAgent) && Objects.equals(this.jsFingerprint, clientEnv.jsFingerprint) && Objects.equals(this.createdMs, clientEnv.createdMs) && - Objects.equals(this.deviceId, clientEnv.deviceId); + Objects.equals(this.deviceId, clientEnv.deviceId)&& + Objects.equals(this.additionalProperties, clientEnv.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, handle, browserName, browserVersion, osName, osVersion, userAgent, jsFingerprint, createdMs, deviceId); + return Objects.hash(id, handle, browserName, browserVersion, osName, osVersion, userAgent, jsFingerprint, createdMs, deviceId, additionalProperties); } @Override @@ -336,6 +381,7 @@ public String toString() { sb.append(" jsFingerprint: ").append(toIndentedString(jsFingerprint)).append("\n"); sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -376,14 +422,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ClientEnv.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ClientEnv` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ClientEnv.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -435,6 +473,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ClientEnv value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -442,7 +502,28 @@ public void write(JsonWriter out, ClientEnv value) throws IOException { public ClientEnv read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ClientEnv instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ClientEnvList.java b/src/main/java/com/corbado/generated/model/ClientEnvList.java index a7f6a07..3f5ec62 100644 --- a/src/main/java/com/corbado/generated/model/ClientEnvList.java +++ b/src/main/java/com/corbado/generated/model/ClientEnvList.java @@ -53,7 +53,7 @@ /** * ClientEnvList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ClientEnvList { public static final String SERIALIZED_NAME_CLIENT_ENVS = "clientEnvs"; @SerializedName(SERIALIZED_NAME_CLIENT_ENVS) @@ -89,6 +89,50 @@ public void setClientEnvs(@javax.annotation.Nonnull List clientEnvs) this.clientEnvs = clientEnvs; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ClientEnvList instance itself + */ + public ClientEnvList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -100,12 +144,13 @@ public boolean equals(Object o) { return false; } ClientEnvList clientEnvList = (ClientEnvList) o; - return Objects.equals(this.clientEnvs, clientEnvList.clientEnvs); + return Objects.equals(this.clientEnvs, clientEnvList.clientEnvs)&& + Objects.equals(this.additionalProperties, clientEnvList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(clientEnvs); + return Objects.hash(clientEnvs, additionalProperties); } @Override @@ -113,6 +158,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ClientEnvList {\n"); sb.append(" clientEnvs: ").append(toIndentedString(clientEnvs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -153,14 +199,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ClientEnvList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ClientEnvList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ClientEnvList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -195,6 +233,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ClientEnvList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -202,7 +262,28 @@ public void write(JsonWriter out, ClientEnvList value) throws IOException { public ClientEnvList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ClientEnvList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ClientInformation.java b/src/main/java/com/corbado/generated/model/ClientInformation.java index 7ae9b27..335749e 100644 --- a/src/main/java/com/corbado/generated/model/ClientInformation.java +++ b/src/main/java/com/corbado/generated/model/ClientInformation.java @@ -53,7 +53,7 @@ /** * ClientInformation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ClientInformation { public static final String SERIALIZED_NAME_REMOTE_ADDRESS = "remoteAddress"; @SerializedName(SERIALIZED_NAME_REMOTE_ADDRESS) @@ -345,6 +345,50 @@ public void setNativeMeta(@javax.annotation.Nullable NativeMeta nativeMeta) { this.nativeMeta = nativeMeta; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ClientInformation instance itself + */ + public ClientInformation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -367,12 +411,13 @@ public boolean equals(Object o) { Objects.equals(this.conditionalMediationAvailable, clientInformation.conditionalMediationAvailable) && Objects.equals(this.privateMode, clientInformation.privateMode) && Objects.equals(this.parsedDeviceInfo, clientInformation.parsedDeviceInfo) && - Objects.equals(this.nativeMeta, clientInformation.nativeMeta); + Objects.equals(this.nativeMeta, clientInformation.nativeMeta)&& + Objects.equals(this.additionalProperties, clientInformation.additionalProperties); } @Override public int hashCode() { - return Objects.hash(remoteAddress, userAgent, clientEnvHandle, javascriptFingerprint, javaScriptHighEntropy, bluetoothAvailable, passwordManagerAvailable, userVerifyingPlatformAuthenticatorAvailable, conditionalMediationAvailable, privateMode, parsedDeviceInfo, nativeMeta); + return Objects.hash(remoteAddress, userAgent, clientEnvHandle, javascriptFingerprint, javaScriptHighEntropy, bluetoothAvailable, passwordManagerAvailable, userVerifyingPlatformAuthenticatorAvailable, conditionalMediationAvailable, privateMode, parsedDeviceInfo, nativeMeta, additionalProperties); } @Override @@ -391,6 +436,7 @@ public String toString() { sb.append(" privateMode: ").append(toIndentedString(privateMode)).append("\n"); sb.append(" parsedDeviceInfo: ").append(toIndentedString(parsedDeviceInfo)).append("\n"); sb.append(" nativeMeta: ").append(toIndentedString(nativeMeta)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -431,14 +477,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ClientInformation.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ClientInformation` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ClientInformation.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -485,6 +523,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ClientInformation value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -492,7 +552,28 @@ public void write(JsonWriter out, ClientInformation value) throws IOException { public ClientInformation read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ClientInformation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ConnectToken.java b/src/main/java/com/corbado/generated/model/ConnectToken.java index 24371ec..fa49b33 100644 --- a/src/main/java/com/corbado/generated/model/ConnectToken.java +++ b/src/main/java/com/corbado/generated/model/ConnectToken.java @@ -53,7 +53,7 @@ /** * ConnectToken */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ConnectToken { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -201,6 +201,50 @@ public void setExpires(@javax.annotation.Nonnull Integer expires) { this.expires = expires; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectToken instance itself + */ + public ConnectToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -217,12 +261,13 @@ public boolean equals(Object o) { Objects.equals(this.data, connectToken.data) && Objects.equals(this.connectTokenStatus, connectToken.connectTokenStatus) && Objects.equals(this.secret, connectToken.secret) && - Objects.equals(this.expires, connectToken.expires); + Objects.equals(this.expires, connectToken.expires)&& + Objects.equals(this.additionalProperties, connectToken.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, tokenType, data, connectTokenStatus, secret, expires); + return Objects.hash(id, tokenType, data, connectTokenStatus, secret, expires, additionalProperties); } @Override @@ -235,6 +280,7 @@ public String toString() { sb.append(" connectTokenStatus: ").append(toIndentedString(connectTokenStatus)).append("\n"); sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -275,14 +321,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConnectToken.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ConnectToken` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ConnectToken.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -319,6 +357,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ConnectToken value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -326,7 +386,28 @@ public void write(JsonWriter out, ConnectToken value) throws IOException { public ConnectToken read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java b/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java index f92e132..9ed257e 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java @@ -52,7 +52,7 @@ /** * ConnectTokenCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ConnectTokenCreateReq { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @@ -128,6 +128,50 @@ public void setMaxLifetimeInSeconds(@javax.annotation.Nullable Integer maxLifeti this.maxLifetimeInSeconds = maxLifetimeInSeconds; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectTokenCreateReq instance itself + */ + public ConnectTokenCreateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -141,12 +185,13 @@ public boolean equals(Object o) { ConnectTokenCreateReq connectTokenCreateReq = (ConnectTokenCreateReq) o; return Objects.equals(this.type, connectTokenCreateReq.type) && Objects.equals(this.data, connectTokenCreateReq.data) && - Objects.equals(this.maxLifetimeInSeconds, connectTokenCreateReq.maxLifetimeInSeconds); + Objects.equals(this.maxLifetimeInSeconds, connectTokenCreateReq.maxLifetimeInSeconds)&& + Objects.equals(this.additionalProperties, connectTokenCreateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(type, data, maxLifetimeInSeconds); + return Objects.hash(type, data, maxLifetimeInSeconds, additionalProperties); } @Override @@ -156,6 +201,7 @@ public String toString() { sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" maxLifetimeInSeconds: ").append(toIndentedString(maxLifetimeInSeconds)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -196,14 +242,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConnectTokenCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ConnectTokenCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ConnectTokenCreateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -232,6 +270,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ConnectTokenCreateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -239,7 +299,28 @@ public void write(JsonWriter out, ConnectTokenCreateReq value) throws IOExceptio public ConnectTokenCreateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectTokenCreateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenData.java b/src/main/java/com/corbado/generated/model/ConnectTokenData.java index 605dffc..980b8c9 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenData.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenData.java @@ -63,7 +63,7 @@ import com.corbado.generated.invoker.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ConnectTokenData extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(ConnectTokenData.class.getName()); diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java index 6b84f50..36d8b58 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java @@ -50,7 +50,7 @@ /** * Data for `passkey-append`. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ConnectTokenDataPasskeyAppend { public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) @@ -102,6 +102,50 @@ public void setIdentifier(@javax.annotation.Nonnull String identifier) { this.identifier = identifier; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectTokenDataPasskeyAppend instance itself + */ + public ConnectTokenDataPasskeyAppend putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -114,12 +158,13 @@ public boolean equals(Object o) { } ConnectTokenDataPasskeyAppend connectTokenDataPasskeyAppend = (ConnectTokenDataPasskeyAppend) o; return Objects.equals(this.displayName, connectTokenDataPasskeyAppend.displayName) && - Objects.equals(this.identifier, connectTokenDataPasskeyAppend.identifier); + Objects.equals(this.identifier, connectTokenDataPasskeyAppend.identifier)&& + Objects.equals(this.additionalProperties, connectTokenDataPasskeyAppend.additionalProperties); } @Override public int hashCode() { - return Objects.hash(displayName, identifier); + return Objects.hash(displayName, identifier, additionalProperties); } @Override @@ -128,6 +173,7 @@ public String toString() { sb.append("class ConnectTokenDataPasskeyAppend {\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -168,14 +214,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConnectTokenDataPasskeyAppend.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ConnectTokenDataPasskeyAppend` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ConnectTokenDataPasskeyAppend.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -206,6 +244,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ConnectTokenDataPasskeyAppend value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -213,7 +273,28 @@ public void write(JsonWriter out, ConnectTokenDataPasskeyAppend value) throws IO public ConnectTokenDataPasskeyAppend read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectTokenDataPasskeyAppend instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java index d805d85..b5c0248 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java @@ -50,7 +50,7 @@ /** * Data for `passkey-delete`. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ConnectTokenDataPasskeyDelete { public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; @SerializedName(SERIALIZED_NAME_IDENTIFIER) @@ -78,6 +78,50 @@ public void setIdentifier(@javax.annotation.Nonnull String identifier) { this.identifier = identifier; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectTokenDataPasskeyDelete instance itself + */ + public ConnectTokenDataPasskeyDelete putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -89,12 +133,13 @@ public boolean equals(Object o) { return false; } ConnectTokenDataPasskeyDelete connectTokenDataPasskeyDelete = (ConnectTokenDataPasskeyDelete) o; - return Objects.equals(this.identifier, connectTokenDataPasskeyDelete.identifier); + return Objects.equals(this.identifier, connectTokenDataPasskeyDelete.identifier)&& + Objects.equals(this.additionalProperties, connectTokenDataPasskeyDelete.additionalProperties); } @Override public int hashCode() { - return Objects.hash(identifier); + return Objects.hash(identifier, additionalProperties); } @Override @@ -102,6 +147,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ConnectTokenDataPasskeyDelete {\n"); sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -142,14 +188,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConnectTokenDataPasskeyDelete.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ConnectTokenDataPasskeyDelete` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ConnectTokenDataPasskeyDelete.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ConnectTokenDataPasskeyDelete value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, ConnectTokenDataPasskeyDelete value) throws IO public ConnectTokenDataPasskeyDelete read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectTokenDataPasskeyDelete instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java index d44c88a..4c3ef42 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java @@ -50,7 +50,7 @@ /** * Data for `passkey-list`. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ConnectTokenDataPasskeyList { public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; @SerializedName(SERIALIZED_NAME_IDENTIFIER) @@ -78,6 +78,50 @@ public void setIdentifier(@javax.annotation.Nonnull String identifier) { this.identifier = identifier; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectTokenDataPasskeyList instance itself + */ + public ConnectTokenDataPasskeyList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -89,12 +133,13 @@ public boolean equals(Object o) { return false; } ConnectTokenDataPasskeyList connectTokenDataPasskeyList = (ConnectTokenDataPasskeyList) o; - return Objects.equals(this.identifier, connectTokenDataPasskeyList.identifier); + return Objects.equals(this.identifier, connectTokenDataPasskeyList.identifier)&& + Objects.equals(this.additionalProperties, connectTokenDataPasskeyList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(identifier); + return Objects.hash(identifier, additionalProperties); } @Override @@ -102,6 +147,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ConnectTokenDataPasskeyList {\n"); sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -142,14 +188,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConnectTokenDataPasskeyList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ConnectTokenDataPasskeyList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ConnectTokenDataPasskeyList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ConnectTokenDataPasskeyList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, ConnectTokenDataPasskeyList value) throws IOEx public ConnectTokenDataPasskeyList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectTokenDataPasskeyList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyLogin.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyLogin.java index 90c656c..63d272d 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyLogin.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyLogin.java @@ -50,7 +50,7 @@ /** * Data for `passkey-login`. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ConnectTokenDataPasskeyLogin { public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; @SerializedName(SERIALIZED_NAME_IDENTIFIER) @@ -78,6 +78,50 @@ public void setIdentifier(@javax.annotation.Nonnull String identifier) { this.identifier = identifier; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectTokenDataPasskeyLogin instance itself + */ + public ConnectTokenDataPasskeyLogin putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -89,12 +133,13 @@ public boolean equals(Object o) { return false; } ConnectTokenDataPasskeyLogin connectTokenDataPasskeyLogin = (ConnectTokenDataPasskeyLogin) o; - return Objects.equals(this.identifier, connectTokenDataPasskeyLogin.identifier); + return Objects.equals(this.identifier, connectTokenDataPasskeyLogin.identifier)&& + Objects.equals(this.additionalProperties, connectTokenDataPasskeyLogin.additionalProperties); } @Override public int hashCode() { - return Objects.hash(identifier); + return Objects.hash(identifier, additionalProperties); } @Override @@ -102,6 +147,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ConnectTokenDataPasskeyLogin {\n"); sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -142,14 +188,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConnectTokenDataPasskeyLogin.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ConnectTokenDataPasskeyLogin` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ConnectTokenDataPasskeyLogin.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ConnectTokenDataPasskeyLogin value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, ConnectTokenDataPasskeyLogin value) throws IOE public ConnectTokenDataPasskeyLogin read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectTokenDataPasskeyLogin instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenList.java b/src/main/java/com/corbado/generated/model/ConnectTokenList.java index 406e5ff..ae5bb13 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenList.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenList.java @@ -54,7 +54,7 @@ /** * ConnectTokenList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ConnectTokenList { public static final String SERIALIZED_NAME_CONNECT_TOKENS = "connectTokens"; @SerializedName(SERIALIZED_NAME_CONNECT_TOKENS) @@ -114,6 +114,50 @@ public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectTokenList instance itself + */ + public ConnectTokenList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -126,12 +170,13 @@ public boolean equals(Object o) { } ConnectTokenList connectTokenList = (ConnectTokenList) o; return Objects.equals(this.connectTokens, connectTokenList.connectTokens) && - Objects.equals(this.paging, connectTokenList.paging); + Objects.equals(this.paging, connectTokenList.paging)&& + Objects.equals(this.additionalProperties, connectTokenList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(connectTokens, paging); + return Objects.hash(connectTokens, paging, additionalProperties); } @Override @@ -140,6 +185,7 @@ public String toString() { sb.append("class ConnectTokenList {\n"); sb.append(" connectTokens: ").append(toIndentedString(connectTokens)).append("\n"); sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -180,14 +226,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConnectTokenList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ConnectTokenList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ConnectTokenList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -224,6 +262,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ConnectTokenList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -231,7 +291,28 @@ public void write(JsonWriter out, ConnectTokenList value) throws IOException { public ConnectTokenList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectTokenList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java b/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java index c9ceace..5a69d9d 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java @@ -51,7 +51,7 @@ /** * ConnectTokenUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ConnectTokenUpdateReq { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) @@ -79,6 +79,50 @@ public void setStatus(@javax.annotation.Nonnull ConnectTokenStatus status) { this.status = status; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectTokenUpdateReq instance itself + */ + public ConnectTokenUpdateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -90,12 +134,13 @@ public boolean equals(Object o) { return false; } ConnectTokenUpdateReq connectTokenUpdateReq = (ConnectTokenUpdateReq) o; - return Objects.equals(this.status, connectTokenUpdateReq.status); + return Objects.equals(this.status, connectTokenUpdateReq.status)&& + Objects.equals(this.additionalProperties, connectTokenUpdateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(status); + return Objects.hash(status, additionalProperties); } @Override @@ -103,6 +148,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ConnectTokenUpdateReq {\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -143,14 +189,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConnectTokenUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ConnectTokenUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ConnectTokenUpdateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ConnectTokenUpdateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, ConnectTokenUpdateReq value) throws IOExceptio public ConnectTokenUpdateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectTokenUpdateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/Credential.java b/src/main/java/com/corbado/generated/model/Credential.java index 2a4ebdf..79321dd 100644 --- a/src/main/java/com/corbado/generated/model/Credential.java +++ b/src/main/java/com/corbado/generated/model/Credential.java @@ -53,7 +53,7 @@ /** * Credential */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class Credential { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -569,6 +569,50 @@ public void setTags(@javax.annotation.Nonnull List tags) { this.tags = tags; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Credential instance itself + */ + public Credential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -595,12 +639,13 @@ public boolean equals(Object o) { Objects.equals(this.createdMs, credential.createdMs) && Objects.equals(this.status, credential.status) && Objects.equals(this.aaguidDetails, credential.aaguidDetails) && - Objects.equals(this.tags, credential.tags); + Objects.equals(this.tags, credential.tags)&& + Objects.equals(this.additionalProperties, credential.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, credentialID, attestationType, transport, backupEligible, backupState, authenticatorAAGUID, sourceOS, sourceBrowser, lastUsed, lastUsedMs, created, createdMs, status, aaguidDetails, tags); + return Objects.hash(id, credentialID, attestationType, transport, backupEligible, backupState, authenticatorAAGUID, sourceOS, sourceBrowser, lastUsed, lastUsedMs, created, createdMs, status, aaguidDetails, tags, additionalProperties); } @Override @@ -623,6 +668,7 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" aaguidDetails: ").append(toIndentedString(aaguidDetails)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -663,14 +709,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Credential.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `Credential` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Credential.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -738,6 +776,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Credential value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -745,7 +805,28 @@ public void write(JsonWriter out, Credential value) throws IOException { public Credential read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Credential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/CredentialList.java b/src/main/java/com/corbado/generated/model/CredentialList.java index 02c7ae5..2df2ca1 100644 --- a/src/main/java/com/corbado/generated/model/CredentialList.java +++ b/src/main/java/com/corbado/generated/model/CredentialList.java @@ -54,7 +54,7 @@ /** * CredentialList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class CredentialList { public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; @SerializedName(SERIALIZED_NAME_CREDENTIALS) @@ -114,6 +114,50 @@ public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CredentialList instance itself + */ + public CredentialList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -126,12 +170,13 @@ public boolean equals(Object o) { } CredentialList credentialList = (CredentialList) o; return Objects.equals(this.credentials, credentialList.credentials) && - Objects.equals(this.paging, credentialList.paging); + Objects.equals(this.paging, credentialList.paging)&& + Objects.equals(this.additionalProperties, credentialList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(credentials, paging); + return Objects.hash(credentials, paging, additionalProperties); } @Override @@ -140,6 +185,7 @@ public String toString() { sb.append("class CredentialList {\n"); sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -180,14 +226,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CredentialList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `CredentialList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CredentialList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -224,6 +262,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, CredentialList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -231,7 +291,28 @@ public void write(JsonWriter out, CredentialList value) throws IOException { public CredentialList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CredentialList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/DecisionInsights.java b/src/main/java/com/corbado/generated/model/DecisionInsights.java index 45b49a8..b693e3b 100644 --- a/src/main/java/com/corbado/generated/model/DecisionInsights.java +++ b/src/main/java/com/corbado/generated/model/DecisionInsights.java @@ -53,7 +53,7 @@ /** * DecisionInsights */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class DecisionInsights { public static final String SERIALIZED_NAME_TAG = "tag"; @SerializedName(SERIALIZED_NAME_TAG) @@ -161,6 +161,50 @@ public void setPreferImmediatelyAvailable(@javax.annotation.Nullable Boolean pre this.preferImmediatelyAvailable = preferImmediatelyAvailable; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DecisionInsights instance itself + */ + public DecisionInsights putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -175,12 +219,13 @@ public boolean equals(Object o) { return Objects.equals(this.tag, decisionInsights.tag) && Objects.equals(this.isCDACandidate, decisionInsights.isCDACandidate) && Objects.equals(this.experiments, decisionInsights.experiments) && - Objects.equals(this.preferImmediatelyAvailable, decisionInsights.preferImmediatelyAvailable); + Objects.equals(this.preferImmediatelyAvailable, decisionInsights.preferImmediatelyAvailable)&& + Objects.equals(this.additionalProperties, decisionInsights.additionalProperties); } @Override public int hashCode() { - return Objects.hash(tag, isCDACandidate, experiments, preferImmediatelyAvailable); + return Objects.hash(tag, isCDACandidate, experiments, preferImmediatelyAvailable, additionalProperties); } @Override @@ -191,6 +236,7 @@ public String toString() { sb.append(" isCDACandidate: ").append(toIndentedString(isCDACandidate)).append("\n"); sb.append(" experiments: ").append(toIndentedString(experiments)).append("\n"); sb.append(" preferImmediatelyAvailable: ").append(toIndentedString(preferImmediatelyAvailable)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -231,14 +277,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DecisionInsights.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `DecisionInsights` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DecisionInsights.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -271,6 +309,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, DecisionInsights value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -278,7 +338,28 @@ public void write(JsonWriter out, DecisionInsights value) throws IOException { public DecisionInsights read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DecisionInsights instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/DecisionInsightsAppend.java b/src/main/java/com/corbado/generated/model/DecisionInsightsAppend.java index 73ad863..d451a67 100644 --- a/src/main/java/com/corbado/generated/model/DecisionInsightsAppend.java +++ b/src/main/java/com/corbado/generated/model/DecisionInsightsAppend.java @@ -51,7 +51,7 @@ /** * DecisionInsightsAppend */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class DecisionInsightsAppend { public static final String SERIALIZED_NAME_TAG = "tag"; @SerializedName(SERIALIZED_NAME_TAG) @@ -209,6 +209,50 @@ public void setAuto(@javax.annotation.Nonnull Boolean auto) { this.auto = auto; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DecisionInsightsAppend instance itself + */ + public DecisionInsightsAppend putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -223,12 +267,13 @@ public boolean equals(Object o) { return Objects.equals(this.tag, decisionInsightsAppend.tag) && Objects.equals(this.isRestrictedBrowser, decisionInsightsAppend.isRestrictedBrowser) && Objects.equals(this.variant, decisionInsightsAppend.variant) && - Objects.equals(this.auto, decisionInsightsAppend.auto); + Objects.equals(this.auto, decisionInsightsAppend.auto)&& + Objects.equals(this.additionalProperties, decisionInsightsAppend.additionalProperties); } @Override public int hashCode() { - return Objects.hash(tag, isRestrictedBrowser, variant, auto); + return Objects.hash(tag, isRestrictedBrowser, variant, auto, additionalProperties); } @Override @@ -239,6 +284,7 @@ public String toString() { sb.append(" isRestrictedBrowser: ").append(toIndentedString(isRestrictedBrowser)).append("\n"); sb.append(" variant: ").append(toIndentedString(variant)).append("\n"); sb.append(" auto: ").append(toIndentedString(auto)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -279,14 +325,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DecisionInsightsAppend.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `DecisionInsightsAppend` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DecisionInsightsAppend.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -318,6 +356,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, DecisionInsightsAppend value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -325,7 +385,28 @@ public void write(JsonWriter out, DecisionInsightsAppend value) throws IOExcepti public DecisionInsightsAppend read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DecisionInsightsAppend instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/DetectionInsights.java b/src/main/java/com/corbado/generated/model/DetectionInsights.java index 195bc40..0dc047b 100644 --- a/src/main/java/com/corbado/generated/model/DetectionInsights.java +++ b/src/main/java/com/corbado/generated/model/DetectionInsights.java @@ -54,7 +54,7 @@ /** * DetectionInsights */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class DetectionInsights { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -210,6 +210,50 @@ public void setHistoryData(@javax.annotation.Nonnull AppendHistoryData historyDa this.historyData = historyData; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DetectionInsights instance itself + */ + public DetectionInsights putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -225,12 +269,13 @@ public boolean equals(Object o) { Objects.equals(this.credentialIds, detectionInsights.credentialIds) && Objects.equals(this.clientEnvIds, detectionInsights.clientEnvIds) && Objects.equals(this.passwordManagerIds, detectionInsights.passwordManagerIds) && - Objects.equals(this.historyData, detectionInsights.historyData); + Objects.equals(this.historyData, detectionInsights.historyData)&& + Objects.equals(this.additionalProperties, detectionInsights.additionalProperties); } @Override public int hashCode() { - return Objects.hash(tags, credentialIds, clientEnvIds, passwordManagerIds, historyData); + return Objects.hash(tags, credentialIds, clientEnvIds, passwordManagerIds, historyData, additionalProperties); } @Override @@ -242,6 +287,7 @@ public String toString() { sb.append(" clientEnvIds: ").append(toIndentedString(clientEnvIds)).append("\n"); sb.append(" passwordManagerIds: ").append(toIndentedString(passwordManagerIds)).append("\n"); sb.append(" historyData: ").append(toIndentedString(historyData)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -282,14 +328,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DetectionInsights.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `DetectionInsights` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DetectionInsights.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -344,6 +382,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, DetectionInsights value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -351,7 +411,28 @@ public void write(JsonWriter out, DetectionInsights value) throws IOException { public DetectionInsights read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DetectionInsights instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/DetectionTag.java b/src/main/java/com/corbado/generated/model/DetectionTag.java index 46bb3f2..d07ecef 100644 --- a/src/main/java/com/corbado/generated/model/DetectionTag.java +++ b/src/main/java/com/corbado/generated/model/DetectionTag.java @@ -50,7 +50,7 @@ /** * DetectionTag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class DetectionTag { /** * Gets or Sets category @@ -158,6 +158,50 @@ public void setName(@javax.annotation.Nonnull String name) { this.name = name; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DetectionTag instance itself + */ + public DetectionTag putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -170,12 +214,13 @@ public boolean equals(Object o) { } DetectionTag detectionTag = (DetectionTag) o; return Objects.equals(this.category, detectionTag.category) && - Objects.equals(this.name, detectionTag.name); + Objects.equals(this.name, detectionTag.name)&& + Objects.equals(this.additionalProperties, detectionTag.additionalProperties); } @Override public int hashCode() { - return Objects.hash(category, name); + return Objects.hash(category, name, additionalProperties); } @Override @@ -184,6 +229,7 @@ public String toString() { sb.append("class DetectionTag {\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -224,14 +270,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DetectionTag.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `DetectionTag` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DetectionTag.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -264,6 +302,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, DetectionTag value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -271,7 +331,28 @@ public void write(JsonWriter out, DetectionTag value) throws IOException { public DetectionTag read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DetectionTag instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ErrorRsp.java b/src/main/java/com/corbado/generated/model/ErrorRsp.java index e8c21c0..6bd7d60 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRsp.java +++ b/src/main/java/com/corbado/generated/model/ErrorRsp.java @@ -52,7 +52,7 @@ /** * ErrorRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ErrorRsp { public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) @@ -200,6 +200,50 @@ public void setError(@javax.annotation.Nonnull ErrorRspAllOfError error) { this.error = error; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ErrorRsp instance itself + */ + public ErrorRsp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -216,12 +260,13 @@ public boolean equals(Object o) { Objects.equals(this.requestData, errorRsp.requestData) && Objects.equals(this.runtime, errorRsp.runtime) && Objects.equals(this.data, errorRsp.data) && - Objects.equals(this.error, errorRsp.error); + Objects.equals(this.error, errorRsp.error)&& + Objects.equals(this.additionalProperties, errorRsp.additionalProperties); } @Override public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data, error); + return Objects.hash(httpStatusCode, message, requestData, runtime, data, error, additionalProperties); } @Override @@ -234,6 +279,7 @@ public String toString() { sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -274,14 +320,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ErrorRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ErrorRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ErrorRsp.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -313,6 +351,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ErrorRsp value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -320,7 +380,28 @@ public void write(JsonWriter out, ErrorRsp value) throws IOException { public ErrorRsp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ErrorRsp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java b/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java index 0d25ab6..2557e02 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java +++ b/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java @@ -53,7 +53,7 @@ /** * ErrorRspAllOfError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ErrorRspAllOfError { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @@ -169,6 +169,50 @@ public void setLinks(@javax.annotation.Nullable List links) { this.links = links; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ErrorRspAllOfError instance itself + */ + public ErrorRspAllOfError putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -183,12 +227,13 @@ public boolean equals(Object o) { return Objects.equals(this.type, errorRspAllOfError.type) && Objects.equals(this.details, errorRspAllOfError.details) && Objects.equals(this.validation, errorRspAllOfError.validation) && - Objects.equals(this.links, errorRspAllOfError.links); + Objects.equals(this.links, errorRspAllOfError.links)&& + Objects.equals(this.additionalProperties, errorRspAllOfError.additionalProperties); } @Override public int hashCode() { - return Objects.hash(type, details, validation, links); + return Objects.hash(type, details, validation, links, additionalProperties); } @Override @@ -199,6 +244,7 @@ public String toString() { sb.append(" details: ").append(toIndentedString(details)).append("\n"); sb.append(" validation: ").append(toIndentedString(validation)).append("\n"); sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -239,14 +285,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ErrorRspAllOfError.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ErrorRspAllOfError` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ErrorRspAllOfError.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -295,6 +333,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ErrorRspAllOfError value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -302,7 +362,28 @@ public void write(JsonWriter out, ErrorRspAllOfError value) throws IOException { public ErrorRspAllOfError read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ErrorRspAllOfError instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java b/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java index b4c06ca..e1bd098 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java +++ b/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java @@ -50,7 +50,7 @@ /** * ErrorRspAllOfErrorValidation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ErrorRspAllOfErrorValidation { public static final String SERIALIZED_NAME_FIELD = "field"; @SerializedName(SERIALIZED_NAME_FIELD) @@ -102,6 +102,50 @@ public void setMessage(@javax.annotation.Nonnull String message) { this.message = message; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ErrorRspAllOfErrorValidation instance itself + */ + public ErrorRspAllOfErrorValidation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -114,12 +158,13 @@ public boolean equals(Object o) { } ErrorRspAllOfErrorValidation errorRspAllOfErrorValidation = (ErrorRspAllOfErrorValidation) o; return Objects.equals(this.field, errorRspAllOfErrorValidation.field) && - Objects.equals(this.message, errorRspAllOfErrorValidation.message); + Objects.equals(this.message, errorRspAllOfErrorValidation.message)&& + Objects.equals(this.additionalProperties, errorRspAllOfErrorValidation.additionalProperties); } @Override public int hashCode() { - return Objects.hash(field, message); + return Objects.hash(field, message, additionalProperties); } @Override @@ -128,6 +173,7 @@ public String toString() { sb.append("class ErrorRspAllOfErrorValidation {\n"); sb.append(" field: ").append(toIndentedString(field)).append("\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -168,14 +214,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ErrorRspAllOfErrorValidation.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ErrorRspAllOfErrorValidation` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ErrorRspAllOfErrorValidation.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -206,6 +244,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ErrorRspAllOfErrorValidation value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -213,7 +273,28 @@ public void write(JsonWriter out, ErrorRspAllOfErrorValidation value) throws IOE public ErrorRspAllOfErrorValidation read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ErrorRspAllOfErrorValidation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/GenericRsp.java b/src/main/java/com/corbado/generated/model/GenericRsp.java index 14d980f..f2df746 100644 --- a/src/main/java/com/corbado/generated/model/GenericRsp.java +++ b/src/main/java/com/corbado/generated/model/GenericRsp.java @@ -51,7 +51,7 @@ /** * GenericRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class GenericRsp { public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) @@ -151,6 +151,50 @@ public void setRuntime(@javax.annotation.Nonnull Float runtime) { this.runtime = runtime; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GenericRsp instance itself + */ + public GenericRsp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -165,12 +209,13 @@ public boolean equals(Object o) { return Objects.equals(this.httpStatusCode, genericRsp.httpStatusCode) && Objects.equals(this.message, genericRsp.message) && Objects.equals(this.requestData, genericRsp.requestData) && - Objects.equals(this.runtime, genericRsp.runtime); + Objects.equals(this.runtime, genericRsp.runtime)&& + Objects.equals(this.additionalProperties, genericRsp.additionalProperties); } @Override public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime); + return Objects.hash(httpStatusCode, message, requestData, runtime, additionalProperties); } @Override @@ -181,6 +226,7 @@ public String toString() { sb.append(" message: ").append(toIndentedString(message)).append("\n"); sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -221,14 +267,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GenericRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `GenericRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GenericRsp.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -258,6 +296,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, GenericRsp value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -265,7 +325,28 @@ public void write(JsonWriter out, GenericRsp value) throws IOException { public GenericRsp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GenericRsp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/Identifier.java b/src/main/java/com/corbado/generated/model/Identifier.java index d2e44fa..f8554f9 100644 --- a/src/main/java/com/corbado/generated/model/Identifier.java +++ b/src/main/java/com/corbado/generated/model/Identifier.java @@ -52,7 +52,7 @@ /** * Identifier */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class Identifier { public static final String SERIALIZED_NAME_IDENTIFIER_I_D = "identifierID"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_I_D) @@ -176,6 +176,50 @@ public void setUserID(@javax.annotation.Nonnull String userID) { this.userID = userID; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Identifier instance itself + */ + public Identifier putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -191,12 +235,13 @@ public boolean equals(Object o) { Objects.equals(this.type, identifier.type) && Objects.equals(this.value, identifier.value) && Objects.equals(this.status, identifier.status) && - Objects.equals(this.userID, identifier.userID); + Objects.equals(this.userID, identifier.userID)&& + Objects.equals(this.additionalProperties, identifier.additionalProperties); } @Override public int hashCode() { - return Objects.hash(identifierID, type, value, status, userID); + return Objects.hash(identifierID, type, value, status, userID, additionalProperties); } @Override @@ -208,6 +253,7 @@ public String toString() { sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -248,14 +294,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Identifier.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `Identifier` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Identifier.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -293,6 +331,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Identifier value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -300,7 +360,28 @@ public void write(JsonWriter out, Identifier value) throws IOException { public Identifier read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Identifier instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java b/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java index 62da12d..336a840 100644 --- a/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java +++ b/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java @@ -52,7 +52,7 @@ /** * IdentifierCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class IdentifierCreateReq { public static final String SERIALIZED_NAME_IDENTIFIER_TYPE = "identifierType"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_TYPE) @@ -128,6 +128,50 @@ public void setStatus(@javax.annotation.Nonnull IdentifierStatus status) { this.status = status; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IdentifierCreateReq instance itself + */ + public IdentifierCreateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -141,12 +185,13 @@ public boolean equals(Object o) { IdentifierCreateReq identifierCreateReq = (IdentifierCreateReq) o; return Objects.equals(this.identifierType, identifierCreateReq.identifierType) && Objects.equals(this.identifierValue, identifierCreateReq.identifierValue) && - Objects.equals(this.status, identifierCreateReq.status); + Objects.equals(this.status, identifierCreateReq.status)&& + Objects.equals(this.additionalProperties, identifierCreateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(identifierType, identifierValue, status); + return Objects.hash(identifierType, identifierValue, status, additionalProperties); } @Override @@ -156,6 +201,7 @@ public String toString() { sb.append(" identifierType: ").append(toIndentedString(identifierType)).append("\n"); sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -196,14 +242,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IdentifierCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `IdentifierCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : IdentifierCreateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -235,6 +273,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, IdentifierCreateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -242,7 +302,28 @@ public void write(JsonWriter out, IdentifierCreateReq value) throws IOException public IdentifierCreateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IdentifierCreateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/IdentifierList.java b/src/main/java/com/corbado/generated/model/IdentifierList.java index cb50391..3abfd88 100644 --- a/src/main/java/com/corbado/generated/model/IdentifierList.java +++ b/src/main/java/com/corbado/generated/model/IdentifierList.java @@ -54,7 +54,7 @@ /** * IdentifierList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class IdentifierList { public static final String SERIALIZED_NAME_IDENTIFIERS = "identifiers"; @SerializedName(SERIALIZED_NAME_IDENTIFIERS) @@ -114,6 +114,50 @@ public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IdentifierList instance itself + */ + public IdentifierList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -126,12 +170,13 @@ public boolean equals(Object o) { } IdentifierList identifierList = (IdentifierList) o; return Objects.equals(this.identifiers, identifierList.identifiers) && - Objects.equals(this.paging, identifierList.paging); + Objects.equals(this.paging, identifierList.paging)&& + Objects.equals(this.additionalProperties, identifierList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(identifiers, paging); + return Objects.hash(identifiers, paging, additionalProperties); } @Override @@ -140,6 +185,7 @@ public String toString() { sb.append("class IdentifierList {\n"); sb.append(" identifiers: ").append(toIndentedString(identifiers)).append("\n"); sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -180,14 +226,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IdentifierList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `IdentifierList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : IdentifierList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -224,6 +262,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, IdentifierList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -231,7 +291,28 @@ public void write(JsonWriter out, IdentifierList value) throws IOException { public IdentifierList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IdentifierList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java b/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java index 3724fe4..3f19339 100644 --- a/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java @@ -51,7 +51,7 @@ /** * IdentifierUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class IdentifierUpdateReq { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) @@ -79,6 +79,50 @@ public void setStatus(@javax.annotation.Nonnull IdentifierStatus status) { this.status = status; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IdentifierUpdateReq instance itself + */ + public IdentifierUpdateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -90,12 +134,13 @@ public boolean equals(Object o) { return false; } IdentifierUpdateReq identifierUpdateReq = (IdentifierUpdateReq) o; - return Objects.equals(this.status, identifierUpdateReq.status); + return Objects.equals(this.status, identifierUpdateReq.status)&& + Objects.equals(this.additionalProperties, identifierUpdateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(status); + return Objects.hash(status, additionalProperties); } @Override @@ -103,6 +148,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IdentifierUpdateReq {\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -143,14 +189,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IdentifierUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `IdentifierUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : IdentifierUpdateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, IdentifierUpdateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, IdentifierUpdateReq value) throws IOException public IdentifierUpdateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IdentifierUpdateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java b/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java index 0f74bd7..e50001d 100644 --- a/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java +++ b/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java @@ -50,7 +50,7 @@ /** * JavaScriptHighEntropy */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class JavaScriptHighEntropy { public static final String SERIALIZED_NAME_PLATFORM = "platform"; @SerializedName(SERIALIZED_NAME_PLATFORM) @@ -126,6 +126,50 @@ public void setMobile(@javax.annotation.Nonnull Boolean mobile) { this.mobile = mobile; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JavaScriptHighEntropy instance itself + */ + public JavaScriptHighEntropy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -139,12 +183,13 @@ public boolean equals(Object o) { JavaScriptHighEntropy javaScriptHighEntropy = (JavaScriptHighEntropy) o; return Objects.equals(this.platform, javaScriptHighEntropy.platform) && Objects.equals(this.platformVersion, javaScriptHighEntropy.platformVersion) && - Objects.equals(this.mobile, javaScriptHighEntropy.mobile); + Objects.equals(this.mobile, javaScriptHighEntropy.mobile)&& + Objects.equals(this.additionalProperties, javaScriptHighEntropy.additionalProperties); } @Override public int hashCode() { - return Objects.hash(platform, platformVersion, mobile); + return Objects.hash(platform, platformVersion, mobile, additionalProperties); } @Override @@ -154,6 +199,7 @@ public String toString() { sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); sb.append(" platformVersion: ").append(toIndentedString(platformVersion)).append("\n"); sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -194,14 +240,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!JavaScriptHighEntropy.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `JavaScriptHighEntropy` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : JavaScriptHighEntropy.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -232,6 +270,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, JavaScriptHighEntropy value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -239,7 +299,28 @@ public void write(JsonWriter out, JavaScriptHighEntropy value) throws IOExceptio public JavaScriptHighEntropy read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JavaScriptHighEntropy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/NativeMeta.java b/src/main/java/com/corbado/generated/model/NativeMeta.java index 6af6069..76caccd 100644 --- a/src/main/java/com/corbado/generated/model/NativeMeta.java +++ b/src/main/java/com/corbado/generated/model/NativeMeta.java @@ -50,7 +50,7 @@ /** * NativeMeta */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class NativeMeta { public static final String SERIALIZED_NAME_BUILD = "build"; @SerializedName(SERIALIZED_NAME_BUILD) @@ -222,6 +222,50 @@ public void setDeviceSecure(@javax.annotation.Nullable Boolean deviceSecure) { this.deviceSecure = deviceSecure; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the NativeMeta instance itself + */ + public NativeMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -239,12 +283,13 @@ public boolean equals(Object o) { Objects.equals(this.isBluetoothAvailable, nativeMeta.isBluetoothAvailable) && Objects.equals(this.isBluetoothOn, nativeMeta.isBluetoothOn) && Objects.equals(this.googlePlayServices, nativeMeta.googlePlayServices) && - Objects.equals(this.deviceSecure, nativeMeta.deviceSecure); + Objects.equals(this.deviceSecure, nativeMeta.deviceSecure)&& + Objects.equals(this.additionalProperties, nativeMeta.additionalProperties); } @Override public int hashCode() { - return Objects.hash(build, deviceOwnerAuth, isPlatformAuthenticatorAPISupported, isBluetoothAvailable, isBluetoothOn, googlePlayServices, deviceSecure); + return Objects.hash(build, deviceOwnerAuth, isPlatformAuthenticatorAPISupported, isBluetoothAvailable, isBluetoothOn, googlePlayServices, deviceSecure, additionalProperties); } @Override @@ -258,6 +303,7 @@ public String toString() { sb.append(" isBluetoothOn: ").append(toIndentedString(isBluetoothOn)).append("\n"); sb.append(" googlePlayServices: ").append(toIndentedString(googlePlayServices)).append("\n"); sb.append(" deviceSecure: ").append(toIndentedString(deviceSecure)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -298,14 +344,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NativeMeta.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `NativeMeta` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NativeMeta.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -336,6 +374,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, NativeMeta value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -343,7 +403,28 @@ public void write(JsonWriter out, NativeMeta value) throws IOException { public NativeMeta read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NativeMeta instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/Paging.java b/src/main/java/com/corbado/generated/model/Paging.java index c453a46..67a0396 100644 --- a/src/main/java/com/corbado/generated/model/Paging.java +++ b/src/main/java/com/corbado/generated/model/Paging.java @@ -50,7 +50,7 @@ /** * Paging */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class Paging { public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) @@ -126,6 +126,50 @@ public void setTotalItems(@javax.annotation.Nonnull Integer totalItems) { this.totalItems = totalItems; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Paging instance itself + */ + public Paging putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -139,12 +183,13 @@ public boolean equals(Object o) { Paging paging = (Paging) o; return Objects.equals(this.page, paging.page) && Objects.equals(this.totalPages, paging.totalPages) && - Objects.equals(this.totalItems, paging.totalItems); + Objects.equals(this.totalItems, paging.totalItems)&& + Objects.equals(this.additionalProperties, paging.additionalProperties); } @Override public int hashCode() { - return Objects.hash(page, totalPages, totalItems); + return Objects.hash(page, totalPages, totalItems, additionalProperties); } @Override @@ -154,6 +199,7 @@ public String toString() { sb.append(" page: ").append(toIndentedString(page)).append("\n"); sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n"); sb.append(" totalItems: ").append(toIndentedString(totalItems)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -194,14 +240,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Paging.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `Paging` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Paging.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -226,6 +264,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Paging value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -233,7 +293,28 @@ public void write(JsonWriter out, Paging value) throws IOException { public Paging read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Paging instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ParsedDeviceInfo.java b/src/main/java/com/corbado/generated/model/ParsedDeviceInfo.java index 19151de..9389ab6 100644 --- a/src/main/java/com/corbado/generated/model/ParsedDeviceInfo.java +++ b/src/main/java/com/corbado/generated/model/ParsedDeviceInfo.java @@ -50,7 +50,7 @@ /** * ParsedDeviceInfo */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ParsedDeviceInfo { public static final String SERIALIZED_NAME_BROWSER_NAME = "browserName"; @SerializedName(SERIALIZED_NAME_BROWSER_NAME) @@ -150,6 +150,50 @@ public void setOsVersion(@javax.annotation.Nonnull String osVersion) { this.osVersion = osVersion; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ParsedDeviceInfo instance itself + */ + public ParsedDeviceInfo putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -164,12 +208,13 @@ public boolean equals(Object o) { return Objects.equals(this.browserName, parsedDeviceInfo.browserName) && Objects.equals(this.browserVersion, parsedDeviceInfo.browserVersion) && Objects.equals(this.osName, parsedDeviceInfo.osName) && - Objects.equals(this.osVersion, parsedDeviceInfo.osVersion); + Objects.equals(this.osVersion, parsedDeviceInfo.osVersion)&& + Objects.equals(this.additionalProperties, parsedDeviceInfo.additionalProperties); } @Override public int hashCode() { - return Objects.hash(browserName, browserVersion, osName, osVersion); + return Objects.hash(browserName, browserVersion, osName, osVersion, additionalProperties); } @Override @@ -180,6 +225,7 @@ public String toString() { sb.append(" browserVersion: ").append(toIndentedString(browserVersion)).append("\n"); sb.append(" osName: ").append(toIndentedString(osName)).append("\n"); sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -220,14 +266,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ParsedDeviceInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ParsedDeviceInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ParsedDeviceInfo.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -264,6 +302,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ParsedDeviceInfo value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -271,7 +331,28 @@ public void write(JsonWriter out, ParsedDeviceInfo value) throws IOException { public ParsedDeviceInfo read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ParsedDeviceInfo instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java index 0fd832a..e3d127e 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java @@ -51,7 +51,7 @@ /** * PasskeyAppendFinishReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyAppendFinishReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) @@ -199,6 +199,50 @@ public void setTrackingID(@javax.annotation.Nonnull String trackingID) { this.trackingID = trackingID; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyAppendFinishReq instance itself + */ + public PasskeyAppendFinishReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -215,12 +259,13 @@ public boolean equals(Object o) { Objects.equals(this.attestationResponse, passkeyAppendFinishReq.attestationResponse) && Objects.equals(this.clientInformation, passkeyAppendFinishReq.clientInformation) && Objects.equals(this.sendNotification, passkeyAppendFinishReq.sendNotification) && - Objects.equals(this.trackingID, passkeyAppendFinishReq.trackingID); + Objects.equals(this.trackingID, passkeyAppendFinishReq.trackingID)&& + Objects.equals(this.additionalProperties, passkeyAppendFinishReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(userID, processID, attestationResponse, clientInformation, sendNotification, trackingID); + return Objects.hash(userID, processID, attestationResponse, clientInformation, sendNotification, trackingID, additionalProperties); } @Override @@ -233,6 +278,7 @@ public String toString() { sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); sb.append(" sendNotification: ").append(toIndentedString(sendNotification)).append("\n"); sb.append(" trackingID: ").append(toIndentedString(trackingID)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -273,14 +319,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyAppendFinishReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyAppendFinishReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyAppendFinishReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -319,6 +357,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyAppendFinishReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -326,7 +386,28 @@ public void write(JsonWriter out, PasskeyAppendFinishReq value) throws IOExcepti public PasskeyAppendFinishReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyAppendFinishReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java index a1b461d..24d5429 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java @@ -51,7 +51,7 @@ /** * PasskeyAppendFinishRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyAppendFinishRsp { public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) @@ -79,6 +79,50 @@ public void setPasskeyData(@javax.annotation.Nonnull PasskeyData passkeyData) { this.passkeyData = passkeyData; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyAppendFinishRsp instance itself + */ + public PasskeyAppendFinishRsp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -90,12 +134,13 @@ public boolean equals(Object o) { return false; } PasskeyAppendFinishRsp passkeyAppendFinishRsp = (PasskeyAppendFinishRsp) o; - return Objects.equals(this.passkeyData, passkeyAppendFinishRsp.passkeyData); + return Objects.equals(this.passkeyData, passkeyAppendFinishRsp.passkeyData)&& + Objects.equals(this.additionalProperties, passkeyAppendFinishRsp.additionalProperties); } @Override public int hashCode() { - return Objects.hash(passkeyData); + return Objects.hash(passkeyData, additionalProperties); } @Override @@ -103,6 +148,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasskeyAppendFinishRsp {\n"); sb.append(" passkeyData: ").append(toIndentedString(passkeyData)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -143,14 +189,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyAppendFinishRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyAppendFinishRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyAppendFinishRsp.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyAppendFinishRsp value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, PasskeyAppendFinishRsp value) throws IOExcepti public PasskeyAppendFinishRsp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyAppendFinishRsp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java index 16c85b1..0840f74 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java @@ -52,7 +52,7 @@ /** * PasskeyAppendStartReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyAppendStartReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) @@ -176,6 +176,50 @@ public void setPasskeyIntelFlags(@javax.annotation.Nonnull PasskeyIntelFlags pas this.passkeyIntelFlags = passkeyIntelFlags; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyAppendStartReq instance itself + */ + public PasskeyAppendStartReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -191,12 +235,13 @@ public boolean equals(Object o) { Objects.equals(this.processID, passkeyAppendStartReq.processID) && Objects.equals(this.username, passkeyAppendStartReq.username) && Objects.equals(this.clientInformation, passkeyAppendStartReq.clientInformation) && - Objects.equals(this.passkeyIntelFlags, passkeyAppendStartReq.passkeyIntelFlags); + Objects.equals(this.passkeyIntelFlags, passkeyAppendStartReq.passkeyIntelFlags)&& + Objects.equals(this.additionalProperties, passkeyAppendStartReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(userID, processID, username, clientInformation, passkeyIntelFlags); + return Objects.hash(userID, processID, username, clientInformation, passkeyIntelFlags, additionalProperties); } @Override @@ -208,6 +253,7 @@ public String toString() { sb.append(" username: ").append(toIndentedString(username)).append("\n"); sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); sb.append(" passkeyIntelFlags: ").append(toIndentedString(passkeyIntelFlags)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -248,14 +294,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyAppendStartReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyAppendStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyAppendStartReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -293,6 +331,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyAppendStartReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -300,7 +360,28 @@ public void write(JsonWriter out, PasskeyAppendStartReq value) throws IOExceptio public PasskeyAppendStartReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyAppendStartReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java index 6ec6f65..2001d50 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java @@ -52,7 +52,7 @@ /** * PasskeyAppendStartRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyAppendStartRsp { public static final String SERIALIZED_NAME_APPEND_ALLOW = "appendAllow"; @SerializedName(SERIALIZED_NAME_APPEND_ALLOW) @@ -152,6 +152,50 @@ public void setDecisionInsights(@javax.annotation.Nonnull DecisionInsightsAppend this.decisionInsights = decisionInsights; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyAppendStartRsp instance itself + */ + public PasskeyAppendStartRsp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -166,12 +210,13 @@ public boolean equals(Object o) { return Objects.equals(this.appendAllow, passkeyAppendStartRsp.appendAllow) && Objects.equals(this.attestationOptions, passkeyAppendStartRsp.attestationOptions) && Objects.equals(this.detectionInsights, passkeyAppendStartRsp.detectionInsights) && - Objects.equals(this.decisionInsights, passkeyAppendStartRsp.decisionInsights); + Objects.equals(this.decisionInsights, passkeyAppendStartRsp.decisionInsights)&& + Objects.equals(this.additionalProperties, passkeyAppendStartRsp.additionalProperties); } @Override public int hashCode() { - return Objects.hash(appendAllow, attestationOptions, detectionInsights, decisionInsights); + return Objects.hash(appendAllow, attestationOptions, detectionInsights, decisionInsights, additionalProperties); } @Override @@ -182,6 +227,7 @@ public String toString() { sb.append(" attestationOptions: ").append(toIndentedString(attestationOptions)).append("\n"); sb.append(" detectionInsights: ").append(toIndentedString(detectionInsights)).append("\n"); sb.append(" decisionInsights: ").append(toIndentedString(decisionInsights)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,14 +268,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyAppendStartRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyAppendStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyAppendStartRsp.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -261,6 +299,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyAppendStartRsp value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -268,7 +328,28 @@ public void write(JsonWriter out, PasskeyAppendStartRsp value) throws IOExceptio public PasskeyAppendStartRsp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyAppendStartRsp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyChallenge.java b/src/main/java/com/corbado/generated/model/PasskeyChallenge.java index a2f8331..3018a06 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyChallenge.java +++ b/src/main/java/com/corbado/generated/model/PasskeyChallenge.java @@ -52,7 +52,7 @@ /** * PasskeyChallenge */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyChallenge { public static final String SERIALIZED_NAME_CHALLENGE_I_D = "challengeID"; @SerializedName(SERIALIZED_NAME_CHALLENGE_I_D) @@ -224,6 +224,50 @@ public void setExpires(@javax.annotation.Nonnull Long expires) { this.expires = expires; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyChallenge instance itself + */ + public PasskeyChallenge putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -241,12 +285,13 @@ public boolean equals(Object o) { Objects.equals(this.status, passkeyChallenge.status) && Objects.equals(this.created, passkeyChallenge.created) && Objects.equals(this.createdMs, passkeyChallenge.createdMs) && - Objects.equals(this.expires, passkeyChallenge.expires); + Objects.equals(this.expires, passkeyChallenge.expires)&& + Objects.equals(this.additionalProperties, passkeyChallenge.additionalProperties); } @Override public int hashCode() { - return Objects.hash(challengeID, type, value, status, created, createdMs, expires); + return Objects.hash(challengeID, type, value, status, created, createdMs, expires, additionalProperties); } @Override @@ -260,6 +305,7 @@ public String toString() { sb.append(" created: ").append(toIndentedString(created)).append("\n"); sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -300,14 +346,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyChallenge.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyChallenge` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyChallenge.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -342,6 +380,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyChallenge value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -349,7 +409,28 @@ public void write(JsonWriter out, PasskeyChallenge value) throws IOException { public PasskeyChallenge read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyChallenge instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyChallengeList.java b/src/main/java/com/corbado/generated/model/PasskeyChallengeList.java index 85a66ad..5e612ee 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyChallengeList.java +++ b/src/main/java/com/corbado/generated/model/PasskeyChallengeList.java @@ -54,7 +54,7 @@ /** * PasskeyChallengeList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyChallengeList { public static final String SERIALIZED_NAME_PASSKEY_CHALLENGES = "passkeyChallenges"; @SerializedName(SERIALIZED_NAME_PASSKEY_CHALLENGES) @@ -114,6 +114,50 @@ public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyChallengeList instance itself + */ + public PasskeyChallengeList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -126,12 +170,13 @@ public boolean equals(Object o) { } PasskeyChallengeList passkeyChallengeList = (PasskeyChallengeList) o; return Objects.equals(this.passkeyChallenges, passkeyChallengeList.passkeyChallenges) && - Objects.equals(this.paging, passkeyChallengeList.paging); + Objects.equals(this.paging, passkeyChallengeList.paging)&& + Objects.equals(this.additionalProperties, passkeyChallengeList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(passkeyChallenges, paging); + return Objects.hash(passkeyChallenges, paging, additionalProperties); } @Override @@ -140,6 +185,7 @@ public String toString() { sb.append("class PasskeyChallengeList {\n"); sb.append(" passkeyChallenges: ").append(toIndentedString(passkeyChallenges)).append("\n"); sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -180,14 +226,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyChallengeList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyChallengeList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyChallengeList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -224,6 +262,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyChallengeList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -231,7 +291,28 @@ public void write(JsonWriter out, PasskeyChallengeList value) throws IOException public PasskeyChallengeList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyChallengeList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java b/src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java index 9bb206b..daa5042 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java @@ -51,7 +51,7 @@ /** * PasskeyChallengeUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyChallengeUpdateReq { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) @@ -79,6 +79,50 @@ public void setStatus(@javax.annotation.Nonnull PasskeyChallengeStatus status) { this.status = status; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyChallengeUpdateReq instance itself + */ + public PasskeyChallengeUpdateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -90,12 +134,13 @@ public boolean equals(Object o) { return false; } PasskeyChallengeUpdateReq passkeyChallengeUpdateReq = (PasskeyChallengeUpdateReq) o; - return Objects.equals(this.status, passkeyChallengeUpdateReq.status); + return Objects.equals(this.status, passkeyChallengeUpdateReq.status)&& + Objects.equals(this.additionalProperties, passkeyChallengeUpdateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(status); + return Objects.hash(status, additionalProperties); } @Override @@ -103,6 +148,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasskeyChallengeUpdateReq {\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -143,14 +189,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyChallengeUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyChallengeUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyChallengeUpdateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyChallengeUpdateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, PasskeyChallengeUpdateReq value) throws IOExce public PasskeyChallengeUpdateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyChallengeUpdateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyData.java b/src/main/java/com/corbado/generated/model/PasskeyData.java index 9eec0f9..cf0eedf 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyData.java +++ b/src/main/java/com/corbado/generated/model/PasskeyData.java @@ -51,7 +51,7 @@ /** * PasskeyData */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyData { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -253,6 +253,50 @@ public void setAaguidDetails(@javax.annotation.Nonnull AaguidDetails aaguidDetai this.aaguidDetails = aaguidDetails; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyData instance itself + */ + public PasskeyData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -269,12 +313,13 @@ public boolean equals(Object o) { Objects.equals(this.username, passkeyData.username) && Objects.equals(this.ceremonyType, passkeyData.ceremonyType) && Objects.equals(this.challengeID, passkeyData.challengeID) && - Objects.equals(this.aaguidDetails, passkeyData.aaguidDetails); + Objects.equals(this.aaguidDetails, passkeyData.aaguidDetails)&& + Objects.equals(this.additionalProperties, passkeyData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, userID, username, ceremonyType, challengeID, aaguidDetails); + return Objects.hash(id, userID, username, ceremonyType, challengeID, aaguidDetails, additionalProperties); } @Override @@ -287,6 +332,7 @@ public String toString() { sb.append(" ceremonyType: ").append(toIndentedString(ceremonyType)).append("\n"); sb.append(" challengeID: ").append(toIndentedString(challengeID)).append("\n"); sb.append(" aaguidDetails: ").append(toIndentedString(aaguidDetails)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -327,14 +373,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyData.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -378,6 +416,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -385,7 +445,28 @@ public void write(JsonWriter out, PasskeyData value) throws IOException { public PasskeyData read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyEvent.java b/src/main/java/com/corbado/generated/model/PasskeyEvent.java index 37f3a58..b3084f7 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyEvent.java +++ b/src/main/java/com/corbado/generated/model/PasskeyEvent.java @@ -51,7 +51,7 @@ /** * PasskeyEvent */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyEvent { public static final String SERIALIZED_NAME_PASSKEY_EVENT_I_D = "passkeyEventID"; @SerializedName(SERIALIZED_NAME_PASSKEY_EVENT_I_D) @@ -271,6 +271,50 @@ public void setCreatedMs(@javax.annotation.Nonnull Long createdMs) { this.createdMs = createdMs; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyEvent instance itself + */ + public PasskeyEvent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -290,12 +334,13 @@ public boolean equals(Object o) { Objects.equals(this.credentialID, passkeyEvent.credentialID) && Objects.equals(this.expires, passkeyEvent.expires) && Objects.equals(this.created, passkeyEvent.created) && - Objects.equals(this.createdMs, passkeyEvent.createdMs); + Objects.equals(this.createdMs, passkeyEvent.createdMs)&& + Objects.equals(this.additionalProperties, passkeyEvent.additionalProperties); } @Override public int hashCode() { - return Objects.hash(passkeyEventID, userID, eventType, clientEnvID, processID, credentialID, expires, created, createdMs); + return Objects.hash(passkeyEventID, userID, eventType, clientEnvID, processID, credentialID, expires, created, createdMs, additionalProperties); } @Override @@ -311,6 +356,7 @@ public String toString() { sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); sb.append(" created: ").append(toIndentedString(created)).append("\n"); sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -351,14 +397,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyEvent.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyEvent` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyEvent.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -403,6 +441,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyEvent value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -410,7 +470,28 @@ public void write(JsonWriter out, PasskeyEvent value) throws IOException { public PasskeyEvent read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyEvent instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java b/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java index 8749ae5..26c8a3a 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java @@ -51,7 +51,7 @@ /** * PasskeyEventCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyEventCreateReq { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) @@ -199,6 +199,50 @@ public void setChallenge(@javax.annotation.Nullable String challenge) { this.challenge = challenge; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyEventCreateReq instance itself + */ + public PasskeyEventCreateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -215,12 +259,13 @@ public boolean equals(Object o) { Objects.equals(this.processID, passkeyEventCreateReq.processID) && Objects.equals(this.clientEnvID, passkeyEventCreateReq.clientEnvID) && Objects.equals(this.credentialID, passkeyEventCreateReq.credentialID) && - Objects.equals(this.challenge, passkeyEventCreateReq.challenge); + Objects.equals(this.challenge, passkeyEventCreateReq.challenge)&& + Objects.equals(this.additionalProperties, passkeyEventCreateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(eventType, expires, processID, clientEnvID, credentialID, challenge); + return Objects.hash(eventType, expires, processID, clientEnvID, credentialID, challenge, additionalProperties); } @Override @@ -233,6 +278,7 @@ public String toString() { sb.append(" clientEnvID: ").append(toIndentedString(clientEnvID)).append("\n"); sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); sb.append(" challenge: ").append(toIndentedString(challenge)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -273,14 +319,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyEventCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyEventCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyEventCreateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -319,6 +357,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyEventCreateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -326,7 +386,28 @@ public void write(JsonWriter out, PasskeyEventCreateReq value) throws IOExceptio public PasskeyEventCreateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyEventCreateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyEventList.java b/src/main/java/com/corbado/generated/model/PasskeyEventList.java index 3327559..5f1bb0a 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyEventList.java +++ b/src/main/java/com/corbado/generated/model/PasskeyEventList.java @@ -54,7 +54,7 @@ /** * PasskeyEventList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyEventList { public static final String SERIALIZED_NAME_PASSKEY_EVENTS = "passkeyEvents"; @SerializedName(SERIALIZED_NAME_PASSKEY_EVENTS) @@ -114,6 +114,50 @@ public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyEventList instance itself + */ + public PasskeyEventList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -126,12 +170,13 @@ public boolean equals(Object o) { } PasskeyEventList passkeyEventList = (PasskeyEventList) o; return Objects.equals(this.passkeyEvents, passkeyEventList.passkeyEvents) && - Objects.equals(this.paging, passkeyEventList.paging); + Objects.equals(this.paging, passkeyEventList.paging)&& + Objects.equals(this.additionalProperties, passkeyEventList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(passkeyEvents, paging); + return Objects.hash(passkeyEvents, paging, additionalProperties); } @Override @@ -140,6 +185,7 @@ public String toString() { sb.append("class PasskeyEventList {\n"); sb.append(" passkeyEvents: ").append(toIndentedString(passkeyEvents)).append("\n"); sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -180,14 +226,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyEventList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyEventList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyEventList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -224,6 +262,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyEventList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -231,7 +291,28 @@ public void write(JsonWriter out, PasskeyEventList value) throws IOException { public PasskeyEventList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyEventList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java b/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java index 3584711..161df3f 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java +++ b/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java @@ -50,7 +50,7 @@ /** * PasskeyIntelFlags */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyIntelFlags { public static final String SERIALIZED_NAME_FORCE_PASSKEY_APPEND = "forcePasskeyAppend"; @SerializedName(SERIALIZED_NAME_FORCE_PASSKEY_APPEND) @@ -102,6 +102,50 @@ public void setAskForAutoAppend(@javax.annotation.Nullable Boolean askForAutoApp this.askForAutoAppend = askForAutoAppend; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyIntelFlags instance itself + */ + public PasskeyIntelFlags putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -114,12 +158,13 @@ public boolean equals(Object o) { } PasskeyIntelFlags passkeyIntelFlags = (PasskeyIntelFlags) o; return Objects.equals(this.forcePasskeyAppend, passkeyIntelFlags.forcePasskeyAppend) && - Objects.equals(this.askForAutoAppend, passkeyIntelFlags.askForAutoAppend); + Objects.equals(this.askForAutoAppend, passkeyIntelFlags.askForAutoAppend)&& + Objects.equals(this.additionalProperties, passkeyIntelFlags.additionalProperties); } @Override public int hashCode() { - return Objects.hash(forcePasskeyAppend, askForAutoAppend); + return Objects.hash(forcePasskeyAppend, askForAutoAppend, additionalProperties); } @Override @@ -128,6 +173,7 @@ public String toString() { sb.append("class PasskeyIntelFlags {\n"); sb.append(" forcePasskeyAppend: ").append(toIndentedString(forcePasskeyAppend)).append("\n"); sb.append(" askForAutoAppend: ").append(toIndentedString(askForAutoAppend)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -168,14 +214,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyIntelFlags.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyIntelFlags` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyIntelFlags.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -200,6 +238,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyIntelFlags value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -207,7 +267,28 @@ public void write(JsonWriter out, PasskeyIntelFlags value) throws IOException { public PasskeyIntelFlags read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyIntelFlags instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java index 146f585..15f7e83 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java @@ -51,7 +51,7 @@ /** * PasskeyLoginFinishReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyLoginFinishReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) @@ -199,6 +199,50 @@ public void setTrackingID(@javax.annotation.Nonnull String trackingID) { this.trackingID = trackingID; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyLoginFinishReq instance itself + */ + public PasskeyLoginFinishReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -215,12 +259,13 @@ public boolean equals(Object o) { Objects.equals(this.clientInformation, passkeyLoginFinishReq.clientInformation) && Objects.equals(this.processID, passkeyLoginFinishReq.processID) && Objects.equals(this.signPasskeyData, passkeyLoginFinishReq.signPasskeyData) && - Objects.equals(this.trackingID, passkeyLoginFinishReq.trackingID); + Objects.equals(this.trackingID, passkeyLoginFinishReq.trackingID)&& + Objects.equals(this.additionalProperties, passkeyLoginFinishReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(userID, assertionResponse, clientInformation, processID, signPasskeyData, trackingID); + return Objects.hash(userID, assertionResponse, clientInformation, processID, signPasskeyData, trackingID, additionalProperties); } @Override @@ -233,6 +278,7 @@ public String toString() { sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); sb.append(" signPasskeyData: ").append(toIndentedString(signPasskeyData)).append("\n"); sb.append(" trackingID: ").append(toIndentedString(trackingID)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -273,14 +319,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyLoginFinishReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyLoginFinishReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyLoginFinishReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -319,6 +357,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyLoginFinishReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -326,7 +386,28 @@ public void write(JsonWriter out, PasskeyLoginFinishReq value) throws IOExceptio public PasskeyLoginFinishReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyLoginFinishReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java index 37085d6..643983a 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java @@ -51,7 +51,7 @@ /** * PasskeyLoginFinishRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyLoginFinishRsp { public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) @@ -103,6 +103,50 @@ public void setSignedPasskeyData(@javax.annotation.Nullable String signedPasskey this.signedPasskeyData = signedPasskeyData; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyLoginFinishRsp instance itself + */ + public PasskeyLoginFinishRsp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -115,12 +159,13 @@ public boolean equals(Object o) { } PasskeyLoginFinishRsp passkeyLoginFinishRsp = (PasskeyLoginFinishRsp) o; return Objects.equals(this.passkeyData, passkeyLoginFinishRsp.passkeyData) && - Objects.equals(this.signedPasskeyData, passkeyLoginFinishRsp.signedPasskeyData); + Objects.equals(this.signedPasskeyData, passkeyLoginFinishRsp.signedPasskeyData)&& + Objects.equals(this.additionalProperties, passkeyLoginFinishRsp.additionalProperties); } @Override public int hashCode() { - return Objects.hash(passkeyData, signedPasskeyData); + return Objects.hash(passkeyData, signedPasskeyData, additionalProperties); } @Override @@ -129,6 +174,7 @@ public String toString() { sb.append("class PasskeyLoginFinishRsp {\n"); sb.append(" passkeyData: ").append(toIndentedString(passkeyData)).append("\n"); sb.append(" signedPasskeyData: ").append(toIndentedString(signedPasskeyData)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -169,14 +215,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyLoginFinishRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyLoginFinishRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyLoginFinishRsp.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -206,6 +244,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyLoginFinishRsp value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -213,7 +273,28 @@ public void write(JsonWriter out, PasskeyLoginFinishRsp value) throws IOExceptio public PasskeyLoginFinishRsp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyLoginFinishRsp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java index 22dd05e..8e19314 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java @@ -52,7 +52,7 @@ /** * PasskeyLoginStartReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyLoginStartReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) @@ -152,6 +152,50 @@ public void setProcessID(@javax.annotation.Nonnull String processID) { this.processID = processID; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyLoginStartReq instance itself + */ + public PasskeyLoginStartReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -166,12 +210,13 @@ public boolean equals(Object o) { return Objects.equals(this.userID, passkeyLoginStartReq.userID) && Objects.equals(this.clientInformation, passkeyLoginStartReq.clientInformation) && Objects.equals(this.crossDeviceAuthenticationStrategy, passkeyLoginStartReq.crossDeviceAuthenticationStrategy) && - Objects.equals(this.processID, passkeyLoginStartReq.processID); + Objects.equals(this.processID, passkeyLoginStartReq.processID)&& + Objects.equals(this.additionalProperties, passkeyLoginStartReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(userID, clientInformation, crossDeviceAuthenticationStrategy, processID); + return Objects.hash(userID, clientInformation, crossDeviceAuthenticationStrategy, processID, additionalProperties); } @Override @@ -182,6 +227,7 @@ public String toString() { sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); sb.append(" crossDeviceAuthenticationStrategy: ").append(toIndentedString(crossDeviceAuthenticationStrategy)).append("\n"); sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,14 +268,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyLoginStartReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyLoginStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyLoginStartReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -264,6 +302,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyLoginStartReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -271,7 +331,28 @@ public void write(JsonWriter out, PasskeyLoginStartReq value) throws IOException public PasskeyLoginStartReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyLoginStartReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java index 896920e..8438382 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java @@ -52,7 +52,7 @@ /** * PasskeyLoginStartRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyLoginStartRsp { public static final String SERIALIZED_NAME_LOGIN_ALLOW = "loginAllow"; @SerializedName(SERIALIZED_NAME_LOGIN_ALLOW) @@ -152,6 +152,50 @@ public void setDecisionInsights(@javax.annotation.Nonnull DecisionInsights decis this.decisionInsights = decisionInsights; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyLoginStartRsp instance itself + */ + public PasskeyLoginStartRsp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -166,12 +210,13 @@ public boolean equals(Object o) { return Objects.equals(this.loginAllow, passkeyLoginStartRsp.loginAllow) && Objects.equals(this.assertionOptions, passkeyLoginStartRsp.assertionOptions) && Objects.equals(this.detectionInsights, passkeyLoginStartRsp.detectionInsights) && - Objects.equals(this.decisionInsights, passkeyLoginStartRsp.decisionInsights); + Objects.equals(this.decisionInsights, passkeyLoginStartRsp.decisionInsights)&& + Objects.equals(this.additionalProperties, passkeyLoginStartRsp.additionalProperties); } @Override public int hashCode() { - return Objects.hash(loginAllow, assertionOptions, detectionInsights, decisionInsights); + return Objects.hash(loginAllow, assertionOptions, detectionInsights, decisionInsights, additionalProperties); } @Override @@ -182,6 +227,7 @@ public String toString() { sb.append(" assertionOptions: ").append(toIndentedString(assertionOptions)).append("\n"); sb.append(" detectionInsights: ").append(toIndentedString(detectionInsights)).append("\n"); sb.append(" decisionInsights: ").append(toIndentedString(decisionInsights)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -222,14 +268,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyLoginStartRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyLoginStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyLoginStartRsp.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -261,6 +299,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyLoginStartRsp value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -268,7 +328,28 @@ public void write(JsonWriter out, PasskeyLoginStartRsp value) throws IOException public PasskeyLoginStartRsp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyLoginStartRsp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishErrorAlternativeProject.java b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishErrorAlternativeProject.java index f3ff4c4..b8cecc2 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishErrorAlternativeProject.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishErrorAlternativeProject.java @@ -50,7 +50,7 @@ /** * PasskeyMediationFinishErrorAlternativeProject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyMediationFinishErrorAlternativeProject { /** * Gets or Sets type @@ -152,6 +152,50 @@ public void setAlternativeProjectName(@javax.annotation.Nonnull String alternati this.alternativeProjectName = alternativeProjectName; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyMediationFinishErrorAlternativeProject instance itself + */ + public PasskeyMediationFinishErrorAlternativeProject putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -164,12 +208,13 @@ public boolean equals(Object o) { } PasskeyMediationFinishErrorAlternativeProject passkeyMediationFinishErrorAlternativeProject = (PasskeyMediationFinishErrorAlternativeProject) o; return Objects.equals(this.type, passkeyMediationFinishErrorAlternativeProject.type) && - Objects.equals(this.alternativeProjectName, passkeyMediationFinishErrorAlternativeProject.alternativeProjectName); + Objects.equals(this.alternativeProjectName, passkeyMediationFinishErrorAlternativeProject.alternativeProjectName)&& + Objects.equals(this.additionalProperties, passkeyMediationFinishErrorAlternativeProject.additionalProperties); } @Override public int hashCode() { - return Objects.hash(type, alternativeProjectName); + return Objects.hash(type, alternativeProjectName, additionalProperties); } @Override @@ -178,6 +223,7 @@ public String toString() { sb.append("class PasskeyMediationFinishErrorAlternativeProject {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" alternativeProjectName: ").append(toIndentedString(alternativeProjectName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -218,14 +264,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyMediationFinishErrorAlternativeProject.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyMediationFinishErrorAlternativeProject` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyMediationFinishErrorAlternativeProject.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -258,6 +296,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyMediationFinishErrorAlternativeProject value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -265,7 +325,28 @@ public void write(JsonWriter out, PasskeyMediationFinishErrorAlternativeProject public PasskeyMediationFinishErrorAlternativeProject read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyMediationFinishErrorAlternativeProject instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishErrorCredentialDeleted.java b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishErrorCredentialDeleted.java index 31d5f26..8a0472a 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishErrorCredentialDeleted.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishErrorCredentialDeleted.java @@ -50,7 +50,7 @@ /** * PasskeyMediationFinishErrorCredentialDeleted */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyMediationFinishErrorCredentialDeleted { /** * Gets or Sets type @@ -128,6 +128,50 @@ public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyMediationFinishErrorCredentialDeleted instance itself + */ + public PasskeyMediationFinishErrorCredentialDeleted putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -139,12 +183,13 @@ public boolean equals(Object o) { return false; } PasskeyMediationFinishErrorCredentialDeleted passkeyMediationFinishErrorCredentialDeleted = (PasskeyMediationFinishErrorCredentialDeleted) o; - return Objects.equals(this.type, passkeyMediationFinishErrorCredentialDeleted.type); + return Objects.equals(this.type, passkeyMediationFinishErrorCredentialDeleted.type)&& + Objects.equals(this.additionalProperties, passkeyMediationFinishErrorCredentialDeleted.additionalProperties); } @Override public int hashCode() { - return Objects.hash(type); + return Objects.hash(type, additionalProperties); } @Override @@ -152,6 +197,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasskeyMediationFinishErrorCredentialDeleted {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -192,14 +238,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyMediationFinishErrorCredentialDeleted.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyMediationFinishErrorCredentialDeleted` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyMediationFinishErrorCredentialDeleted.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -229,6 +267,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyMediationFinishErrorCredentialDeleted value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -236,7 +296,28 @@ public void write(JsonWriter out, PasskeyMediationFinishErrorCredentialDeleted v public PasskeyMediationFinishErrorCredentialDeleted read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyMediationFinishErrorCredentialDeleted instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java index a0994e0..7318eb5 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java @@ -51,7 +51,7 @@ /** * PasskeyMediationFinishReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyMediationFinishReq { public static final String SERIALIZED_NAME_ASSERTION_RESPONSE = "assertionResponse"; @SerializedName(SERIALIZED_NAME_ASSERTION_RESPONSE) @@ -175,6 +175,50 @@ public void setTrackingID(@javax.annotation.Nonnull String trackingID) { this.trackingID = trackingID; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyMediationFinishReq instance itself + */ + public PasskeyMediationFinishReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -190,12 +234,13 @@ public boolean equals(Object o) { Objects.equals(this.clientInformation, passkeyMediationFinishReq.clientInformation) && Objects.equals(this.processID, passkeyMediationFinishReq.processID) && Objects.equals(this.signPasskeyData, passkeyMediationFinishReq.signPasskeyData) && - Objects.equals(this.trackingID, passkeyMediationFinishReq.trackingID); + Objects.equals(this.trackingID, passkeyMediationFinishReq.trackingID)&& + Objects.equals(this.additionalProperties, passkeyMediationFinishReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(assertionResponse, clientInformation, processID, signPasskeyData, trackingID); + return Objects.hash(assertionResponse, clientInformation, processID, signPasskeyData, trackingID, additionalProperties); } @Override @@ -207,6 +252,7 @@ public String toString() { sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); sb.append(" signPasskeyData: ").append(toIndentedString(signPasskeyData)).append("\n"); sb.append(" trackingID: ").append(toIndentedString(trackingID)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -247,14 +293,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyMediationFinishReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyMediationFinishReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyMediationFinishReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -290,6 +328,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyMediationFinishReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -297,7 +357,28 @@ public void write(JsonWriter out, PasskeyMediationFinishReq value) throws IOExce public PasskeyMediationFinishReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyMediationFinishReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java index 2d2f107..31c53a1 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java @@ -52,7 +52,7 @@ /** * PasskeyMediationFinishRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyMediationFinishRsp { public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) @@ -128,6 +128,50 @@ public void setError(@javax.annotation.Nullable PasskeyMediationFinishRspError e this.error = error; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyMediationFinishRsp instance itself + */ + public PasskeyMediationFinishRsp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -141,12 +185,13 @@ public boolean equals(Object o) { PasskeyMediationFinishRsp passkeyMediationFinishRsp = (PasskeyMediationFinishRsp) o; return Objects.equals(this.passkeyData, passkeyMediationFinishRsp.passkeyData) && Objects.equals(this.signedPasskeyData, passkeyMediationFinishRsp.signedPasskeyData) && - Objects.equals(this.error, passkeyMediationFinishRsp.error); + Objects.equals(this.error, passkeyMediationFinishRsp.error)&& + Objects.equals(this.additionalProperties, passkeyMediationFinishRsp.additionalProperties); } @Override public int hashCode() { - return Objects.hash(passkeyData, signedPasskeyData, error); + return Objects.hash(passkeyData, signedPasskeyData, error, additionalProperties); } @Override @@ -156,6 +201,7 @@ public String toString() { sb.append(" passkeyData: ").append(toIndentedString(passkeyData)).append("\n"); sb.append(" signedPasskeyData: ").append(toIndentedString(signedPasskeyData)).append("\n"); sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -196,14 +242,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyMediationFinishRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyMediationFinishRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyMediationFinishRsp.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -237,6 +275,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyMediationFinishRsp value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -244,7 +304,28 @@ public void write(JsonWriter out, PasskeyMediationFinishRsp value) throws IOExce public PasskeyMediationFinishRsp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyMediationFinishRsp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRspError.java b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRspError.java index 56acc08..c6dfe6b 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRspError.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRspError.java @@ -61,7 +61,7 @@ import com.corbado.generated.invoker.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyMediationFinishRspError extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(PasskeyMediationFinishRspError.class.getName()); diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java index a584a92..f037c38 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java @@ -51,7 +51,7 @@ /** * PasskeyMediationStartReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyMediationStartReq { public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) @@ -79,6 +79,50 @@ public void setClientInformation(@javax.annotation.Nonnull ClientInformation cli this.clientInformation = clientInformation; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyMediationStartReq instance itself + */ + public PasskeyMediationStartReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -90,12 +134,13 @@ public boolean equals(Object o) { return false; } PasskeyMediationStartReq passkeyMediationStartReq = (PasskeyMediationStartReq) o; - return Objects.equals(this.clientInformation, passkeyMediationStartReq.clientInformation); + return Objects.equals(this.clientInformation, passkeyMediationStartReq.clientInformation)&& + Objects.equals(this.additionalProperties, passkeyMediationStartReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(clientInformation); + return Objects.hash(clientInformation, additionalProperties); } @Override @@ -103,6 +148,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasskeyMediationStartReq {\n"); sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -143,14 +189,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyMediationStartReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyMediationStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyMediationStartReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyMediationStartReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, PasskeyMediationStartReq value) throws IOExcep public PasskeyMediationStartReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyMediationStartReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java index 860acbe..66114e0 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java @@ -50,7 +50,7 @@ /** * PasskeyMediationStartRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyMediationStartRsp { public static final String SERIALIZED_NAME_LOGIN_ALLOW = "loginAllow"; @SerializedName(SERIALIZED_NAME_LOGIN_ALLOW) @@ -102,6 +102,50 @@ public void setAssertionOptions(@javax.annotation.Nonnull String assertionOption this.assertionOptions = assertionOptions; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyMediationStartRsp instance itself + */ + public PasskeyMediationStartRsp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -114,12 +158,13 @@ public boolean equals(Object o) { } PasskeyMediationStartRsp passkeyMediationStartRsp = (PasskeyMediationStartRsp) o; return Objects.equals(this.loginAllow, passkeyMediationStartRsp.loginAllow) && - Objects.equals(this.assertionOptions, passkeyMediationStartRsp.assertionOptions); + Objects.equals(this.assertionOptions, passkeyMediationStartRsp.assertionOptions)&& + Objects.equals(this.additionalProperties, passkeyMediationStartRsp.additionalProperties); } @Override public int hashCode() { - return Objects.hash(loginAllow, assertionOptions); + return Objects.hash(loginAllow, assertionOptions, additionalProperties); } @Override @@ -128,6 +173,7 @@ public String toString() { sb.append("class PasskeyMediationStartRsp {\n"); sb.append(" loginAllow: ").append(toIndentedString(loginAllow)).append("\n"); sb.append(" assertionOptions: ").append(toIndentedString(assertionOptions)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -168,14 +214,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyMediationStartRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyMediationStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyMediationStartRsp.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -203,6 +241,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyMediationStartRsp value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -210,7 +270,28 @@ public void write(JsonWriter out, PasskeyMediationStartRsp value) throws IOExcep public PasskeyMediationStartRsp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyMediationStartRsp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyPostLoginReq.java b/src/main/java/com/corbado/generated/model/PasskeyPostLoginReq.java index ee303f3..cff3590 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyPostLoginReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyPostLoginReq.java @@ -50,7 +50,7 @@ /** * PasskeyPostLoginReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyPostLoginReq { public static final String SERIALIZED_NAME_SIGNED_PASSKEY_DATA = "signedPasskeyData"; @SerializedName(SERIALIZED_NAME_SIGNED_PASSKEY_DATA) @@ -78,6 +78,50 @@ public void setSignedPasskeyData(@javax.annotation.Nonnull String signedPasskeyD this.signedPasskeyData = signedPasskeyData; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyPostLoginReq instance itself + */ + public PasskeyPostLoginReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -89,12 +133,13 @@ public boolean equals(Object o) { return false; } PasskeyPostLoginReq passkeyPostLoginReq = (PasskeyPostLoginReq) o; - return Objects.equals(this.signedPasskeyData, passkeyPostLoginReq.signedPasskeyData); + return Objects.equals(this.signedPasskeyData, passkeyPostLoginReq.signedPasskeyData)&& + Objects.equals(this.additionalProperties, passkeyPostLoginReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(signedPasskeyData); + return Objects.hash(signedPasskeyData, additionalProperties); } @Override @@ -102,6 +147,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasskeyPostLoginReq {\n"); sb.append(" signedPasskeyData: ").append(toIndentedString(signedPasskeyData)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -142,14 +188,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyPostLoginReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyPostLoginReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyPostLoginReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyPostLoginReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, PasskeyPostLoginReq value) throws IOException public PasskeyPostLoginReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyPostLoginReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyPostLoginRsp.java b/src/main/java/com/corbado/generated/model/PasskeyPostLoginRsp.java index d22c019..1907a50 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyPostLoginRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyPostLoginRsp.java @@ -50,7 +50,7 @@ /** * PasskeyPostLoginRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyPostLoginRsp { public static final String SERIALIZED_NAME_SESSION = "session"; @SerializedName(SERIALIZED_NAME_SESSION) @@ -78,6 +78,50 @@ public void setSession(@javax.annotation.Nonnull String session) { this.session = session; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyPostLoginRsp instance itself + */ + public PasskeyPostLoginRsp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -89,12 +133,13 @@ public boolean equals(Object o) { return false; } PasskeyPostLoginRsp passkeyPostLoginRsp = (PasskeyPostLoginRsp) o; - return Objects.equals(this.session, passkeyPostLoginRsp.session); + return Objects.equals(this.session, passkeyPostLoginRsp.session)&& + Objects.equals(this.additionalProperties, passkeyPostLoginRsp.additionalProperties); } @Override public int hashCode() { - return Objects.hash(session); + return Objects.hash(session, additionalProperties); } @Override @@ -102,6 +147,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasskeyPostLoginRsp {\n"); sb.append(" session: ").append(toIndentedString(session)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -142,14 +188,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyPostLoginRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyPostLoginRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyPostLoginRsp.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyPostLoginRsp value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, PasskeyPostLoginRsp value) throws IOException public PasskeyPostLoginRsp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyPostLoginRsp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyVerifySignedDataReq.java b/src/main/java/com/corbado/generated/model/PasskeyVerifySignedDataReq.java index 961e003..d409628 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyVerifySignedDataReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyVerifySignedDataReq.java @@ -50,7 +50,7 @@ /** * PasskeyVerifySignedDataReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyVerifySignedDataReq { public static final String SERIALIZED_NAME_SIGNED_PASSKEY_DATA = "signedPasskeyData"; @SerializedName(SERIALIZED_NAME_SIGNED_PASSKEY_DATA) @@ -102,6 +102,50 @@ public void setUsername(@javax.annotation.Nonnull String username) { this.username = username; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyVerifySignedDataReq instance itself + */ + public PasskeyVerifySignedDataReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -114,12 +158,13 @@ public boolean equals(Object o) { } PasskeyVerifySignedDataReq passkeyVerifySignedDataReq = (PasskeyVerifySignedDataReq) o; return Objects.equals(this.signedPasskeyData, passkeyVerifySignedDataReq.signedPasskeyData) && - Objects.equals(this.username, passkeyVerifySignedDataReq.username); + Objects.equals(this.username, passkeyVerifySignedDataReq.username)&& + Objects.equals(this.additionalProperties, passkeyVerifySignedDataReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(signedPasskeyData, username); + return Objects.hash(signedPasskeyData, username, additionalProperties); } @Override @@ -128,6 +173,7 @@ public String toString() { sb.append("class PasskeyVerifySignedDataReq {\n"); sb.append(" signedPasskeyData: ").append(toIndentedString(signedPasskeyData)).append("\n"); sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -168,14 +214,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyVerifySignedDataReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyVerifySignedDataReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyVerifySignedDataReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -206,6 +244,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyVerifySignedDataReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -213,7 +273,28 @@ public void write(JsonWriter out, PasskeyVerifySignedDataReq value) throws IOExc public PasskeyVerifySignedDataReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyVerifySignedDataReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasskeyVerifySignedDataRsp.java b/src/main/java/com/corbado/generated/model/PasskeyVerifySignedDataRsp.java index 303ae89..24a776e 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyVerifySignedDataRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyVerifySignedDataRsp.java @@ -50,7 +50,7 @@ /** * PasskeyVerifySignedDataRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasskeyVerifySignedDataRsp { /** * Gets or Sets verificationResult @@ -136,6 +136,50 @@ public void setVerificationResult(@javax.annotation.Nonnull VerificationResultEn this.verificationResult = verificationResult; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyVerifySignedDataRsp instance itself + */ + public PasskeyVerifySignedDataRsp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -147,12 +191,13 @@ public boolean equals(Object o) { return false; } PasskeyVerifySignedDataRsp passkeyVerifySignedDataRsp = (PasskeyVerifySignedDataRsp) o; - return Objects.equals(this.verificationResult, passkeyVerifySignedDataRsp.verificationResult); + return Objects.equals(this.verificationResult, passkeyVerifySignedDataRsp.verificationResult)&& + Objects.equals(this.additionalProperties, passkeyVerifySignedDataRsp.additionalProperties); } @Override public int hashCode() { - return Objects.hash(verificationResult); + return Objects.hash(verificationResult, additionalProperties); } @Override @@ -160,6 +205,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasskeyVerifySignedDataRsp {\n"); sb.append(" verificationResult: ").append(toIndentedString(verificationResult)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -200,14 +246,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasskeyVerifySignedDataRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasskeyVerifySignedDataRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasskeyVerifySignedDataRsp.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -237,6 +275,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasskeyVerifySignedDataRsp value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -244,7 +304,28 @@ public void write(JsonWriter out, PasskeyVerifySignedDataRsp value) throws IOExc public PasskeyVerifySignedDataRsp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyVerifySignedDataRsp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasswordManager.java b/src/main/java/com/corbado/generated/model/PasswordManager.java index 9c3a671..bbff19a 100644 --- a/src/main/java/com/corbado/generated/model/PasswordManager.java +++ b/src/main/java/com/corbado/generated/model/PasswordManager.java @@ -50,7 +50,7 @@ /** * PasswordManager */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasswordManager { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -246,6 +246,50 @@ public void setCreatedMs(@javax.annotation.Nonnull Long createdMs) { this.createdMs = createdMs; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordManager instance itself + */ + public PasswordManager putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -264,12 +308,13 @@ public boolean equals(Object o) { Objects.equals(this.aaguid, passwordManager.aaguid) && Objects.equals(this.status, passwordManager.status) && Objects.equals(this.score, passwordManager.score) && - Objects.equals(this.createdMs, passwordManager.createdMs); + Objects.equals(this.createdMs, passwordManager.createdMs)&& + Objects.equals(this.additionalProperties, passwordManager.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, userID, clientEnvID, credentialID, aaguid, status, score, createdMs); + return Objects.hash(id, userID, clientEnvID, credentialID, aaguid, status, score, createdMs, additionalProperties); } @Override @@ -284,6 +329,7 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" score: ").append(toIndentedString(score)).append("\n"); sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -324,14 +370,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasswordManager.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasswordManager` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasswordManager.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -374,6 +412,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasswordManager value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -381,7 +441,28 @@ public void write(JsonWriter out, PasswordManager value) throws IOException { public PasswordManager read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordManager instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/PasswordManagerList.java b/src/main/java/com/corbado/generated/model/PasswordManagerList.java index cc3f265..5ba49f1 100644 --- a/src/main/java/com/corbado/generated/model/PasswordManagerList.java +++ b/src/main/java/com/corbado/generated/model/PasswordManagerList.java @@ -53,7 +53,7 @@ /** * PasswordManagerList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class PasswordManagerList { public static final String SERIALIZED_NAME_PASSWORD_MANAGERS = "passwordManagers"; @SerializedName(SERIALIZED_NAME_PASSWORD_MANAGERS) @@ -89,6 +89,50 @@ public void setPasswordManagers(@javax.annotation.Nonnull List this.passwordManagers = passwordManagers; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordManagerList instance itself + */ + public PasswordManagerList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -100,12 +144,13 @@ public boolean equals(Object o) { return false; } PasswordManagerList passwordManagerList = (PasswordManagerList) o; - return Objects.equals(this.passwordManagers, passwordManagerList.passwordManagers); + return Objects.equals(this.passwordManagers, passwordManagerList.passwordManagers)&& + Objects.equals(this.additionalProperties, passwordManagerList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(passwordManagers); + return Objects.hash(passwordManagers, additionalProperties); } @Override @@ -113,6 +158,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PasswordManagerList {\n"); sb.append(" passwordManagers: ").append(toIndentedString(passwordManagers)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -153,14 +199,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PasswordManagerList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `PasswordManagerList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PasswordManagerList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -195,6 +233,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PasswordManagerList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -202,7 +262,28 @@ public void write(JsonWriter out, PasswordManagerList value) throws IOException public PasswordManagerList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordManagerList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java b/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java index 476d8cc..5c4ec8b 100644 --- a/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java +++ b/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java @@ -50,7 +50,7 @@ /** * ProjectConfigUpdateCnameReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class ProjectConfigUpdateCnameReq { public static final String SERIALIZED_NAME_CNAME = "cname"; @SerializedName(SERIALIZED_NAME_CNAME) @@ -78,6 +78,50 @@ public void setCname(@javax.annotation.Nonnull String cname) { this.cname = cname; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProjectConfigUpdateCnameReq instance itself + */ + public ProjectConfigUpdateCnameReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -89,12 +133,13 @@ public boolean equals(Object o) { return false; } ProjectConfigUpdateCnameReq projectConfigUpdateCnameReq = (ProjectConfigUpdateCnameReq) o; - return Objects.equals(this.cname, projectConfigUpdateCnameReq.cname); + return Objects.equals(this.cname, projectConfigUpdateCnameReq.cname)&& + Objects.equals(this.additionalProperties, projectConfigUpdateCnameReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(cname); + return Objects.hash(cname, additionalProperties); } @Override @@ -102,6 +147,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProjectConfigUpdateCnameReq {\n"); sb.append(" cname: ").append(toIndentedString(cname)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -142,14 +188,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectConfigUpdateCnameReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `ProjectConfigUpdateCnameReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ProjectConfigUpdateCnameReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -177,6 +215,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ProjectConfigUpdateCnameReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -184,7 +244,28 @@ public void write(JsonWriter out, ProjectConfigUpdateCnameReq value) throws IOEx public ProjectConfigUpdateCnameReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProjectConfigUpdateCnameReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/RequestData.java b/src/main/java/com/corbado/generated/model/RequestData.java index 73c31a3..a80c17b 100644 --- a/src/main/java/com/corbado/generated/model/RequestData.java +++ b/src/main/java/com/corbado/generated/model/RequestData.java @@ -50,7 +50,7 @@ /** * Data about the request itself, can be used for debugging */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class RequestData { public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; @SerializedName(SERIALIZED_NAME_REQUEST_I_D) @@ -102,6 +102,50 @@ public void setLink(@javax.annotation.Nullable String link) { this.link = link; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RequestData instance itself + */ + public RequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -114,12 +158,13 @@ public boolean equals(Object o) { } RequestData requestData = (RequestData) o; return Objects.equals(this.requestID, requestData.requestID) && - Objects.equals(this.link, requestData.link); + Objects.equals(this.link, requestData.link)&& + Objects.equals(this.additionalProperties, requestData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(requestID, link); + return Objects.hash(requestID, link, additionalProperties); } @Override @@ -128,6 +173,7 @@ public String toString() { sb.append("class RequestData {\n"); sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -168,14 +214,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RequestData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `RequestData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : RequestData.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -206,6 +244,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, RequestData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -213,7 +273,28 @@ public void write(JsonWriter out, RequestData value) throws IOException { public RequestData read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RequestData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/Session.java b/src/main/java/com/corbado/generated/model/Session.java index bdc605b..ff2357c 100644 --- a/src/main/java/com/corbado/generated/model/Session.java +++ b/src/main/java/com/corbado/generated/model/Session.java @@ -51,7 +51,7 @@ /** * Session */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class Session { public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; @SerializedName(SERIALIZED_NAME_SESSION_I_D) @@ -223,6 +223,50 @@ public void setStatus(@javax.annotation.Nonnull SessionStatus status) { this.status = status; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Session instance itself + */ + public Session putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -240,12 +284,13 @@ public boolean equals(Object o) { Objects.equals(this.createdMs, session.createdMs) && Objects.equals(this.lastActionMs, session.lastActionMs) && Objects.equals(this.expiresMs, session.expiresMs) && - Objects.equals(this.status, session.status); + Objects.equals(this.status, session.status)&& + Objects.equals(this.additionalProperties, session.additionalProperties); } @Override public int hashCode() { - return Objects.hash(sessionID, userID, identifierValue, createdMs, lastActionMs, expiresMs, status); + return Objects.hash(sessionID, userID, identifierValue, createdMs, lastActionMs, expiresMs, status, additionalProperties); } @Override @@ -259,6 +304,7 @@ public String toString() { sb.append(" lastActionMs: ").append(toIndentedString(lastActionMs)).append("\n"); sb.append(" expiresMs: ").append(toIndentedString(expiresMs)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -299,14 +345,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Session.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `Session` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Session.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -342,6 +380,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Session value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -349,7 +409,28 @@ public void write(JsonWriter out, Session value) throws IOException { public Session read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Session instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/SessionList.java b/src/main/java/com/corbado/generated/model/SessionList.java index 6adfb7c..0310699 100644 --- a/src/main/java/com/corbado/generated/model/SessionList.java +++ b/src/main/java/com/corbado/generated/model/SessionList.java @@ -54,7 +54,7 @@ /** * SessionList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class SessionList { public static final String SERIALIZED_NAME_SESSIONS = "sessions"; @SerializedName(SERIALIZED_NAME_SESSIONS) @@ -114,6 +114,50 @@ public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SessionList instance itself + */ + public SessionList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -126,12 +170,13 @@ public boolean equals(Object o) { } SessionList sessionList = (SessionList) o; return Objects.equals(this.sessions, sessionList.sessions) && - Objects.equals(this.paging, sessionList.paging); + Objects.equals(this.paging, sessionList.paging)&& + Objects.equals(this.additionalProperties, sessionList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(sessions, paging); + return Objects.hash(sessions, paging, additionalProperties); } @Override @@ -140,6 +185,7 @@ public String toString() { sb.append("class SessionList {\n"); sb.append(" sessions: ").append(toIndentedString(sessions)).append("\n"); sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -180,14 +226,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `SessionList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SessionList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -224,6 +262,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SessionList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -231,7 +291,28 @@ public void write(JsonWriter out, SessionList value) throws IOException { public SessionList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SessionList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/SocialAccount.java b/src/main/java/com/corbado/generated/model/SocialAccount.java index 861b000..a283973 100644 --- a/src/main/java/com/corbado/generated/model/SocialAccount.java +++ b/src/main/java/com/corbado/generated/model/SocialAccount.java @@ -50,7 +50,7 @@ /** * SocialAccount */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class SocialAccount { public static final String SERIALIZED_NAME_SOCIAL_ACCOUNT_I_D = "socialAccountID"; @SerializedName(SERIALIZED_NAME_SOCIAL_ACCOUNT_I_D) @@ -222,6 +222,50 @@ public void setFullName(@javax.annotation.Nonnull String fullName) { this.fullName = fullName; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialAccount instance itself + */ + public SocialAccount putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -239,12 +283,13 @@ public boolean equals(Object o) { Objects.equals(this.userID, socialAccount.userID) && Objects.equals(this.foreignID, socialAccount.foreignID) && Objects.equals(this.avatarURL, socialAccount.avatarURL) && - Objects.equals(this.fullName, socialAccount.fullName); + Objects.equals(this.fullName, socialAccount.fullName)&& + Objects.equals(this.additionalProperties, socialAccount.additionalProperties); } @Override public int hashCode() { - return Objects.hash(socialAccountID, providerType, identifierValue, userID, foreignID, avatarURL, fullName); + return Objects.hash(socialAccountID, providerType, identifierValue, userID, foreignID, avatarURL, fullName, additionalProperties); } @Override @@ -258,6 +303,7 @@ public String toString() { sb.append(" foreignID: ").append(toIndentedString(foreignID)).append("\n"); sb.append(" avatarURL: ").append(toIndentedString(avatarURL)).append("\n"); sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -298,14 +344,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SocialAccount.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `SocialAccount` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SocialAccount.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -351,6 +389,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SocialAccount value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -358,7 +418,28 @@ public void write(JsonWriter out, SocialAccount value) throws IOException { public SocialAccount read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialAccount instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java b/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java index 2081e87..9438d68 100644 --- a/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java +++ b/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java @@ -51,7 +51,7 @@ /** * SocialAccountCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class SocialAccountCreateReq { public static final String SERIALIZED_NAME_PROVIDER_TYPE = "providerType"; @SerializedName(SERIALIZED_NAME_PROVIDER_TYPE) @@ -175,6 +175,50 @@ public void setFullName(@javax.annotation.Nonnull String fullName) { this.fullName = fullName; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialAccountCreateReq instance itself + */ + public SocialAccountCreateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -190,12 +234,13 @@ public boolean equals(Object o) { Objects.equals(this.identifierValue, socialAccountCreateReq.identifierValue) && Objects.equals(this.foreignID, socialAccountCreateReq.foreignID) && Objects.equals(this.avatarURL, socialAccountCreateReq.avatarURL) && - Objects.equals(this.fullName, socialAccountCreateReq.fullName); + Objects.equals(this.fullName, socialAccountCreateReq.fullName)&& + Objects.equals(this.additionalProperties, socialAccountCreateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(providerType, identifierValue, foreignID, avatarURL, fullName); + return Objects.hash(providerType, identifierValue, foreignID, avatarURL, fullName, additionalProperties); } @Override @@ -207,6 +252,7 @@ public String toString() { sb.append(" foreignID: ").append(toIndentedString(foreignID)).append("\n"); sb.append(" avatarURL: ").append(toIndentedString(avatarURL)).append("\n"); sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -247,14 +293,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SocialAccountCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `SocialAccountCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SocialAccountCreateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -293,6 +331,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SocialAccountCreateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -300,7 +360,28 @@ public void write(JsonWriter out, SocialAccountCreateReq value) throws IOExcepti public SocialAccountCreateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialAccountCreateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/SocialAccountList.java b/src/main/java/com/corbado/generated/model/SocialAccountList.java index 213bdf8..c184df8 100644 --- a/src/main/java/com/corbado/generated/model/SocialAccountList.java +++ b/src/main/java/com/corbado/generated/model/SocialAccountList.java @@ -54,7 +54,7 @@ /** * SocialAccountList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class SocialAccountList { public static final String SERIALIZED_NAME_SOCIAL_ACCOUNTS = "socialAccounts"; @SerializedName(SERIALIZED_NAME_SOCIAL_ACCOUNTS) @@ -114,6 +114,50 @@ public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialAccountList instance itself + */ + public SocialAccountList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -126,12 +170,13 @@ public boolean equals(Object o) { } SocialAccountList socialAccountList = (SocialAccountList) o; return Objects.equals(this.socialAccounts, socialAccountList.socialAccounts) && - Objects.equals(this.paging, socialAccountList.paging); + Objects.equals(this.paging, socialAccountList.paging)&& + Objects.equals(this.additionalProperties, socialAccountList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(socialAccounts, paging); + return Objects.hash(socialAccounts, paging, additionalProperties); } @Override @@ -140,6 +185,7 @@ public String toString() { sb.append("class SocialAccountList {\n"); sb.append(" socialAccounts: ").append(toIndentedString(socialAccounts)).append("\n"); sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -180,14 +226,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SocialAccountList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `SocialAccountList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SocialAccountList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -224,6 +262,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SocialAccountList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -231,7 +291,28 @@ public void write(JsonWriter out, SocialAccountList value) throws IOException { public SocialAccountList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialAccountList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/User.java b/src/main/java/com/corbado/generated/model/User.java index 2e7221b..6c4506e 100644 --- a/src/main/java/com/corbado/generated/model/User.java +++ b/src/main/java/com/corbado/generated/model/User.java @@ -51,7 +51,7 @@ /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class User { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) @@ -199,6 +199,50 @@ public void setUpdatedMs(@javax.annotation.Nonnull Long updatedMs) { this.updatedMs = updatedMs; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the User instance itself + */ + public User putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -215,12 +259,13 @@ public boolean equals(Object o) { Objects.equals(this.status, user.status) && Objects.equals(this.explicitWebauthnID, user.explicitWebauthnID) && Objects.equals(this.updated, user.updated) && - Objects.equals(this.updatedMs, user.updatedMs); + Objects.equals(this.updatedMs, user.updatedMs)&& + Objects.equals(this.additionalProperties, user.additionalProperties); } @Override public int hashCode() { - return Objects.hash(userID, fullName, status, explicitWebauthnID, updated, updatedMs); + return Objects.hash(userID, fullName, status, explicitWebauthnID, updated, updatedMs, additionalProperties); } @Override @@ -233,6 +278,7 @@ public String toString() { sb.append(" explicitWebauthnID: ").append(toIndentedString(explicitWebauthnID)).append("\n"); sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); sb.append(" updatedMs: ").append(toIndentedString(updatedMs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -273,14 +319,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!User.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : User.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -319,6 +357,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, User value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -326,7 +386,28 @@ public void write(JsonWriter out, User value) throws IOException { public User read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + User instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/UserAggregate.java b/src/main/java/com/corbado/generated/model/UserAggregate.java index d585451..83d1c48 100644 --- a/src/main/java/com/corbado/generated/model/UserAggregate.java +++ b/src/main/java/com/corbado/generated/model/UserAggregate.java @@ -55,7 +55,7 @@ /** * UserAggregate */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class UserAggregate { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) @@ -379,6 +379,50 @@ public void setUpdatedMs(@javax.annotation.Nonnull Long updatedMs) { this.updatedMs = updatedMs; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserAggregate instance itself + */ + public UserAggregate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -401,12 +445,13 @@ public boolean equals(Object o) { Objects.equals(this.created, userAggregate.created) && Objects.equals(this.createdMS, userAggregate.createdMS) && Objects.equals(this.updated, userAggregate.updated) && - Objects.equals(this.updatedMs, userAggregate.updatedMs); + Objects.equals(this.updatedMs, userAggregate.updatedMs)&& + Objects.equals(this.additionalProperties, userAggregate.additionalProperties); } @Override public int hashCode() { - return Objects.hash(userID, fullName, status, explicitWebauthnID, emailIdentifiers, phoneNumberIdentifiers, usernameIdentifiers, socialAccounts, created, createdMS, updated, updatedMs); + return Objects.hash(userID, fullName, status, explicitWebauthnID, emailIdentifiers, phoneNumberIdentifiers, usernameIdentifiers, socialAccounts, created, createdMS, updated, updatedMs, additionalProperties); } @Override @@ -425,6 +470,7 @@ public String toString() { sb.append(" createdMS: ").append(toIndentedString(createdMS)).append("\n"); sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); sb.append(" updatedMs: ").append(toIndentedString(updatedMs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -465,14 +511,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserAggregate.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `UserAggregate` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : UserAggregate.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -554,6 +592,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UserAggregate value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -561,7 +621,28 @@ public void write(JsonWriter out, UserAggregate value) throws IOException { public UserAggregate read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserAggregate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/UserCreateReq.java b/src/main/java/com/corbado/generated/model/UserCreateReq.java index f806c07..99afe99 100644 --- a/src/main/java/com/corbado/generated/model/UserCreateReq.java +++ b/src/main/java/com/corbado/generated/model/UserCreateReq.java @@ -51,7 +51,7 @@ /** * UserCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class UserCreateReq { public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) @@ -127,6 +127,50 @@ public void setExplicitWebauthnID(@javax.annotation.Nullable String explicitWeba this.explicitWebauthnID = explicitWebauthnID; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserCreateReq instance itself + */ + public UserCreateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -140,12 +184,13 @@ public boolean equals(Object o) { UserCreateReq userCreateReq = (UserCreateReq) o; return Objects.equals(this.fullName, userCreateReq.fullName) && Objects.equals(this.status, userCreateReq.status) && - Objects.equals(this.explicitWebauthnID, userCreateReq.explicitWebauthnID); + Objects.equals(this.explicitWebauthnID, userCreateReq.explicitWebauthnID)&& + Objects.equals(this.additionalProperties, userCreateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(fullName, status, explicitWebauthnID); + return Objects.hash(fullName, status, explicitWebauthnID, additionalProperties); } @Override @@ -155,6 +200,7 @@ public String toString() { sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" explicitWebauthnID: ").append(toIndentedString(explicitWebauthnID)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -195,14 +241,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `UserCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : UserCreateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -235,6 +273,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UserCreateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -242,7 +302,28 @@ public void write(JsonWriter out, UserCreateReq value) throws IOException { public UserCreateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserCreateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/UserList.java b/src/main/java/com/corbado/generated/model/UserList.java index 040793a..60378ad 100644 --- a/src/main/java/com/corbado/generated/model/UserList.java +++ b/src/main/java/com/corbado/generated/model/UserList.java @@ -54,7 +54,7 @@ /** * UserList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class UserList { public static final String SERIALIZED_NAME_USERS = "users"; @SerializedName(SERIALIZED_NAME_USERS) @@ -114,6 +114,50 @@ public void setPaging(@javax.annotation.Nonnull Paging paging) { this.paging = paging; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserList instance itself + */ + public UserList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -126,12 +170,13 @@ public boolean equals(Object o) { } UserList userList = (UserList) o; return Objects.equals(this.users, userList.users) && - Objects.equals(this.paging, userList.paging); + Objects.equals(this.paging, userList.paging)&& + Objects.equals(this.additionalProperties, userList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(users, paging); + return Objects.hash(users, paging, additionalProperties); } @Override @@ -140,6 +185,7 @@ public String toString() { sb.append("class UserList {\n"); sb.append(" users: ").append(toIndentedString(users)).append("\n"); sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -180,14 +226,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `UserList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : UserList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -224,6 +262,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UserList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -231,7 +291,28 @@ public void write(JsonWriter out, UserList value) throws IOException { public UserList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/UserUpdateReq.java b/src/main/java/com/corbado/generated/model/UserUpdateReq.java index a764671..1fdf550 100644 --- a/src/main/java/com/corbado/generated/model/UserUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/UserUpdateReq.java @@ -51,7 +51,7 @@ /** * UserUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class UserUpdateReq { public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) @@ -103,6 +103,50 @@ public void setStatus(@javax.annotation.Nullable UserStatus status) { this.status = status; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserUpdateReq instance itself + */ + public UserUpdateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -115,12 +159,13 @@ public boolean equals(Object o) { } UserUpdateReq userUpdateReq = (UserUpdateReq) o; return Objects.equals(this.fullName, userUpdateReq.fullName) && - Objects.equals(this.status, userUpdateReq.status); + Objects.equals(this.status, userUpdateReq.status)&& + Objects.equals(this.additionalProperties, userUpdateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(fullName, status); + return Objects.hash(fullName, status, additionalProperties); } @Override @@ -129,6 +174,7 @@ public String toString() { sb.append("class UserUpdateReq {\n"); sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -168,14 +214,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in UserUpdateReq is not found in the empty JSON string", UserUpdateReq.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `UserUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); @@ -201,6 +239,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, UserUpdateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -208,7 +268,28 @@ public void write(JsonWriter out, UserUpdateReq value) throws IOException { public UserUpdateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserUpdateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/WebhookEndpoint.java b/src/main/java/com/corbado/generated/model/WebhookEndpoint.java index e16148f..92cc526 100644 --- a/src/main/java/com/corbado/generated/model/WebhookEndpoint.java +++ b/src/main/java/com/corbado/generated/model/WebhookEndpoint.java @@ -53,7 +53,7 @@ /** * WebhookEndpoint */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class WebhookEndpoint { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -305,6 +305,50 @@ public void setUpdatedMs(@javax.annotation.Nonnull Long updatedMs) { this.updatedMs = updatedMs; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookEndpoint instance itself + */ + public WebhookEndpoint putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -325,12 +369,13 @@ public boolean equals(Object o) { Objects.equals(this.created, webhookEndpoint.created) && Objects.equals(this.createdMs, webhookEndpoint.createdMs) && Objects.equals(this.updated, webhookEndpoint.updated) && - Objects.equals(this.updatedMs, webhookEndpoint.updatedMs); + Objects.equals(this.updatedMs, webhookEndpoint.updatedMs)&& + Objects.equals(this.additionalProperties, webhookEndpoint.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, url, basicAuthUsername, basicAuthPassword, customHeaders, subscribedEvents, created, createdMs, updated, updatedMs); + return Objects.hash(id, url, basicAuthUsername, basicAuthPassword, customHeaders, subscribedEvents, created, createdMs, updated, updatedMs, additionalProperties); } @Override @@ -347,6 +392,7 @@ public String toString() { sb.append(" createdMs: ").append(toIndentedString(createdMs)).append("\n"); sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); sb.append(" updatedMs: ").append(toIndentedString(updatedMs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -387,14 +433,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookEndpoint.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `WebhookEndpoint` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : WebhookEndpoint.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -443,6 +481,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, WebhookEndpoint value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -450,7 +510,28 @@ public void write(JsonWriter out, WebhookEndpoint value) throws IOException { public WebhookEndpoint read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookEndpoint instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/WebhookEndpointCreateReq.java b/src/main/java/com/corbado/generated/model/WebhookEndpointCreateReq.java index 0f1abd0..589c13d 100644 --- a/src/main/java/com/corbado/generated/model/WebhookEndpointCreateReq.java +++ b/src/main/java/com/corbado/generated/model/WebhookEndpointCreateReq.java @@ -53,7 +53,7 @@ /** * WebhookEndpointCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class WebhookEndpointCreateReq { public static final String SERIALIZED_NAME_URL = "url"; @SerializedName(SERIALIZED_NAME_URL) @@ -185,6 +185,50 @@ public void setCustomHeaders(@javax.annotation.Nonnull Object customHeaders) { this.customHeaders = customHeaders; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookEndpointCreateReq instance itself + */ + public WebhookEndpointCreateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -200,12 +244,13 @@ public boolean equals(Object o) { Objects.equals(this.basicAuthUsername, webhookEndpointCreateReq.basicAuthUsername) && Objects.equals(this.basicAuthPassword, webhookEndpointCreateReq.basicAuthPassword) && Objects.equals(this.subscribedEvents, webhookEndpointCreateReq.subscribedEvents) && - Objects.equals(this.customHeaders, webhookEndpointCreateReq.customHeaders); + Objects.equals(this.customHeaders, webhookEndpointCreateReq.customHeaders)&& + Objects.equals(this.additionalProperties, webhookEndpointCreateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(url, basicAuthUsername, basicAuthPassword, subscribedEvents, customHeaders); + return Objects.hash(url, basicAuthUsername, basicAuthPassword, subscribedEvents, customHeaders, additionalProperties); } @Override @@ -217,6 +262,7 @@ public String toString() { sb.append(" basicAuthPassword: ").append(toIndentedString(basicAuthPassword)).append("\n"); sb.append(" subscribedEvents: ").append(toIndentedString(subscribedEvents)).append("\n"); sb.append(" customHeaders: ").append(toIndentedString(customHeaders)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -257,14 +303,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookEndpointCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `WebhookEndpointCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : WebhookEndpointCreateReq.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -304,6 +342,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, WebhookEndpointCreateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -311,7 +371,28 @@ public void write(JsonWriter out, WebhookEndpointCreateReq value) throws IOExcep public WebhookEndpointCreateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookEndpointCreateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/WebhookEndpointList.java b/src/main/java/com/corbado/generated/model/WebhookEndpointList.java index 9807a10..7e65e96 100644 --- a/src/main/java/com/corbado/generated/model/WebhookEndpointList.java +++ b/src/main/java/com/corbado/generated/model/WebhookEndpointList.java @@ -53,7 +53,7 @@ /** * WebhookEndpointList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class WebhookEndpointList { public static final String SERIALIZED_NAME_WEBHOOK_ENDPOINTS = "webhookEndpoints"; @SerializedName(SERIALIZED_NAME_WEBHOOK_ENDPOINTS) @@ -89,6 +89,50 @@ public void setWebhookEndpoints(@javax.annotation.Nonnull List this.webhookEndpoints = webhookEndpoints; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookEndpointList instance itself + */ + public WebhookEndpointList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -100,12 +144,13 @@ public boolean equals(Object o) { return false; } WebhookEndpointList webhookEndpointList = (WebhookEndpointList) o; - return Objects.equals(this.webhookEndpoints, webhookEndpointList.webhookEndpoints); + return Objects.equals(this.webhookEndpoints, webhookEndpointList.webhookEndpoints)&& + Objects.equals(this.additionalProperties, webhookEndpointList.additionalProperties); } @Override public int hashCode() { - return Objects.hash(webhookEndpoints); + return Objects.hash(webhookEndpoints, additionalProperties); } @Override @@ -113,6 +158,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class WebhookEndpointList {\n"); sb.append(" webhookEndpoints: ").append(toIndentedString(webhookEndpoints)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -153,14 +199,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookEndpointList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `WebhookEndpointList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : WebhookEndpointList.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { @@ -195,6 +233,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, WebhookEndpointList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -202,7 +262,28 @@ public void write(JsonWriter out, WebhookEndpointList value) throws IOException public WebhookEndpointList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookEndpointList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/generated/model/WebhookEndpointUpdateReq.java b/src/main/java/com/corbado/generated/model/WebhookEndpointUpdateReq.java index 281a61f..07ad63a 100644 --- a/src/main/java/com/corbado/generated/model/WebhookEndpointUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/WebhookEndpointUpdateReq.java @@ -53,7 +53,7 @@ /** * WebhookEndpointUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T13:05:36.841382713Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-10T14:34:06.387838337Z[Etc/UTC]", comments = "Generator version: 7.16.0-SNAPSHOT") public class WebhookEndpointUpdateReq { public static final String SERIALIZED_NAME_URL = "url"; @SerializedName(SERIALIZED_NAME_URL) @@ -185,6 +185,50 @@ public void setCustomHeaders(@javax.annotation.Nullable Object customHeaders) { this.customHeaders = customHeaders; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookEndpointUpdateReq instance itself + */ + public WebhookEndpointUpdateReq putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -200,12 +244,13 @@ public boolean equals(Object o) { Objects.equals(this.basicAuthUsername, webhookEndpointUpdateReq.basicAuthUsername) && Objects.equals(this.basicAuthPassword, webhookEndpointUpdateReq.basicAuthPassword) && Objects.equals(this.subscribedEvents, webhookEndpointUpdateReq.subscribedEvents) && - Objects.equals(this.customHeaders, webhookEndpointUpdateReq.customHeaders); + Objects.equals(this.customHeaders, webhookEndpointUpdateReq.customHeaders)&& + Objects.equals(this.additionalProperties, webhookEndpointUpdateReq.additionalProperties); } @Override public int hashCode() { - return Objects.hash(url, basicAuthUsername, basicAuthPassword, subscribedEvents, customHeaders); + return Objects.hash(url, basicAuthUsername, basicAuthPassword, subscribedEvents, customHeaders, additionalProperties); } @Override @@ -217,6 +262,7 @@ public String toString() { sb.append(" basicAuthPassword: ").append(toIndentedString(basicAuthPassword)).append("\n"); sb.append(" subscribedEvents: ").append(toIndentedString(subscribedEvents)).append("\n"); sb.append(" customHeaders: ").append(toIndentedString(customHeaders)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -256,14 +302,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in WebhookEndpointUpdateReq is not found in the empty JSON string", WebhookEndpointUpdateReq.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookEndpointUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` in the JSON string is not defined in the `WebhookEndpointUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); @@ -295,6 +333,28 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, WebhookEndpointUpdateReq value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } elementAdapter.write(out, obj); } @@ -302,7 +362,28 @@ public void write(JsonWriter out, WebhookEndpointUpdateReq value) throws IOExcep public WebhookEndpointUpdateReq read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookEndpointUpdateReq instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/corbado/sdk/CorbadoSdk.java b/src/main/java/com/corbado/sdk/CorbadoSdk.java index d00d747..f807a86 100644 --- a/src/main/java/com/corbado/sdk/CorbadoSdk.java +++ b/src/main/java/com/corbado/sdk/CorbadoSdk.java @@ -104,6 +104,6 @@ private static String getLanguageVersion() { * @return the version */ public String getVersion() { - return "1.0.7"; + return "1.0.8"; } }