diff --git a/generate.sh b/generate.sh
index 4a6d7a85..3db323bb 100755
--- a/generate.sh
+++ b/generate.sh
@@ -47,7 +47,7 @@ do
-g java \
--additional-properties=modelPackage=saasus.sdk.${module}.models,apiPackage=saasus.sdk.${module}.api \
-o /local/generated/${module} \
- --additional-properties useOneOfDiscriminatorLookup=true
+ --additional-properties useOneOfDiscriminatorLookup=true,disallowAdditionalPropertiesIfNotPresent=false
done
for module in ${MODULES}
diff --git a/src/main/java/saasus/sdk/apilog/ApiException.java b/src/main/java/saasus/sdk/apilog/ApiException.java
index 56d99e14..a6399eff 100644
--- a/src/main/java/saasus/sdk/apilog/ApiException.java
+++ b/src/main/java/saasus/sdk/apilog/ApiException.java
@@ -21,7 +21,7 @@
*
ApiException class.
*/
@SuppressWarnings("serial")
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:40.405574501Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:40:38.269057263Z[Etc/UTC]")
public class ApiException extends Exception {
private int code = 0;
private Map> responseHeaders = null;
diff --git a/src/main/java/saasus/sdk/apilog/Configuration.java b/src/main/java/saasus/sdk/apilog/Configuration.java
index d01fb3e0..1b58cee1 100644
--- a/src/main/java/saasus/sdk/apilog/Configuration.java
+++ b/src/main/java/saasus/sdk/apilog/Configuration.java
@@ -13,7 +13,7 @@
package saasus.sdk.apilog;
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:40.405574501Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:40:38.269057263Z[Etc/UTC]")
public class Configuration {
public static final String VERSION = "1.0.0";
diff --git a/src/main/java/saasus/sdk/apilog/Pair.java b/src/main/java/saasus/sdk/apilog/Pair.java
index d7f922bf..368a3d85 100644
--- a/src/main/java/saasus/sdk/apilog/Pair.java
+++ b/src/main/java/saasus/sdk/apilog/Pair.java
@@ -13,7 +13,7 @@
package saasus.sdk.apilog;
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:40.405574501Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:40:38.269057263Z[Etc/UTC]")
public class Pair {
private String name = "";
private String value = "";
diff --git a/src/main/java/saasus/sdk/apilog/StringUtil.java b/src/main/java/saasus/sdk/apilog/StringUtil.java
index ed14f572..97b60ac3 100644
--- a/src/main/java/saasus/sdk/apilog/StringUtil.java
+++ b/src/main/java/saasus/sdk/apilog/StringUtil.java
@@ -16,7 +16,7 @@
import java.util.Collection;
import java.util.Iterator;
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:40.405574501Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:40:38.269057263Z[Etc/UTC]")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
diff --git a/src/main/java/saasus/sdk/apilog/auth/ApiKeyAuth.java b/src/main/java/saasus/sdk/apilog/auth/ApiKeyAuth.java
index 8271eba1..bf142126 100644
--- a/src/main/java/saasus/sdk/apilog/auth/ApiKeyAuth.java
+++ b/src/main/java/saasus/sdk/apilog/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 = "2024-08-16T05:09:40.405574501Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:40:38.269057263Z[Etc/UTC]")
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;
diff --git a/src/main/java/saasus/sdk/apilog/auth/HttpBearerAuth.java b/src/main/java/saasus/sdk/apilog/auth/HttpBearerAuth.java
index daa36959..bceb03f3 100644
--- a/src/main/java/saasus/sdk/apilog/auth/HttpBearerAuth.java
+++ b/src/main/java/saasus/sdk/apilog/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 = "2024-08-16T05:09:40.405574501Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:40:38.269057263Z[Etc/UTC]")
public class HttpBearerAuth implements Authentication {
private final String scheme;
private Supplier tokenSupplier;
diff --git a/src/main/java/saasus/sdk/apilog/models/AbstractOpenApiSchema.java b/src/main/java/saasus/sdk/apilog/models/AbstractOpenApiSchema.java
index 8a01401b..73403af8 100644
--- a/src/main/java/saasus/sdk/apilog/models/AbstractOpenApiSchema.java
+++ b/src/main/java/saasus/sdk/apilog/models/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 = "2024-08-16T05:09:40.405574501Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:40:38.269057263Z[Etc/UTC]")
public abstract class AbstractOpenApiSchema {
// store the actual instance of the schema/object
diff --git a/src/main/java/saasus/sdk/apilog/models/ApiLog.java b/src/main/java/saasus/sdk/apilog/models/ApiLog.java
index 9464bd23..6ecbbbf7 100644
--- a/src/main/java/saasus/sdk/apilog/models/ApiLog.java
+++ b/src/main/java/saasus/sdk/apilog/models/ApiLog.java
@@ -49,7 +49,7 @@
/**
* ApiLog
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:40.405574501Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:40:38.269057263Z[Etc/UTC]")
public class ApiLog {
public static final String SERIALIZED_NAME_TRACE_ID = "trace_id";
@SerializedName(SERIALIZED_NAME_TRACE_ID)
@@ -375,6 +375,50 @@ public void setResponseBody(String responseBody) {
this.responseBody = responseBody;
}
+ /**
+ * 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 ApiLog instance itself
+ */
+ public ApiLog 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
@@ -399,12 +443,13 @@ public boolean equals(Object o) {
Objects.equals(this.remoteAddress, apiLog.remoteAddress) &&
Objects.equals(this.referer, apiLog.referer) &&
Objects.equals(this.requestBody, apiLog.requestBody) &&
- Objects.equals(this.responseBody, apiLog.responseBody);
+ Objects.equals(this.responseBody, apiLog.responseBody)&&
+ Objects.equals(this.additionalProperties, apiLog.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(traceId, apiLogId, createdAt, createdDate, ttl, requestMethod, saasId, apiKey, responseStatus, requestUri, remoteAddress, referer, requestBody, responseBody);
+ return Objects.hash(traceId, apiLogId, createdAt, createdDate, ttl, requestMethod, saasId, apiKey, responseStatus, requestUri, remoteAddress, referer, requestBody, responseBody, additionalProperties);
}
@Override
@@ -425,6 +470,7 @@ public String toString() {
sb.append(" referer: ").append(toIndentedString(referer)).append("\n");
sb.append(" requestBody: ").append(toIndentedString(requestBody)).append("\n");
sb.append(" responseBody: ").append(toIndentedString(responseBody)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -493,14 +539,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 (!ApiLog.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiLog` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ApiLog.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -561,6 +599,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, ApiLog 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -568,7 +623,28 @@ public void write(JsonWriter out, ApiLog value) throws IOException {
public ApiLog 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
+ ApiLog instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/apilog/models/ApiLogs.java b/src/main/java/saasus/sdk/apilog/models/ApiLogs.java
index f6c31734..a34f8684 100644
--- a/src/main/java/saasus/sdk/apilog/models/ApiLogs.java
+++ b/src/main/java/saasus/sdk/apilog/models/ApiLogs.java
@@ -52,7 +52,7 @@
/**
* ApiLogs
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:40.405574501Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:40:38.269057263Z[Etc/UTC]")
public class ApiLogs {
public static final String SERIALIZED_NAME_API_LOGS = "api_logs";
@SerializedName(SERIALIZED_NAME_API_LOGS)
@@ -110,6 +110,50 @@ public void setCursor(String cursor) {
this.cursor = cursor;
}
+ /**
+ * 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 ApiLogs instance itself
+ */
+ public ApiLogs 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
@@ -122,12 +166,13 @@ public boolean equals(Object o) {
}
ApiLogs apiLogs = (ApiLogs) o;
return Objects.equals(this.apiLogs, apiLogs.apiLogs) &&
- Objects.equals(this.cursor, apiLogs.cursor);
+ Objects.equals(this.cursor, apiLogs.cursor)&&
+ Objects.equals(this.additionalProperties, apiLogs.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(apiLogs, cursor);
+ return Objects.hash(apiLogs, cursor, additionalProperties);
}
@Override
@@ -136,6 +181,7 @@ public String toString() {
sb.append("class ApiLogs {\n");
sb.append(" apiLogs: ").append(toIndentedString(apiLogs)).append("\n");
sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -179,14 +225,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 (!ApiLogs.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiLogs` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ApiLogs.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -224,6 +262,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, ApiLogs 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -231,7 +286,28 @@ public void write(JsonWriter out, ApiLogs value) throws IOException {
public ApiLogs 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
+ ApiLogs instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/apilog/models/Error.java b/src/main/java/saasus/sdk/apilog/models/Error.java
index f1a63a25..bd527572 100644
--- a/src/main/java/saasus/sdk/apilog/models/Error.java
+++ b/src/main/java/saasus/sdk/apilog/models/Error.java
@@ -49,7 +49,7 @@
/**
* Error
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:40.405574501Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:40:38.269057263Z[Etc/UTC]")
public class Error {
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
@@ -99,6 +99,50 @@ public void setMessage(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 Error instance itself
+ */
+ public Error 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
@@ -111,12 +155,13 @@ public boolean equals(Object o) {
}
Error error = (Error) o;
return Objects.equals(this.type, error.type) &&
- Objects.equals(this.message, error.message);
+ Objects.equals(this.message, error.message)&&
+ Objects.equals(this.additionalProperties, error.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(type, message);
+ return Objects.hash(type, message, additionalProperties);
}
@Override
@@ -125,6 +170,7 @@ public String toString() {
sb.append("class Error {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).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 (!Error.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Error` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : Error.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -207,6 +245,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, Error 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -214,7 +269,28 @@ public void write(JsonWriter out, Error value) throws IOException {
public Error 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
+ Error instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/ApiException.java b/src/main/java/saasus/sdk/auth/ApiException.java
index ca3528f3..67aeb721 100644
--- a/src/main/java/saasus/sdk/auth/ApiException.java
+++ b/src/main/java/saasus/sdk/auth/ApiException.java
@@ -21,7 +21,7 @@
* ApiException class.
*/
@SuppressWarnings("serial")
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class ApiException extends Exception {
private int code = 0;
private Map> responseHeaders = null;
diff --git a/src/main/java/saasus/sdk/auth/Configuration.java b/src/main/java/saasus/sdk/auth/Configuration.java
index 81cc9f07..49e3dc04 100644
--- a/src/main/java/saasus/sdk/auth/Configuration.java
+++ b/src/main/java/saasus/sdk/auth/Configuration.java
@@ -13,7 +13,7 @@
package saasus.sdk.auth;
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class Configuration {
public static final String VERSION = "1.0.0";
diff --git a/src/main/java/saasus/sdk/auth/Pair.java b/src/main/java/saasus/sdk/auth/Pair.java
index 743623a7..1141f791 100644
--- a/src/main/java/saasus/sdk/auth/Pair.java
+++ b/src/main/java/saasus/sdk/auth/Pair.java
@@ -13,7 +13,7 @@
package saasus.sdk.auth;
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class Pair {
private String name = "";
private String value = "";
diff --git a/src/main/java/saasus/sdk/auth/StringUtil.java b/src/main/java/saasus/sdk/auth/StringUtil.java
index 588dcc42..6baec881 100644
--- a/src/main/java/saasus/sdk/auth/StringUtil.java
+++ b/src/main/java/saasus/sdk/auth/StringUtil.java
@@ -16,7 +16,7 @@
import java.util.Collection;
import java.util.Iterator;
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
diff --git a/src/main/java/saasus/sdk/auth/auth/ApiKeyAuth.java b/src/main/java/saasus/sdk/auth/auth/ApiKeyAuth.java
index 08581d06..0813321a 100644
--- a/src/main/java/saasus/sdk/auth/auth/ApiKeyAuth.java
+++ b/src/main/java/saasus/sdk/auth/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 = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;
diff --git a/src/main/java/saasus/sdk/auth/auth/HttpBearerAuth.java b/src/main/java/saasus/sdk/auth/auth/HttpBearerAuth.java
index 7c72344f..49096e68 100644
--- a/src/main/java/saasus/sdk/auth/auth/HttpBearerAuth.java
+++ b/src/main/java/saasus/sdk/auth/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 = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class HttpBearerAuth implements Authentication {
private final String scheme;
private Supplier tokenSupplier;
diff --git a/src/main/java/saasus/sdk/auth/models/AbstractOpenApiSchema.java b/src/main/java/saasus/sdk/auth/models/AbstractOpenApiSchema.java
index c210edbf..aa0b28a4 100644
--- a/src/main/java/saasus/sdk/auth/models/AbstractOpenApiSchema.java
+++ b/src/main/java/saasus/sdk/auth/models/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 = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public abstract class AbstractOpenApiSchema {
// store the actual instance of the schema/object
diff --git a/src/main/java/saasus/sdk/auth/models/AccountVerification.java b/src/main/java/saasus/sdk/auth/models/AccountVerification.java
index d7f49785..4c30dca0 100644
--- a/src/main/java/saasus/sdk/auth/models/AccountVerification.java
+++ b/src/main/java/saasus/sdk/auth/models/AccountVerification.java
@@ -49,7 +49,7 @@
/**
* Account authentication settings ※ This function is not yet provided, so it cannot be changed or saved.
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class AccountVerification {
/**
* code: verification code link: verification link ※ This function is not yet provided, so it cannot be changed or saved.
@@ -205,6 +205,50 @@ public void setSendingTo(SendingToEnum sendingTo) {
this.sendingTo = sendingTo;
}
+ /**
+ * 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 AccountVerification instance itself
+ */
+ public AccountVerification 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) {
}
AccountVerification accountVerification = (AccountVerification) o;
return Objects.equals(this.verificationMethod, accountVerification.verificationMethod) &&
- Objects.equals(this.sendingTo, accountVerification.sendingTo);
+ Objects.equals(this.sendingTo, accountVerification.sendingTo)&&
+ Objects.equals(this.additionalProperties, accountVerification.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(verificationMethod, sendingTo);
+ return Objects.hash(verificationMethod, sendingTo, additionalProperties);
}
@Override
@@ -231,6 +276,7 @@ public String toString() {
sb.append("class AccountVerification {\n");
sb.append(" verificationMethod: ").append(toIndentedString(verificationMethod)).append("\n");
sb.append(" sendingTo: ").append(toIndentedString(sendingTo)).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 (!AccountVerification.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AccountVerification` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccountVerification.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -317,6 +355,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AccountVerification 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -324,7 +379,28 @@ public void write(JsonWriter out, AccountVerification value) throws IOException
public AccountVerification 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
+ AccountVerification instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/ApiKeys.java b/src/main/java/saasus/sdk/auth/models/ApiKeys.java
index ed3efc79..5b3909b2 100644
--- a/src/main/java/saasus/sdk/auth/models/ApiKeys.java
+++ b/src/main/java/saasus/sdk/auth/models/ApiKeys.java
@@ -51,7 +51,7 @@
/**
* ApiKeys
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class ApiKeys {
public static final String SERIALIZED_NAME_API_KEYS = "api_keys";
@SerializedName(SERIALIZED_NAME_API_KEYS)
@@ -86,6 +86,50 @@ public void setApiKeys(List apiKeys) {
this.apiKeys = apiKeys;
}
+ /**
+ * 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 ApiKeys instance itself
+ */
+ public ApiKeys 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
@@ -97,12 +141,13 @@ public boolean equals(Object o) {
return false;
}
ApiKeys apiKeys = (ApiKeys) o;
- return Objects.equals(this.apiKeys, apiKeys.apiKeys);
+ return Objects.equals(this.apiKeys, apiKeys.apiKeys)&&
+ Objects.equals(this.additionalProperties, apiKeys.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(apiKeys);
+ return Objects.hash(apiKeys, additionalProperties);
}
@Override
@@ -110,6 +155,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ApiKeys {\n");
sb.append(" apiKeys: ").append(toIndentedString(apiKeys)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -152,14 +198,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 (!ApiKeys.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiKeys` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ApiKeys.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -190,6 +228,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, ApiKeys 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -197,7 +252,28 @@ public void write(JsonWriter out, ApiKeys value) throws IOException {
public ApiKeys 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
+ ApiKeys instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/Attribute.java b/src/main/java/saasus/sdk/auth/models/Attribute.java
index 718bf846..f5a5caf5 100644
--- a/src/main/java/saasus/sdk/auth/models/Attribute.java
+++ b/src/main/java/saasus/sdk/auth/models/Attribute.java
@@ -50,7 +50,7 @@
/**
* Attribute
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class Attribute {
public static final String SERIALIZED_NAME_ATTRIBUTE_NAME = "attribute_name";
@SerializedName(SERIALIZED_NAME_ATTRIBUTE_NAME)
@@ -123,6 +123,50 @@ public void setAttributeType(AttributeType attributeType) {
this.attributeType = attributeType;
}
+ /**
+ * 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 Attribute instance itself
+ */
+ public Attribute 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
@@ -136,12 +180,13 @@ public boolean equals(Object o) {
Attribute attribute = (Attribute) o;
return Objects.equals(this.attributeName, attribute.attributeName) &&
Objects.equals(this.displayName, attribute.displayName) &&
- Objects.equals(this.attributeType, attribute.attributeType);
+ Objects.equals(this.attributeType, attribute.attributeType)&&
+ Objects.equals(this.additionalProperties, attribute.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(attributeName, displayName, attributeType);
+ return Objects.hash(attributeName, displayName, attributeType, additionalProperties);
}
@Override
@@ -151,6 +196,7 @@ public String toString() {
sb.append(" attributeName: ").append(toIndentedString(attributeName)).append("\n");
sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n");
sb.append(" attributeType: ").append(toIndentedString(attributeType)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -197,14 +243,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 (!Attribute.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Attribute` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : Attribute.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -237,6 +275,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, Attribute 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -244,7 +299,28 @@ public void write(JsonWriter out, Attribute value) throws IOException {
public Attribute 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
+ Attribute instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/AuthInfo.java b/src/main/java/saasus/sdk/auth/models/AuthInfo.java
index e8be2e1d..3eeb9f53 100644
--- a/src/main/java/saasus/sdk/auth/models/AuthInfo.java
+++ b/src/main/java/saasus/sdk/auth/models/AuthInfo.java
@@ -49,7 +49,7 @@
/**
* AuthInfo
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class AuthInfo {
public static final String SERIALIZED_NAME_CALLBACK_URL = "callback_url";
@SerializedName(SERIALIZED_NAME_CALLBACK_URL)
@@ -76,6 +76,50 @@ public void setCallbackUrl(String callbackUrl) {
this.callbackUrl = callbackUrl;
}
+ /**
+ * 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 AuthInfo instance itself
+ */
+ public AuthInfo 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
@@ -87,12 +131,13 @@ public boolean equals(Object o) {
return false;
}
AuthInfo authInfo = (AuthInfo) o;
- return Objects.equals(this.callbackUrl, authInfo.callbackUrl);
+ return Objects.equals(this.callbackUrl, authInfo.callbackUrl)&&
+ Objects.equals(this.additionalProperties, authInfo.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(callbackUrl);
+ return Objects.hash(callbackUrl, additionalProperties);
}
@Override
@@ -100,6 +145,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AuthInfo {\n");
sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).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 (!AuthInfo.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AuthInfo.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -177,6 +215,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AuthInfo 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -184,7 +239,28 @@ public void write(JsonWriter out, AuthInfo value) throws IOException {
public AuthInfo 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
+ AuthInfo instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/AuthorizationTempCode.java b/src/main/java/saasus/sdk/auth/models/AuthorizationTempCode.java
index 264a6d47..36c98ef7 100644
--- a/src/main/java/saasus/sdk/auth/models/AuthorizationTempCode.java
+++ b/src/main/java/saasus/sdk/auth/models/AuthorizationTempCode.java
@@ -49,7 +49,7 @@
/**
* AuthorizationTempCode
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class AuthorizationTempCode {
public static final String SERIALIZED_NAME_CODE = "code";
@SerializedName(SERIALIZED_NAME_CODE)
@@ -76,6 +76,50 @@ public void setCode(String code) {
this.code = code;
}
+ /**
+ * 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 AuthorizationTempCode instance itself
+ */
+ public AuthorizationTempCode 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
@@ -87,12 +131,13 @@ public boolean equals(Object o) {
return false;
}
AuthorizationTempCode authorizationTempCode = (AuthorizationTempCode) o;
- return Objects.equals(this.code, authorizationTempCode.code);
+ return Objects.equals(this.code, authorizationTempCode.code)&&
+ Objects.equals(this.additionalProperties, authorizationTempCode.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(code);
+ return Objects.hash(code, additionalProperties);
}
@Override
@@ -100,6 +145,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AuthorizationTempCode {\n");
sb.append(" code: ").append(toIndentedString(code)).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 (!AuthorizationTempCode.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthorizationTempCode` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AuthorizationTempCode.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -177,6 +215,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, AuthorizationTempCode 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -184,7 +239,28 @@ public void write(JsonWriter out, AuthorizationTempCode value) throws IOExceptio
public AuthorizationTempCode 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
+ AuthorizationTempCode instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/BasicInfo.java b/src/main/java/saasus/sdk/auth/models/BasicInfo.java
index 53d449d8..de49bdc2 100644
--- a/src/main/java/saasus/sdk/auth/models/BasicInfo.java
+++ b/src/main/java/saasus/sdk/auth/models/BasicInfo.java
@@ -52,7 +52,7 @@
/**
* BasicInfo
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class BasicInfo {
public static final String SERIALIZED_NAME_DOMAIN_NAME = "domain_name";
@SerializedName(SERIALIZED_NAME_DOMAIN_NAME)
@@ -271,6 +271,50 @@ public void setIsSesSandboxGranted(Boolean isSesSandboxGranted) {
this.isSesSandboxGranted = isSesSandboxGranted;
}
+ /**
+ * 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 BasicInfo instance itself
+ */
+ public BasicInfo 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.defaultDomainName, basicInfo.defaultDomainName) &&
Objects.equals(this.fromEmailAddress, basicInfo.fromEmailAddress) &&
Objects.equals(this.replyEmailAddress, basicInfo.replyEmailAddress) &&
- Objects.equals(this.isSesSandboxGranted, basicInfo.isSesSandboxGranted);
+ Objects.equals(this.isSesSandboxGranted, basicInfo.isSesSandboxGranted)&&
+ Objects.equals(this.additionalProperties, basicInfo.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(domainName, isDnsValidated, certificateDnsRecord, cloudFrontDnsRecord, dkimDnsRecords, defaultDomainName, fromEmailAddress, replyEmailAddress, isSesSandboxGranted);
+ return Objects.hash(domainName, isDnsValidated, certificateDnsRecord, cloudFrontDnsRecord, dkimDnsRecords, defaultDomainName, fromEmailAddress, replyEmailAddress, isSesSandboxGranted, additionalProperties);
}
@Override
@@ -311,6 +356,7 @@ public String toString() {
sb.append(" fromEmailAddress: ").append(toIndentedString(fromEmailAddress)).append("\n");
sb.append(" replyEmailAddress: ").append(toIndentedString(replyEmailAddress)).append("\n");
sb.append(" isSesSandboxGranted: ").append(toIndentedString(isSesSandboxGranted)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -369,14 +415,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 (!BasicInfo.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BasicInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : BasicInfo.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -427,6 +465,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, BasicInfo 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -434,7 +489,28 @@ public void write(JsonWriter out, BasicInfo value) throws IOException {
public BasicInfo 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
+ BasicInfo instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/BillingAddress.java b/src/main/java/saasus/sdk/auth/models/BillingAddress.java
index f483146b..895d6fb3 100644
--- a/src/main/java/saasus/sdk/auth/models/BillingAddress.java
+++ b/src/main/java/saasus/sdk/auth/models/BillingAddress.java
@@ -49,7 +49,7 @@
/**
* BillingAddress
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class BillingAddress {
public static final String SERIALIZED_NAME_STREET = "street";
@SerializedName(SERIALIZED_NAME_STREET)
@@ -191,6 +191,50 @@ public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
+ /**
+ * 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 BillingAddress instance itself
+ */
+ public BillingAddress 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
@@ -207,12 +251,13 @@ public boolean equals(Object o) {
Objects.equals(this.state, billingAddress.state) &&
Objects.equals(this.country, billingAddress.country) &&
Objects.equals(this.additionalAddressInfo, billingAddress.additionalAddressInfo) &&
- Objects.equals(this.postalCode, billingAddress.postalCode);
+ Objects.equals(this.postalCode, billingAddress.postalCode)&&
+ Objects.equals(this.additionalProperties, billingAddress.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(street, city, state, country, additionalAddressInfo, postalCode);
+ return Objects.hash(street, city, state, country, additionalAddressInfo, postalCode, additionalProperties);
}
@Override
@@ -225,6 +270,7 @@ public String toString() {
sb.append(" country: ").append(toIndentedString(country)).append("\n");
sb.append(" additionalAddressInfo: ").append(toIndentedString(additionalAddressInfo)).append("\n");
sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -276,14 +322,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 (!BillingAddress.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BillingAddress` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : BillingAddress.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -326,6 +364,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, BillingAddress 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -333,7 +388,28 @@ public void write(JsonWriter out, BillingAddress value) throws IOException {
public BillingAddress 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
+ BillingAddress instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/BillingInfo.java b/src/main/java/saasus/sdk/auth/models/BillingInfo.java
index 92ebc622..6435501a 100644
--- a/src/main/java/saasus/sdk/auth/models/BillingInfo.java
+++ b/src/main/java/saasus/sdk/auth/models/BillingInfo.java
@@ -51,7 +51,7 @@
/**
* BillingInfo
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class BillingInfo {
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
@@ -124,6 +124,50 @@ public void setInvoiceLanguage(InvoiceLanguage invoiceLanguage) {
this.invoiceLanguage = invoiceLanguage;
}
+ /**
+ * 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 BillingInfo instance itself
+ */
+ public BillingInfo 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
@@ -137,12 +181,13 @@ public boolean equals(Object o) {
BillingInfo billingInfo = (BillingInfo) o;
return Objects.equals(this.name, billingInfo.name) &&
Objects.equals(this.address, billingInfo.address) &&
- Objects.equals(this.invoiceLanguage, billingInfo.invoiceLanguage);
+ Objects.equals(this.invoiceLanguage, billingInfo.invoiceLanguage)&&
+ Objects.equals(this.additionalProperties, billingInfo.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(name, address, invoiceLanguage);
+ return Objects.hash(name, address, invoiceLanguage, additionalProperties);
}
@Override
@@ -152,6 +197,7 @@ public String toString() {
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" address: ").append(toIndentedString(address)).append("\n");
sb.append(" invoiceLanguage: ").append(toIndentedString(invoiceLanguage)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -198,14 +244,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 (!BillingInfo.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BillingInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : BillingInfo.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -237,6 +275,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, BillingInfo 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -244,7 +299,28 @@ public void write(JsonWriter out, BillingInfo value) throws IOException {
public BillingInfo 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
+ BillingInfo instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/ClientSecret.java b/src/main/java/saasus/sdk/auth/models/ClientSecret.java
index d8ba0b18..a0b2764d 100644
--- a/src/main/java/saasus/sdk/auth/models/ClientSecret.java
+++ b/src/main/java/saasus/sdk/auth/models/ClientSecret.java
@@ -49,7 +49,7 @@
/**
* ClientSecret
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class ClientSecret {
public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret";
@SerializedName(SERIALIZED_NAME_CLIENT_SECRET)
@@ -76,6 +76,50 @@ public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}
+ /**
+ * 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 ClientSecret instance itself
+ */
+ public ClientSecret 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
@@ -87,12 +131,13 @@ public boolean equals(Object o) {
return false;
}
ClientSecret clientSecret = (ClientSecret) o;
- return Objects.equals(this.clientSecret, clientSecret.clientSecret);
+ return Objects.equals(this.clientSecret, clientSecret.clientSecret)&&
+ Objects.equals(this.additionalProperties, clientSecret.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(clientSecret);
+ return Objects.hash(clientSecret, additionalProperties);
}
@Override
@@ -100,6 +145,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ClientSecret {\n");
sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).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 (!ClientSecret.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClientSecret` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ClientSecret.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -177,6 +215,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, ClientSecret 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -184,7 +239,28 @@ public void write(JsonWriter out, ClientSecret value) throws IOException {
public ClientSecret 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
+ ClientSecret instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/CloudFormationLaunchStackLink.java b/src/main/java/saasus/sdk/auth/models/CloudFormationLaunchStackLink.java
index 641c1556..72839b09 100644
--- a/src/main/java/saasus/sdk/auth/models/CloudFormationLaunchStackLink.java
+++ b/src/main/java/saasus/sdk/auth/models/CloudFormationLaunchStackLink.java
@@ -49,7 +49,7 @@
/**
* CloudFormationLaunchStackLink
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class CloudFormationLaunchStackLink {
public static final String SERIALIZED_NAME_LINK = "link";
@SerializedName(SERIALIZED_NAME_LINK)
@@ -76,6 +76,50 @@ public void setLink(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 CloudFormationLaunchStackLink instance itself
+ */
+ public CloudFormationLaunchStackLink 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
@@ -87,12 +131,13 @@ public boolean equals(Object o) {
return false;
}
CloudFormationLaunchStackLink cloudFormationLaunchStackLink = (CloudFormationLaunchStackLink) o;
- return Objects.equals(this.link, cloudFormationLaunchStackLink.link);
+ return Objects.equals(this.link, cloudFormationLaunchStackLink.link)&&
+ Objects.equals(this.additionalProperties, cloudFormationLaunchStackLink.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(link);
+ return Objects.hash(link, additionalProperties);
}
@Override
@@ -100,6 +145,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudFormationLaunchStackLink {\n");
sb.append(" link: ").append(toIndentedString(link)).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 (!CloudFormationLaunchStackLink.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CloudFormationLaunchStackLink` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CloudFormationLaunchStackLink.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -177,6 +215,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, CloudFormationLaunchStackLink 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -184,7 +239,28 @@ public void write(JsonWriter out, CloudFormationLaunchStackLink value) throws IO
public CloudFormationLaunchStackLink 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
+ CloudFormationLaunchStackLink instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/ConfirmEmailUpdateParam.java b/src/main/java/saasus/sdk/auth/models/ConfirmEmailUpdateParam.java
index 729c7720..69a322b7 100644
--- a/src/main/java/saasus/sdk/auth/models/ConfirmEmailUpdateParam.java
+++ b/src/main/java/saasus/sdk/auth/models/ConfirmEmailUpdateParam.java
@@ -49,7 +49,7 @@
/**
* ConfirmEmailUpdateParam
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class ConfirmEmailUpdateParam {
public static final String SERIALIZED_NAME_CODE = "code";
@SerializedName(SERIALIZED_NAME_CODE)
@@ -99,6 +99,50 @@ public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
+ /**
+ * 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 ConfirmEmailUpdateParam instance itself
+ */
+ public ConfirmEmailUpdateParam 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
@@ -111,12 +155,13 @@ public boolean equals(Object o) {
}
ConfirmEmailUpdateParam confirmEmailUpdateParam = (ConfirmEmailUpdateParam) o;
return Objects.equals(this.code, confirmEmailUpdateParam.code) &&
- Objects.equals(this.accessToken, confirmEmailUpdateParam.accessToken);
+ Objects.equals(this.accessToken, confirmEmailUpdateParam.accessToken)&&
+ Objects.equals(this.additionalProperties, confirmEmailUpdateParam.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(code, accessToken);
+ return Objects.hash(code, accessToken, additionalProperties);
}
@Override
@@ -125,6 +170,7 @@ public String toString() {
sb.append("class ConfirmEmailUpdateParam {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" accessToken: ").append(toIndentedString(accessToken)).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 (!ConfirmEmailUpdateParam.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConfirmEmailUpdateParam` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ConfirmEmailUpdateParam.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -207,6 +245,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, ConfirmEmailUpdateParam 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -214,7 +269,28 @@ public void write(JsonWriter out, ConfirmEmailUpdateParam value) throws IOExcept
public ConfirmEmailUpdateParam 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
+ ConfirmEmailUpdateParam instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/ConfirmExternalUserLinkParam.java b/src/main/java/saasus/sdk/auth/models/ConfirmExternalUserLinkParam.java
index 97002a50..2aa97f66 100644
--- a/src/main/java/saasus/sdk/auth/models/ConfirmExternalUserLinkParam.java
+++ b/src/main/java/saasus/sdk/auth/models/ConfirmExternalUserLinkParam.java
@@ -49,7 +49,7 @@
/**
* ConfirmExternalUserLinkParam
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class ConfirmExternalUserLinkParam {
public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token";
@SerializedName(SERIALIZED_NAME_ACCESS_TOKEN)
@@ -99,6 +99,50 @@ public void setCode(String code) {
this.code = code;
}
+ /**
+ * 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 ConfirmExternalUserLinkParam instance itself
+ */
+ public ConfirmExternalUserLinkParam 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
@@ -111,12 +155,13 @@ public boolean equals(Object o) {
}
ConfirmExternalUserLinkParam confirmExternalUserLinkParam = (ConfirmExternalUserLinkParam) o;
return Objects.equals(this.accessToken, confirmExternalUserLinkParam.accessToken) &&
- Objects.equals(this.code, confirmExternalUserLinkParam.code);
+ Objects.equals(this.code, confirmExternalUserLinkParam.code)&&
+ Objects.equals(this.additionalProperties, confirmExternalUserLinkParam.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(accessToken, code);
+ return Objects.hash(accessToken, code, additionalProperties);
}
@Override
@@ -125,6 +170,7 @@ public String toString() {
sb.append("class ConfirmExternalUserLinkParam {\n");
sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n");
sb.append(" code: ").append(toIndentedString(code)).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 (!ConfirmExternalUserLinkParam.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConfirmExternalUserLinkParam` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ConfirmExternalUserLinkParam.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -207,6 +245,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, ConfirmExternalUserLinkParam 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -214,7 +269,28 @@ public void write(JsonWriter out, ConfirmExternalUserLinkParam value) throws IOE
public ConfirmExternalUserLinkParam 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
+ ConfirmExternalUserLinkParam instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/ConfirmSignUpWithAwsMarketplaceParam.java b/src/main/java/saasus/sdk/auth/models/ConfirmSignUpWithAwsMarketplaceParam.java
index a73de51d..981321b3 100644
--- a/src/main/java/saasus/sdk/auth/models/ConfirmSignUpWithAwsMarketplaceParam.java
+++ b/src/main/java/saasus/sdk/auth/models/ConfirmSignUpWithAwsMarketplaceParam.java
@@ -49,7 +49,7 @@
/**
* ConfirmSignUpWithAwsMarketplaceParam
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class ConfirmSignUpWithAwsMarketplaceParam {
public static final String SERIALIZED_NAME_TENANT_NAME = "tenant_name";
@SerializedName(SERIALIZED_NAME_TENANT_NAME)
@@ -122,6 +122,50 @@ public void setRegistrationToken(String registrationToken) {
this.registrationToken = registrationToken;
}
+ /**
+ * 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 ConfirmSignUpWithAwsMarketplaceParam instance itself
+ */
+ public ConfirmSignUpWithAwsMarketplaceParam 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
@@ -135,12 +179,13 @@ public boolean equals(Object o) {
ConfirmSignUpWithAwsMarketplaceParam confirmSignUpWithAwsMarketplaceParam = (ConfirmSignUpWithAwsMarketplaceParam) o;
return Objects.equals(this.tenantName, confirmSignUpWithAwsMarketplaceParam.tenantName) &&
Objects.equals(this.accessToken, confirmSignUpWithAwsMarketplaceParam.accessToken) &&
- Objects.equals(this.registrationToken, confirmSignUpWithAwsMarketplaceParam.registrationToken);
+ Objects.equals(this.registrationToken, confirmSignUpWithAwsMarketplaceParam.registrationToken)&&
+ Objects.equals(this.additionalProperties, confirmSignUpWithAwsMarketplaceParam.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(tenantName, accessToken, registrationToken);
+ return Objects.hash(tenantName, accessToken, registrationToken, additionalProperties);
}
@Override
@@ -150,6 +195,7 @@ public String toString() {
sb.append(" tenantName: ").append(toIndentedString(tenantName)).append("\n");
sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n");
sb.append(" registrationToken: ").append(toIndentedString(registrationToken)).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 (!ConfirmSignUpWithAwsMarketplaceParam.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConfirmSignUpWithAwsMarketplaceParam` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : ConfirmSignUpWithAwsMarketplaceParam.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -236,6 +274,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, ConfirmSignUpWithAwsMarketplaceParam 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -243,7 +298,28 @@ public void write(JsonWriter out, ConfirmSignUpWithAwsMarketplaceParam value) th
public ConfirmSignUpWithAwsMarketplaceParam 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
+ ConfirmSignUpWithAwsMarketplaceParam instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/CreateSaasUserParam.java b/src/main/java/saasus/sdk/auth/models/CreateSaasUserParam.java
index e45ff43c..ca37b811 100644
--- a/src/main/java/saasus/sdk/auth/models/CreateSaasUserParam.java
+++ b/src/main/java/saasus/sdk/auth/models/CreateSaasUserParam.java
@@ -49,7 +49,7 @@
/**
* CreateSaasUserParam
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class CreateSaasUserParam {
public static final String SERIALIZED_NAME_EMAIL = "email";
@SerializedName(SERIALIZED_NAME_EMAIL)
@@ -99,6 +99,50 @@ public void setPassword(String password) {
this.password = password;
}
+ /**
+ * 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 CreateSaasUserParam instance itself
+ */
+ public CreateSaasUserParam 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
@@ -111,12 +155,13 @@ public boolean equals(Object o) {
}
CreateSaasUserParam createSaasUserParam = (CreateSaasUserParam) o;
return Objects.equals(this.email, createSaasUserParam.email) &&
- Objects.equals(this.password, createSaasUserParam.password);
+ Objects.equals(this.password, createSaasUserParam.password)&&
+ Objects.equals(this.additionalProperties, createSaasUserParam.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(email, password);
+ return Objects.hash(email, password, additionalProperties);
}
@Override
@@ -125,6 +170,7 @@ public String toString() {
sb.append("class CreateSaasUserParam {\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).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 (!CreateSaasUserParam.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSaasUserParam` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateSaasUserParam.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -207,6 +245,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, CreateSaasUserParam 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -214,7 +269,28 @@ public void write(JsonWriter out, CreateSaasUserParam value) throws IOException
public CreateSaasUserParam 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
+ CreateSaasUserParam instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/CreateSecretCodeParam.java b/src/main/java/saasus/sdk/auth/models/CreateSecretCodeParam.java
index b4efeab4..bd64c9d4 100644
--- a/src/main/java/saasus/sdk/auth/models/CreateSecretCodeParam.java
+++ b/src/main/java/saasus/sdk/auth/models/CreateSecretCodeParam.java
@@ -49,7 +49,7 @@
/**
* CreateSecretCodeParam
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class CreateSecretCodeParam {
public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token";
@SerializedName(SERIALIZED_NAME_ACCESS_TOKEN)
@@ -76,6 +76,50 @@ public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
+ /**
+ * 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 CreateSecretCodeParam instance itself
+ */
+ public CreateSecretCodeParam 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
@@ -87,12 +131,13 @@ public boolean equals(Object o) {
return false;
}
CreateSecretCodeParam createSecretCodeParam = (CreateSecretCodeParam) o;
- return Objects.equals(this.accessToken, createSecretCodeParam.accessToken);
+ return Objects.equals(this.accessToken, createSecretCodeParam.accessToken)&&
+ Objects.equals(this.additionalProperties, createSecretCodeParam.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(accessToken);
+ return Objects.hash(accessToken, additionalProperties);
}
@Override
@@ -100,6 +145,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateSecretCodeParam {\n");
sb.append(" accessToken: ").append(toIndentedString(accessToken)).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 (!CreateSecretCodeParam.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSecretCodeParam` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateSecretCodeParam.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -177,6 +215,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, CreateSecretCodeParam 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -184,7 +239,28 @@ public void write(JsonWriter out, CreateSecretCodeParam value) throws IOExceptio
public CreateSecretCodeParam 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
+ CreateSecretCodeParam instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/CreateTenantInvitationParam.java b/src/main/java/saasus/sdk/auth/models/CreateTenantInvitationParam.java
index d20b0741..9ab994f8 100644
--- a/src/main/java/saasus/sdk/auth/models/CreateTenantInvitationParam.java
+++ b/src/main/java/saasus/sdk/auth/models/CreateTenantInvitationParam.java
@@ -52,7 +52,7 @@
/**
* CreateTenantInvitationParam
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class CreateTenantInvitationParam {
public static final String SERIALIZED_NAME_EMAIL = "email";
@SerializedName(SERIALIZED_NAME_EMAIL)
@@ -133,6 +133,50 @@ public void setEnvs(List envs) {
this.envs = envs;
}
+ /**
+ * 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 CreateTenantInvitationParam instance itself
+ */
+ public CreateTenantInvitationParam 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
@@ -146,12 +190,13 @@ public boolean equals(Object o) {
CreateTenantInvitationParam createTenantInvitationParam = (CreateTenantInvitationParam) o;
return Objects.equals(this.email, createTenantInvitationParam.email) &&
Objects.equals(this.accessToken, createTenantInvitationParam.accessToken) &&
- Objects.equals(this.envs, createTenantInvitationParam.envs);
+ Objects.equals(this.envs, createTenantInvitationParam.envs)&&
+ Objects.equals(this.additionalProperties, createTenantInvitationParam.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(email, accessToken, envs);
+ return Objects.hash(email, accessToken, envs, additionalProperties);
}
@Override
@@ -161,6 +206,7 @@ public String toString() {
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n");
sb.append(" envs: ").append(toIndentedString(envs)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -207,14 +253,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 (!CreateTenantInvitationParam.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTenantInvitationParam` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateTenantInvitationParam.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -255,6 +293,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, CreateTenantInvitationParam 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -262,7 +317,28 @@ public void write(JsonWriter out, CreateTenantInvitationParam value) throws IOEx
public CreateTenantInvitationParam 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
+ CreateTenantInvitationParam instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/CreateTenantUserParam.java b/src/main/java/saasus/sdk/auth/models/CreateTenantUserParam.java
index bf7ff620..3298b304 100644
--- a/src/main/java/saasus/sdk/auth/models/CreateTenantUserParam.java
+++ b/src/main/java/saasus/sdk/auth/models/CreateTenantUserParam.java
@@ -51,7 +51,7 @@
/**
* CreateTenantUserParam
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class CreateTenantUserParam {
public static final String SERIALIZED_NAME_EMAIL = "email";
@SerializedName(SERIALIZED_NAME_EMAIL)
@@ -109,6 +109,50 @@ public void setAttributes(Map attributes) {
this.attributes = attributes;
}
+ /**
+ * 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 CreateTenantUserParam instance itself
+ */
+ public CreateTenantUserParam 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
@@ -121,12 +165,13 @@ public boolean equals(Object o) {
}
CreateTenantUserParam createTenantUserParam = (CreateTenantUserParam) o;
return Objects.equals(this.email, createTenantUserParam.email) &&
- Objects.equals(this.attributes, createTenantUserParam.attributes);
+ Objects.equals(this.attributes, createTenantUserParam.attributes)&&
+ Objects.equals(this.additionalProperties, createTenantUserParam.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(email, attributes);
+ return Objects.hash(email, attributes, additionalProperties);
}
@Override
@@ -135,6 +180,7 @@ public String toString() {
sb.append("class CreateTenantUserParam {\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -179,14 +225,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 (!CreateTenantUserParam.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTenantUserParam` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateTenantUserParam.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -214,6 +252,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, CreateTenantUserParam 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -221,7 +276,28 @@ public void write(JsonWriter out, CreateTenantUserParam value) throws IOExceptio
public CreateTenantUserParam 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
+ CreateTenantUserParam instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/CreateTenantUserRolesParam.java b/src/main/java/saasus/sdk/auth/models/CreateTenantUserRolesParam.java
index 81f263ee..ab0eec9e 100644
--- a/src/main/java/saasus/sdk/auth/models/CreateTenantUserRolesParam.java
+++ b/src/main/java/saasus/sdk/auth/models/CreateTenantUserRolesParam.java
@@ -51,7 +51,7 @@
/**
* CreateTenantUserRolesParam
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class CreateTenantUserRolesParam {
public static final String SERIALIZED_NAME_ROLE_NAMES = "role_names";
@SerializedName(SERIALIZED_NAME_ROLE_NAMES)
@@ -86,6 +86,50 @@ public void setRoleNames(List roleNames) {
this.roleNames = roleNames;
}
+ /**
+ * 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 CreateTenantUserRolesParam instance itself
+ */
+ public CreateTenantUserRolesParam 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
@@ -97,12 +141,13 @@ public boolean equals(Object o) {
return false;
}
CreateTenantUserRolesParam createTenantUserRolesParam = (CreateTenantUserRolesParam) o;
- return Objects.equals(this.roleNames, createTenantUserRolesParam.roleNames);
+ return Objects.equals(this.roleNames, createTenantUserRolesParam.roleNames)&&
+ Objects.equals(this.additionalProperties, createTenantUserRolesParam.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(roleNames);
+ return Objects.hash(roleNames, additionalProperties);
}
@Override
@@ -110,6 +155,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateTenantUserRolesParam {\n");
sb.append(" roleNames: ").append(toIndentedString(roleNames)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -152,14 +198,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 (!CreateTenantUserRolesParam.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTenantUserRolesParam` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CreateTenantUserRolesParam.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -190,6 +228,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, CreateTenantUserRolesParam 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -197,7 +252,28 @@ public void write(JsonWriter out, CreateTenantUserRolesParam value) throws IOExc
public CreateTenantUserRolesParam 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
+ CreateTenantUserRolesParam instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/Credentials.java b/src/main/java/saasus/sdk/auth/models/Credentials.java
index 3a5a8144..4fb87310 100644
--- a/src/main/java/saasus/sdk/auth/models/Credentials.java
+++ b/src/main/java/saasus/sdk/auth/models/Credentials.java
@@ -49,7 +49,7 @@
/**
* Credentials
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class Credentials {
public static final String SERIALIZED_NAME_ID_TOKEN = "id_token";
@SerializedName(SERIALIZED_NAME_ID_TOKEN)
@@ -122,6 +122,50 @@ public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
}
+ /**
+ * 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 Credentials instance itself
+ */
+ public Credentials 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
@@ -135,12 +179,13 @@ public boolean equals(Object o) {
Credentials credentials = (Credentials) o;
return Objects.equals(this.idToken, credentials.idToken) &&
Objects.equals(this.accessToken, credentials.accessToken) &&
- Objects.equals(this.refreshToken, credentials.refreshToken);
+ Objects.equals(this.refreshToken, credentials.refreshToken)&&
+ Objects.equals(this.additionalProperties, credentials.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(idToken, accessToken, refreshToken);
+ return Objects.hash(idToken, accessToken, refreshToken, additionalProperties);
}
@Override
@@ -150,6 +195,7 @@ public String toString() {
sb.append(" idToken: ").append(toIndentedString(idToken)).append("\n");
sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n");
sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).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 (!Credentials.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Credentials` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : Credentials.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -236,6 +274,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, Credentials 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -243,7 +298,28 @@ public void write(JsonWriter out, Credentials value) throws IOException {
public Credentials 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
+ Credentials instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/CustomizePageProps.java b/src/main/java/saasus/sdk/auth/models/CustomizePageProps.java
index fee6b0ea..e96025fe 100644
--- a/src/main/java/saasus/sdk/auth/models/CustomizePageProps.java
+++ b/src/main/java/saasus/sdk/auth/models/CustomizePageProps.java
@@ -49,7 +49,7 @@
/**
* CustomizePageProps
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class CustomizePageProps {
public static final String SERIALIZED_NAME_HTML_CONTENTS = "html_contents";
@SerializedName(SERIALIZED_NAME_HTML_CONTENTS)
@@ -122,6 +122,50 @@ public void setIsPrivacyPolicy(Boolean isPrivacyPolicy) {
this.isPrivacyPolicy = isPrivacyPolicy;
}
+ /**
+ * 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 CustomizePageProps instance itself
+ */
+ public CustomizePageProps 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
@@ -135,12 +179,13 @@ public boolean equals(Object o) {
CustomizePageProps customizePageProps = (CustomizePageProps) o;
return Objects.equals(this.htmlContents, customizePageProps.htmlContents) &&
Objects.equals(this.isTermsOfService, customizePageProps.isTermsOfService) &&
- Objects.equals(this.isPrivacyPolicy, customizePageProps.isPrivacyPolicy);
+ Objects.equals(this.isPrivacyPolicy, customizePageProps.isPrivacyPolicy)&&
+ Objects.equals(this.additionalProperties, customizePageProps.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(htmlContents, isTermsOfService, isPrivacyPolicy);
+ return Objects.hash(htmlContents, isTermsOfService, isPrivacyPolicy, additionalProperties);
}
@Override
@@ -150,6 +195,7 @@ public String toString() {
sb.append(" htmlContents: ").append(toIndentedString(htmlContents)).append("\n");
sb.append(" isTermsOfService: ").append(toIndentedString(isTermsOfService)).append("\n");
sb.append(" isPrivacyPolicy: ").append(toIndentedString(isPrivacyPolicy)).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 (!CustomizePageProps.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CustomizePageProps` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CustomizePageProps.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -231,6 +269,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, CustomizePageProps 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -238,7 +293,28 @@ public void write(JsonWriter out, CustomizePageProps value) throws IOException {
public CustomizePageProps 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
+ CustomizePageProps instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/CustomizePageSettings.java b/src/main/java/saasus/sdk/auth/models/CustomizePageSettings.java
index df3d0bd5..1d51ec6d 100644
--- a/src/main/java/saasus/sdk/auth/models/CustomizePageSettings.java
+++ b/src/main/java/saasus/sdk/auth/models/CustomizePageSettings.java
@@ -49,7 +49,7 @@
/**
* CustomizePageSettings
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class CustomizePageSettings {
public static final String SERIALIZED_NAME_TITLE = "title";
@SerializedName(SERIALIZED_NAME_TITLE)
@@ -191,6 +191,50 @@ public void setFavicon(String favicon) {
this.favicon = favicon;
}
+ /**
+ * 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 CustomizePageSettings instance itself
+ */
+ public CustomizePageSettings 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
@@ -207,12 +251,13 @@ public boolean equals(Object o) {
Objects.equals(this.privacyPolicyUrl, customizePageSettings.privacyPolicyUrl) &&
Objects.equals(this.googleTagManagerContainerId, customizePageSettings.googleTagManagerContainerId) &&
Objects.equals(this.icon, customizePageSettings.icon) &&
- Objects.equals(this.favicon, customizePageSettings.favicon);
+ Objects.equals(this.favicon, customizePageSettings.favicon)&&
+ Objects.equals(this.additionalProperties, customizePageSettings.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(title, termsOfServiceUrl, privacyPolicyUrl, googleTagManagerContainerId, icon, favicon);
+ return Objects.hash(title, termsOfServiceUrl, privacyPolicyUrl, googleTagManagerContainerId, icon, favicon, additionalProperties);
}
@Override
@@ -225,6 +270,7 @@ public String toString() {
sb.append(" googleTagManagerContainerId: ").append(toIndentedString(googleTagManagerContainerId)).append("\n");
sb.append(" icon: ").append(toIndentedString(icon)).append("\n");
sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -277,14 +323,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 (!CustomizePageSettings.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CustomizePageSettings` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CustomizePageSettings.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -327,6 +365,23 @@ public TypeAdapter create(Gson gson, TypeToken type) {
@Override
public void write(JsonWriter out, CustomizePageSettings 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 {
+ obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
+ }
+ }
+ }
elementAdapter.write(out, obj);
}
@@ -334,7 +389,28 @@ public void write(JsonWriter out, CustomizePageSettings value) throws IOExceptio
public CustomizePageSettings 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
+ CustomizePageSettings instance = thisAdapter.fromJsonTree(jsonObj);
+ for (Map.Entry entry : jsonObj.entrySet()) {
+ if (!openapiFields.contains(entry.getKey())) {
+ if (entry.getValue().isJsonPrimitive()) { // primitive type
+ if (entry.getValue().getAsJsonPrimitive().isString())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
+ else if (entry.getValue().getAsJsonPrimitive().isNumber())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
+ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
+ instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
+ else
+ throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
+ } else if (entry.getValue().isJsonArray()) {
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
+ } else { // JSON object
+ instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
+ }
+ }
+ }
+ return instance;
}
}.nullSafe();
diff --git a/src/main/java/saasus/sdk/auth/models/CustomizePageSettingsProps.java b/src/main/java/saasus/sdk/auth/models/CustomizePageSettingsProps.java
index 46f36acd..cb477a9c 100644
--- a/src/main/java/saasus/sdk/auth/models/CustomizePageSettingsProps.java
+++ b/src/main/java/saasus/sdk/auth/models/CustomizePageSettingsProps.java
@@ -49,7 +49,7 @@
/**
* CustomizePageSettingsProps
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T05:09:21.529968105Z[Etc/UTC]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-16T07:39:27.178015511Z[Etc/UTC]")
public class CustomizePageSettingsProps {
public static final String SERIALIZED_NAME_TITLE = "title";
@SerializedName(SERIALIZED_NAME_TITLE)
@@ -145,6 +145,50 @@ public void setGoogleTagManagerContainerId(String googleTagManagerContainerId) {
this.googleTagManagerContainerId = googleTagManagerContainerId;
}
+ /**
+ * 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 CustomizePageSettingsProps instance itself
+ */
+ public CustomizePageSettingsProps 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
@@ -159,12 +203,13 @@ public boolean equals(Object o) {
return Objects.equals(this.title, customizePageSettingsProps.title) &&
Objects.equals(this.termsOfServiceUrl, customizePageSettingsProps.termsOfServiceUrl) &&
Objects.equals(this.privacyPolicyUrl, customizePageSettingsProps.privacyPolicyUrl) &&
- Objects.equals(this.googleTagManagerContainerId, customizePageSettingsProps.googleTagManagerContainerId);
+ Objects.equals(this.googleTagManagerContainerId, customizePageSettingsProps.googleTagManagerContainerId)&&
+ Objects.equals(this.additionalProperties, customizePageSettingsProps.additionalProperties);
}
@Override
public int hashCode() {
- return Objects.hash(title, termsOfServiceUrl, privacyPolicyUrl, googleTagManagerContainerId);
+ return Objects.hash(title, termsOfServiceUrl, privacyPolicyUrl, googleTagManagerContainerId, additionalProperties);
}
@Override
@@ -175,6 +220,7 @@ public String toString() {
sb.append(" termsOfServiceUrl: ").append(toIndentedString(termsOfServiceUrl)).append("\n");
sb.append(" privacyPolicyUrl: ").append(toIndentedString(privacyPolicyUrl)).append("\n");
sb.append(" googleTagManagerContainerId: ").append(toIndentedString(googleTagManagerContainerId)).append("\n");
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@@ -223,14 +269,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 (!CustomizePageSettingsProps.openapiFields.contains(entry.getKey())) {
- throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CustomizePageSettingsProps` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
- }
- }
-
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : CustomizePageSettingsProps.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
@@ -267,6 +305,23 @@ public