diff --git a/services/automation/build.gradle b/services/automation/build.gradle index 314067c8..aafa5f0b 100644 --- a/services/automation/build.gradle +++ b/services/automation/build.gradle @@ -10,7 +10,7 @@ dependencies { implementation 'com.google.code.gson:gson:2.9.1' implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' - implementation 'org.openapitools:jackson-databind-nullable:0.2.8' + implementation 'org.openapitools:jackson-databind-nullable:0.2.12' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' diff --git a/services/automation/oas_commit b/services/automation/oas_commit index 1b5fc1bc..06fd3389 100644 --- a/services/automation/oas_commit +++ b/services/automation/oas_commit @@ -1 +1 @@ -102a0d5966d54620a8ab70b605797a676c9a0082 +3d55d58fe8607afa4f894077e1e5c0a19ef57b3f diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ApiClient.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ApiClient.java index 1e7f5d9d..7aa5f537 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ApiClient.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ApiClient.java @@ -397,6 +397,17 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + /** + * Set LocalDateTimeFormat. + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link cloud.stackit.sdk.automation.v1api.ApiClient} object + */ + public ApiClient setLocalDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateTimeFormat(dateFormat); + return this; + } + /** * Set LenientOnJson. * @@ -597,6 +608,46 @@ public String parameterToString(Object param) { } } + /** + * Format the given parameter object as an ASCII-safe JSON string. + * + * @param param Parameter + * @return JSON representation of the parameter + */ + public String parameterToJsonString(Object param) { + if (param == null) { + return ""; + } + String json = JSON.serialize(param); + int firstUnsafe = -1; + for (int i = 0; i < json.length(); i++) { + if (json.charAt(i) >= 0x7f) { + firstUnsafe = i; + break; + } + } + if (firstUnsafe == -1) { + return json; + } + + StringBuilder escaped = new StringBuilder(json.length()); + escaped.append(json, 0, firstUnsafe); + for (int i = firstUnsafe; i < json.length(); i++) { + char c = json.charAt(i); + if (c >= 0x7f) { + escaped.append("\\u"); + escaped.append(Character.forDigit((c >> 12) & 0xf, 16)); + escaped.append(Character.forDigit((c >> 8) & 0xf, 16)); + escaped.append(Character.forDigit((c >> 4) & 0xf, 16)); + escaped.append(Character.forDigit(c & 0xf, 16)); + } else { + escaped.append(c); + } + } + + return escaped.toString(); + } + /** * Formats the specified query parameter to a list containing a single {@code Pair} object. * diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/JSON.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/JSON.java index 20e1d10a..94c34267 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/JSON.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/JSON.java @@ -31,8 +31,10 @@ import java.text.ParseException; import java.text.ParsePosition; import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.util.Date; import java.util.Map; import okio.ByteString; @@ -51,6 +53,8 @@ public class JSON { private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static LocalDateTimeTypeAdapter localDateTimeTypeAdapter = + new LocalDateTimeTypeAdapter(); private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") @@ -94,6 +98,7 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDateTime.class, localDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.automation.v1api.model.AutomationScheduleTrigger @@ -401,6 +406,53 @@ public LocalDate read(JsonReader in) throws IOException { } } + /** Gson TypeAdapter for JSR310 LocalDateTime type */ + public static class LocalDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE_TIME); + } + + public LocalDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + return LocalDateTime.parse(date, formatter); + } catch (DateTimeParseException e) { + if (date.length() > 10 && date.charAt(10) == ' ') { + date = date.substring(0, 10) + 'T' + date.substring(11); + return LocalDateTime.parse(date, formatter); + } + throw e; + } + } + } + } + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); } @@ -409,6 +461,10 @@ public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); } + public static void setLocalDateTimeFormat(DateTimeFormatter dateFormat) { + localDateTimeTypeAdapter.setFormat(dateFormat); + } + /** * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" * format will be used (more efficient than SimpleDateFormat). diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/Pair.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/Pair.java index 16eead55..c0d60d0e 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/Pair.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/Pair.java @@ -12,7 +12,7 @@ package cloud.stackit.sdk.automation.v1api; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Pair { private final String name; private final String value; diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ServerConfiguration.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ServerConfiguration.java index c2f0b3f0..447e5ef5 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ServerConfiguration.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ServerConfiguration.java @@ -15,7 +15,7 @@ import java.util.Map; /** Representing a Server configuration. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerConfiguration { public String URL; public String description; diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ServerVariable.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ServerVariable.java index 5fa2ec2d..d1c4fc74 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ServerVariable.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ServerVariable.java @@ -15,7 +15,7 @@ import java.util.HashSet; /** Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/StringUtil.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/StringUtil.java index d53680e8..c2627cd6 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/StringUtil.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/StringUtil.java @@ -15,7 +15,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AbstractOpenApiSchema.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AbstractOpenApiSchema.java index 9e2ac998..cfd241af 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AbstractOpenApiSchema.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AbstractOpenApiSchema.java @@ -16,7 +16,7 @@ import java.util.Objects; /** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -104,10 +104,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public boolean equals(Object o) { diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AutomationScheduleTrigger.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AutomationScheduleTrigger.java index bbca808c..d2f294db 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AutomationScheduleTrigger.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AutomationScheduleTrigger.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** AutomationScheduleTrigger */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AutomationScheduleTrigger { public static final String SERIALIZED_NAME_RRULE = "rrule"; @@ -142,10 +143,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -232,7 +230,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AutomationTriggers.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AutomationTriggers.java index 2006be9e..807e6d94 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AutomationTriggers.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/AutomationTriggers.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** AutomationTriggers */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AutomationTriggers { public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; @@ -156,10 +157,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -230,7 +228,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/CreateSnapshotsResult.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/CreateSnapshotsResult.java index f0020302..2cb077ec 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/CreateSnapshotsResult.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/CreateSnapshotsResult.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** CreateSnapshotsResult */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSnapshotsResult { public static final String SERIALIZED_NAME_CREATED_SNAPSHOT_I_DS = "createdSnapshotIDs"; @@ -178,10 +179,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -277,7 +275,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/CreateVolumeAutomationPayload.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/CreateVolumeAutomationPayload.java index 11e55f2d..3671f197 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/CreateVolumeAutomationPayload.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/CreateVolumeAutomationPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** CreateVolumeAutomationPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateVolumeAutomationPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -263,10 +264,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -377,7 +375,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorInfoDetail.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorInfoDetail.java index cc853b9f..fbce2e42 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorInfoDetail.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorInfoDetail.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ErrorInfoDetail */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ErrorInfoDetail { public static final String SERIALIZED_NAME_AT_TYPE = "@type"; @@ -226,10 +227,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -329,7 +327,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponse.java index f9f57b0e..d44ba0a9 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ErrorResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ErrorResponse { public static final String SERIALIZED_NAME_ERROR = "error"; @@ -139,10 +140,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -222,7 +220,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponseContent.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponseContent.java index af676e64..2f888275 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponseContent.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponseContent.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** ErrorResponseContent */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ErrorResponseContent { public static final String SERIALIZED_NAME_CODE = "code"; @@ -229,10 +230,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -335,7 +333,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponseContentDetails.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponseContentDetails.java index 94321510..8edc8c5a 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponseContentDetails.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ErrorResponseContentDetails.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ErrorResponseContentDetails */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ErrorResponseContentDetails { public static final String SERIALIZED_NAME_AT_TYPE = "@type"; @@ -141,10 +142,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -232,7 +230,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/EventCreateResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/EventCreateResponse.java index 27731a8b..42ee5f9c 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/EventCreateResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/EventCreateResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** EventCreateResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class EventCreateResponse { public static final String SERIALIZED_NAME_ID = "id"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -229,7 +227,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/GetVolumeIDsResult.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/GetVolumeIDsResult.java index d7e41ff4..1594353f 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/GetVolumeIDsResult.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/GetVolumeIDsResult.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** GetVolumeIDsResult */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetVolumeIDsResult { public static final String SERIALIZED_NAME_KIND = "kind"; @@ -175,10 +176,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -274,7 +272,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/GetVolumeTemplateResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/GetVolumeTemplateResponse.java index 57cba736..97b33662 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/GetVolumeTemplateResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/GetVolumeTemplateResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** GetVolumeTemplateResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetVolumeTemplateResponse { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -274,10 +275,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -390,7 +388,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/HelpErrorDetail.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/HelpErrorDetail.java index 77ef9e5a..6288d97a 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/HelpErrorDetail.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/HelpErrorDetail.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** HelpErrorDetail */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class HelpErrorDetail { public static final String SERIALIZED_NAME_AT_TYPE = "@type"; @@ -193,10 +194,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -296,7 +294,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListAutomationsItem.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListAutomationsItem.java index c930a839..d1df6858 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListAutomationsItem.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListAutomationsItem.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** ListAutomationsItem */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListAutomationsItem { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -321,10 +322,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -448,7 +446,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListAutomationsResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListAutomationsResponse.java index 6dbbeefb..c12c1932 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListAutomationsResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListAutomationsResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** ListAutomationsResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListAutomationsResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -177,10 +178,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -224,21 +222,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - ListAutomationsItem.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + ListAutomationsItem.validateJsonElement(jsonArrayitems.get(i)); + } } - ; if ((jsonObj.get("nextPageToken") != null && !jsonObj.get("nextPageToken").isJsonNull()) && !jsonObj.get("nextPageToken").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -283,7 +280,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListExecutionsItem.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListExecutionsItem.java index 2a130b5c..6fc04c28 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListExecutionsItem.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListExecutionsItem.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** ListExecutionsItem */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListExecutionsItem { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -281,10 +282,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -379,7 +377,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListExecutionsResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListExecutionsResponse.java index 58837b3c..8570faaf 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListExecutionsResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListExecutionsResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** ListExecutionsResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListExecutionsResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -176,10 +177,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -223,21 +221,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - ListExecutionsItem.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + ListExecutionsItem.validateJsonElement(jsonArrayitems.get(i)); + } } - ; if ((jsonObj.get("nextPageToken") != null && !jsonObj.get("nextPageToken").isJsonNull()) && !jsonObj.get("nextPageToken").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -281,7 +278,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListTemplatesResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListTemplatesResponse.java index fbaf1325..f44cf372 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListTemplatesResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ListTemplatesResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** ListTemplatesResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListTemplatesResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -176,10 +177,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -223,21 +221,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Template.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Template.validateJsonElement(jsonArrayitems.get(i)); + } } - ; if ((jsonObj.get("nextPageToken") != null && !jsonObj.get("nextPageToken").isJsonNull()) && !jsonObj.get("nextPageToken").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -281,7 +278,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/LocalizedMessageErrorDetail.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/LocalizedMessageErrorDetail.java index 1fdaacda..e2b87dee 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/LocalizedMessageErrorDetail.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/LocalizedMessageErrorDetail.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** LocalizedMessageErrorDetail */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class LocalizedMessageErrorDetail { public static final String SERIALIZED_NAME_AT_TYPE = "@type"; @@ -195,10 +196,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -300,7 +298,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/PartialUpdateVolumeAutomationPayload.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/PartialUpdateVolumeAutomationPayload.java index c3ad027b..fbf29341 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/PartialUpdateVolumeAutomationPayload.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/PartialUpdateVolumeAutomationPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** PartialUpdateVolumeAutomationPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PartialUpdateVolumeAutomationPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -235,10 +236,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -331,7 +329,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/Schedule.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/Schedule.java index a530ef6e..795965a3 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/Schedule.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/Schedule.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Schedule */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Schedule { public static final String SERIALIZED_NAME_ID = "id"; @@ -162,10 +163,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ScheduleDetails.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ScheduleDetails.java index 57101acb..8a0b7d5c 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ScheduleDetails.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ScheduleDetails.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ScheduleDetails */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ScheduleDetails { public static final String SERIALIZED_NAME_ID = "id"; @@ -196,10 +197,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -282,7 +280,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/SchedulePatchRequest.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/SchedulePatchRequest.java index 697392d6..db5b4094 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/SchedulePatchRequest.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/SchedulePatchRequest.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** SchedulePatchRequest */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SchedulePatchRequest { public static final String SERIALIZED_NAME_NAME = "name"; @@ -197,10 +198,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -283,7 +281,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ScheduleRequest.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ScheduleRequest.java index 34c681a4..37704e0a 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ScheduleRequest.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/ScheduleRequest.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ScheduleRequest */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ScheduleRequest { public static final String SERIALIZED_NAME_NAME = "name"; @@ -200,10 +201,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -296,7 +294,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/SnapshotRetentionPolicy.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/SnapshotRetentionPolicy.java index 84f474f6..e2cc5a95 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/SnapshotRetentionPolicy.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/SnapshotRetentionPolicy.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** SnapshotRetentionPolicy */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SnapshotRetentionPolicy { public static final String SERIALIZED_NAME_KIND = "kind"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -230,7 +228,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/Template.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/Template.java index 875d5e15..2f699878 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/Template.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/Template.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Template */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Template { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -221,10 +222,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -325,7 +323,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeAutomation.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeAutomation.java index 0da47015..93a70f9c 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeAutomation.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeAutomation.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** VolumeAutomation */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeAutomation { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -372,10 +373,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -505,7 +503,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeAutomationInput.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeAutomationInput.java index 261a46e2..1b990841 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeAutomationInput.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeAutomationInput.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** VolumeAutomationInput */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeAutomationInput { public static final String SERIALIZED_NAME_KIND = "kind"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -229,7 +227,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionAutomation.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionAutomation.java index 7d1fb773..d4e7da7f 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionAutomation.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionAutomation.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** VolumeExecutionAutomation */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeExecutionAutomation { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -348,10 +349,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -473,7 +471,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionDetails.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionDetails.java index cf0ea0db..b41ab81c 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionDetails.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionDetails.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** VolumeExecutionDetails */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeExecutionDetails { public static final String SERIALIZED_NAME_CONFIG = "config"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -254,7 +252,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionOutput.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionOutput.java index eb9b0f8c..0d522e21 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionOutput.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionOutput.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** VolumeExecutionOutput */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeExecutionOutput { public static final String SERIALIZED_NAME_STEPS = "steps"; @@ -149,10 +150,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -238,7 +236,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionOutputStep.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionOutputStep.java index b922d977..ff2cc58b 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionOutputStep.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionOutputStep.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** VolumeExecutionOutputStep */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeExecutionOutputStep { public static final String SERIALIZED_NAME_MESSAGE = "message"; @@ -276,10 +277,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -383,7 +381,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionResponse.java index 2d322189..8163c36b 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeExecutionResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** VolumeExecutionResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeExecutionResponse { public static final String SERIALIZED_NAME_AUTOMATION = "automation"; @@ -307,10 +308,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -412,7 +410,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutput.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutput.java index c1031357..69bbeb02 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutput.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutput.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** VolumeOutput */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeOutput { public static final String SERIALIZED_NAME_STEPS = "steps"; @@ -147,10 +148,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -235,7 +233,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutputStep.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutputStep.java index dbd22dd5..0de7ce46 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutputStep.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutputStep.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** VolumeOutputStep */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeOutputStep { public static final String SERIALIZED_NAME_NAME = "name"; @@ -164,10 +165,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -253,7 +251,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutputStepResult.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutputStepResult.java index e7c2966c..c4180f32 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutputStepResult.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeOutputStepResult.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** VolumeOutputStepResult */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeOutputStepResult { public static final String SERIALIZED_NAME_KIND = "kind"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -229,7 +227,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeRecoveryPointManagementInput.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeRecoveryPointManagementInput.java index 6c31ba91..23c39a60 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeRecoveryPointManagementInput.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeRecoveryPointManagementInput.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** VolumeRecoveryPointManagementInput */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeRecoveryPointManagementInput { public static final String SERIALIZED_NAME_INHERIT_VOLUME_LABELS = "inheritVolumeLabels"; @@ -282,10 +283,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -392,7 +390,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeTemplateAutomationInput.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeTemplateAutomationInput.java index 1396def3..a10e9400 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeTemplateAutomationInput.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/model/VolumeTemplateAutomationInput.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** VolumeTemplateAutomationInput */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeTemplateAutomationInput { /** Gets or Sets kind */ @JsonAdapter(KindEnum.Adapter.class) @@ -194,10 +195,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -288,7 +286,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ApiClient.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ApiClient.java index 67471af3..3f55f5f0 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ApiClient.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ApiClient.java @@ -397,6 +397,17 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + /** + * Set LocalDateTimeFormat. + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link cloud.stackit.sdk.automation.v1betaapi.ApiClient} object + */ + public ApiClient setLocalDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateTimeFormat(dateFormat); + return this; + } + /** * Set LenientOnJson. * @@ -597,6 +608,46 @@ public String parameterToString(Object param) { } } + /** + * Format the given parameter object as an ASCII-safe JSON string. + * + * @param param Parameter + * @return JSON representation of the parameter + */ + public String parameterToJsonString(Object param) { + if (param == null) { + return ""; + } + String json = JSON.serialize(param); + int firstUnsafe = -1; + for (int i = 0; i < json.length(); i++) { + if (json.charAt(i) >= 0x7f) { + firstUnsafe = i; + break; + } + } + if (firstUnsafe == -1) { + return json; + } + + StringBuilder escaped = new StringBuilder(json.length()); + escaped.append(json, 0, firstUnsafe); + for (int i = firstUnsafe; i < json.length(); i++) { + char c = json.charAt(i); + if (c >= 0x7f) { + escaped.append("\\u"); + escaped.append(Character.forDigit((c >> 12) & 0xf, 16)); + escaped.append(Character.forDigit((c >> 8) & 0xf, 16)); + escaped.append(Character.forDigit((c >> 4) & 0xf, 16)); + escaped.append(Character.forDigit(c & 0xf, 16)); + } else { + escaped.append(c); + } + } + + return escaped.toString(); + } + /** * Formats the specified query parameter to a list containing a single {@code Pair} object. * diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/JSON.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/JSON.java index a3ef19a5..52befb60 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/JSON.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/JSON.java @@ -32,8 +32,10 @@ import java.text.ParseException; import java.text.ParsePosition; import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -53,6 +55,8 @@ public class JSON { private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static LocalDateTimeTypeAdapter localDateTimeTypeAdapter = + new LocalDateTimeTypeAdapter(); private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") @@ -222,6 +226,7 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDateTime.class, localDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.automation.v1betaapi.model.AutomationScheduleTrigger @@ -537,6 +542,53 @@ public LocalDate read(JsonReader in) throws IOException { } } + /** Gson TypeAdapter for JSR310 LocalDateTime type */ + public static class LocalDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE_TIME); + } + + public LocalDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + return LocalDateTime.parse(date, formatter); + } catch (DateTimeParseException e) { + if (date.length() > 10 && date.charAt(10) == ' ') { + date = date.substring(0, 10) + 'T' + date.substring(11); + return LocalDateTime.parse(date, formatter); + } + throw e; + } + } + } + } + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); } @@ -545,6 +597,10 @@ public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); } + public static void setLocalDateTimeFormat(DateTimeFormatter dateFormat) { + localDateTimeTypeAdapter.setFormat(dateFormat); + } + /** * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" * format will be used (more efficient than SimpleDateFormat). diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/Pair.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/Pair.java index cc869ab4..a7a98430 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/Pair.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/Pair.java @@ -12,7 +12,7 @@ package cloud.stackit.sdk.automation.v1betaapi; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Pair { private final String name; private final String value; diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ServerConfiguration.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ServerConfiguration.java index f4556f5e..8ddb5e13 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ServerConfiguration.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ServerConfiguration.java @@ -15,7 +15,7 @@ import java.util.Map; /** Representing a Server configuration. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerConfiguration { public String URL; public String description; diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ServerVariable.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ServerVariable.java index 876c61a5..0cb469fa 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ServerVariable.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/ServerVariable.java @@ -15,7 +15,7 @@ import java.util.HashSet; /** Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/StringUtil.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/StringUtil.java index 10621d3a..5e505753 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/StringUtil.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/StringUtil.java @@ -15,7 +15,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AbstractOpenApiSchema.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AbstractOpenApiSchema.java index 24766f0d..4acbd006 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AbstractOpenApiSchema.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AbstractOpenApiSchema.java @@ -16,7 +16,7 @@ import java.util.Objects; /** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -104,10 +104,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public boolean equals(Object o) { diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AutomationScheduleTrigger.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AutomationScheduleTrigger.java index 0a0b2e06..616f5acd 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AutomationScheduleTrigger.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AutomationScheduleTrigger.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** AutomationScheduleTrigger */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AutomationScheduleTrigger { public static final String SERIALIZED_NAME_RRULE = "rrule"; @@ -142,10 +143,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -232,7 +230,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AutomationTriggers.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AutomationTriggers.java index 74309431..ff60571e 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AutomationTriggers.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/AutomationTriggers.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** AutomationTriggers */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AutomationTriggers { public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; @@ -139,10 +140,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -213,7 +211,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/CreateSnapshotsResult.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/CreateSnapshotsResult.java index 91668ac1..54b96c4c 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/CreateSnapshotsResult.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/CreateSnapshotsResult.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** CreateSnapshotsResult */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSnapshotsResult { public static final String SERIALIZED_NAME_CREATED_SNAPSHOT_I_DS = "createdSnapshotIDs"; @@ -178,10 +179,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -286,7 +284,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/CreateVolumeAutomationPayload.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/CreateVolumeAutomationPayload.java index 66999216..e079c265 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/CreateVolumeAutomationPayload.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/CreateVolumeAutomationPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** CreateVolumeAutomationPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateVolumeAutomationPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -246,10 +247,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -364,7 +362,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorInfoDetail.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorInfoDetail.java index 699582cd..a58a5a20 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorInfoDetail.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorInfoDetail.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ErrorInfoDetail */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ErrorInfoDetail { public static final String SERIALIZED_NAME_AT_TYPE = "@type"; @@ -226,10 +227,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -329,7 +327,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponse.java index b1608581..628987bc 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ErrorResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ErrorResponse { public static final String SERIALIZED_NAME_ERROR = "error"; @@ -139,10 +140,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -222,7 +220,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponseContent.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponseContent.java index bbb8099b..f4bce0a4 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponseContent.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponseContent.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** ErrorResponseContent */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ErrorResponseContent { public static final String SERIALIZED_NAME_CODE = "code"; @@ -230,10 +231,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -345,7 +343,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponseContentDetails.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponseContentDetails.java index 10e287bd..3e6d2290 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponseContentDetails.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ErrorResponseContentDetails.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ErrorResponseContentDetails extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(ErrorResponseContentDetails.class.getName()); @@ -244,6 +244,7 @@ public Object getActualInstance() { * @return The actual instance of `ErrorInfoDetail` * @throws ClassCastException if the instance is not `ErrorInfoDetail` */ + @SuppressWarnings("unchecked") public ErrorInfoDetail getErrorInfoDetail() throws ClassCastException { return (ErrorInfoDetail) super.getActualInstance(); } @@ -255,6 +256,7 @@ public ErrorInfoDetail getErrorInfoDetail() throws ClassCastException { * @return The actual instance of `LocalizedMessageErrorDetail` * @throws ClassCastException if the instance is not `LocalizedMessageErrorDetail` */ + @SuppressWarnings("unchecked") public LocalizedMessageErrorDetail getLocalizedMessageErrorDetail() throws ClassCastException { return (LocalizedMessageErrorDetail) super.getActualInstance(); } @@ -266,6 +268,7 @@ public LocalizedMessageErrorDetail getLocalizedMessageErrorDetail() throws Class * @return The actual instance of `HelpErrorDetail` * @throws ClassCastException if the instance is not `HelpErrorDetail` */ + @SuppressWarnings("unchecked") public HelpErrorDetail getHelpErrorDetail() throws ClassCastException { return (HelpErrorDetail) super.getActualInstance(); } diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/EventCreateResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/EventCreateResponse.java index 01ec61e3..b04cc984 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/EventCreateResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/EventCreateResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** EventCreateResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class EventCreateResponse { public static final String SERIALIZED_NAME_ID = "id"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -229,7 +227,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/GetVolumeIDsResult.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/GetVolumeIDsResult.java index b4646c78..aedba417 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/GetVolumeIDsResult.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/GetVolumeIDsResult.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** GetVolumeIDsResult */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetVolumeIDsResult { public static final String SERIALIZED_NAME_KIND = "kind"; @@ -175,10 +176,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -283,7 +281,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/GetVolumeTemplateResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/GetVolumeTemplateResponse.java index 37015301..3e607504 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/GetVolumeTemplateResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/GetVolumeTemplateResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** GetVolumeTemplateResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetVolumeTemplateResponse { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -274,10 +275,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -390,7 +388,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/HelpErrorDetail.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/HelpErrorDetail.java index 000e33b8..6c8eaf97 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/HelpErrorDetail.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/HelpErrorDetail.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** HelpErrorDetail */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class HelpErrorDetail { public static final String SERIALIZED_NAME_AT_TYPE = "@type"; @@ -193,10 +194,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -296,7 +294,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListAutomationsItem.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListAutomationsItem.java index 0016d810..71a15df5 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListAutomationsItem.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListAutomationsItem.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** ListAutomationsItem */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListAutomationsItem { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -304,10 +305,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -431,7 +429,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListAutomationsResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListAutomationsResponse.java index 3c5e6ea5..ca3640a2 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListAutomationsResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListAutomationsResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** ListAutomationsResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListAutomationsResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -177,10 +178,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -224,21 +222,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - ListAutomationsItem.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + ListAutomationsItem.validateJsonElement(jsonArrayitems.get(i)); + } } - ; if ((jsonObj.get("nextPageToken") != null && !jsonObj.get("nextPageToken").isJsonNull()) && !jsonObj.get("nextPageToken").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -283,7 +280,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListExecutionsItem.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListExecutionsItem.java index 321d1a0d..cc41239d 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListExecutionsItem.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListExecutionsItem.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** ListExecutionsItem */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListExecutionsItem { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -281,10 +282,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -379,7 +377,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListExecutionsResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListExecutionsResponse.java index cf79387a..5f996a28 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListExecutionsResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListExecutionsResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** ListExecutionsResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListExecutionsResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -176,10 +177,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -223,21 +221,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - ListExecutionsItem.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + ListExecutionsItem.validateJsonElement(jsonArrayitems.get(i)); + } } - ; if ((jsonObj.get("nextPageToken") != null && !jsonObj.get("nextPageToken").isJsonNull()) && !jsonObj.get("nextPageToken").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -281,7 +278,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListTemplatesResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListTemplatesResponse.java index bed62ddf..1f068a6a 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListTemplatesResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ListTemplatesResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** ListTemplatesResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListTemplatesResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -176,10 +177,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -223,21 +221,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Template.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Template.validateJsonElement(jsonArrayitems.get(i)); + } } - ; if ((jsonObj.get("nextPageToken") != null && !jsonObj.get("nextPageToken").isJsonNull()) && !jsonObj.get("nextPageToken").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -281,7 +278,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/LocalizedMessageErrorDetail.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/LocalizedMessageErrorDetail.java index 27365b5f..813598db 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/LocalizedMessageErrorDetail.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/LocalizedMessageErrorDetail.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** LocalizedMessageErrorDetail */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class LocalizedMessageErrorDetail { public static final String SERIALIZED_NAME_AT_TYPE = "@type"; @@ -195,10 +196,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -300,7 +298,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/PartialUpdateVolumeAutomationPayload.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/PartialUpdateVolumeAutomationPayload.java index dca6fab0..0c3c14d5 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/PartialUpdateVolumeAutomationPayload.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/PartialUpdateVolumeAutomationPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** PartialUpdateVolumeAutomationPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PartialUpdateVolumeAutomationPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -218,10 +219,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -318,7 +316,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/Schedule.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/Schedule.java index 717ffb71..128461f3 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/Schedule.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/Schedule.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Schedule */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Schedule { public static final String SERIALIZED_NAME_ID = "id"; @@ -162,10 +163,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ScheduleDetails.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ScheduleDetails.java index 17139841..1d46d9bc 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ScheduleDetails.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ScheduleDetails.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ScheduleDetails */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ScheduleDetails { public static final String SERIALIZED_NAME_ID = "id"; @@ -196,10 +197,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -282,7 +280,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SchedulePatchRequest.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SchedulePatchRequest.java index 1411767a..c87e4091 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SchedulePatchRequest.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SchedulePatchRequest.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** SchedulePatchRequest */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SchedulePatchRequest { public static final String SERIALIZED_NAME_NAME = "name"; @@ -197,10 +198,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -283,7 +281,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ScheduleRequest.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ScheduleRequest.java index a785fb54..bf49e339 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ScheduleRequest.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/ScheduleRequest.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ScheduleRequest */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ScheduleRequest { public static final String SERIALIZED_NAME_NAME = "name"; @@ -200,10 +201,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -296,7 +294,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicy.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicy.java index 516e5b66..8bf4bf9d 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicy.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicy.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SnapshotRetentionPolicy extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(SnapshotRetentionPolicy.class.getName()); @@ -220,6 +220,7 @@ public Object getActualInstance() { * @return The actual instance of `SnapshotRetentionPolicyCount` * @throws ClassCastException if the instance is not `SnapshotRetentionPolicyCount` */ + @SuppressWarnings("unchecked") public SnapshotRetentionPolicyCount getSnapshotRetentionPolicyCount() throws ClassCastException { return (SnapshotRetentionPolicyCount) super.getActualInstance(); @@ -232,6 +233,7 @@ public SnapshotRetentionPolicyCount getSnapshotRetentionPolicyCount() * @return The actual instance of `SnapshotRetentionPolicyIndefinitely` * @throws ClassCastException if the instance is not `SnapshotRetentionPolicyIndefinitely` */ + @SuppressWarnings("unchecked") public SnapshotRetentionPolicyIndefinitely getSnapshotRetentionPolicyIndefinitely() throws ClassCastException { return (SnapshotRetentionPolicyIndefinitely) super.getActualInstance(); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicyCount.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicyCount.java index 261d299b..ba5aa96a 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicyCount.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicyCount.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** SnapshotRetentionPolicyCount */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SnapshotRetentionPolicyCount { /** Gets or Sets kind */ @JsonAdapter(KindEnum.Adapter.class) @@ -221,10 +222,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -324,7 +322,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicyIndefinitely.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicyIndefinitely.java index 034a8dad..dfabcd3a 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicyIndefinitely.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/SnapshotRetentionPolicyIndefinitely.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** SnapshotRetentionPolicyIndefinitely */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SnapshotRetentionPolicyIndefinitely { /** Gets or Sets kind */ @JsonAdapter(KindEnum.Adapter.class) @@ -194,10 +195,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -298,7 +296,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/Template.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/Template.java index 81e7277b..88bd1cdc 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/Template.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/Template.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Template */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Template { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -221,10 +222,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -325,7 +323,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeAutomation.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeAutomation.java index 28c30dd2..1ebed16a 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeAutomation.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeAutomation.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** VolumeAutomation */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeAutomation { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -355,10 +356,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -492,7 +490,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeAutomationInput.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeAutomationInput.java index b26fb8f3..4e9f4d28 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeAutomationInput.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeAutomationInput.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeAutomationInput extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(VolumeAutomationInput.class.getName()); @@ -174,6 +174,7 @@ public Object getActualInstance() { * @return The actual instance of `VolumeRecoveryPointManagementInput` * @throws ClassCastException if the instance is not `VolumeRecoveryPointManagementInput` */ + @SuppressWarnings("unchecked") public VolumeRecoveryPointManagementInput getVolumeRecoveryPointManagementInput() throws ClassCastException { return (VolumeRecoveryPointManagementInput) super.getActualInstance(); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionAutomation.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionAutomation.java index c5fb672d..b0dce147 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionAutomation.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionAutomation.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** VolumeExecutionAutomation */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeExecutionAutomation { public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @@ -331,10 +332,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -460,7 +458,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionDetails.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionDetails.java index 756459cc..e94f68e7 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionDetails.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionDetails.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** VolumeExecutionDetails */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeExecutionDetails { public static final String SERIALIZED_NAME_CONFIG = "config"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -254,7 +252,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionOutput.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionOutput.java index 5c572e8c..79bbe952 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionOutput.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionOutput.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** VolumeExecutionOutput */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeExecutionOutput { public static final String SERIALIZED_NAME_STEPS = "steps"; @@ -149,10 +150,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -238,7 +236,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionOutputStep.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionOutputStep.java index 51f6e3cc..b64bf133 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionOutputStep.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionOutputStep.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** VolumeExecutionOutputStep */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeExecutionOutputStep { public static final String SERIALIZED_NAME_MESSAGE = "message"; @@ -276,10 +277,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -387,7 +385,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionResponse.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionResponse.java index 558265d4..75199ce5 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionResponse.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeExecutionResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** VolumeExecutionResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeExecutionResponse { public static final String SERIALIZED_NAME_AUTOMATION = "automation"; @@ -307,10 +308,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -412,7 +410,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutput.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutput.java index ee72d7d7..1ad60601 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutput.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutput.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** VolumeOutput */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeOutput { public static final String SERIALIZED_NAME_STEPS = "steps"; @@ -147,10 +148,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -235,7 +233,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutputStep.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutputStep.java index d21cf414..3b3fc756 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutputStep.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutputStep.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** VolumeOutputStep */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeOutputStep { public static final String SERIALIZED_NAME_NAME = "name"; @@ -164,10 +165,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -257,7 +255,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutputStepResult.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutputStepResult.java index 82c0e304..73ccd3ec 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutputStepResult.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeOutputStepResult.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeOutputStepResult extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(VolumeOutputStepResult.class.getName()); @@ -207,6 +207,7 @@ public Object getActualInstance() { * @return The actual instance of `GetVolumeIDsResult` * @throws ClassCastException if the instance is not `GetVolumeIDsResult` */ + @SuppressWarnings("unchecked") public GetVolumeIDsResult getGetVolumeIDsResult() throws ClassCastException { return (GetVolumeIDsResult) super.getActualInstance(); } @@ -218,6 +219,7 @@ public GetVolumeIDsResult getGetVolumeIDsResult() throws ClassCastException { * @return The actual instance of `CreateSnapshotsResult` * @throws ClassCastException if the instance is not `CreateSnapshotsResult` */ + @SuppressWarnings("unchecked") public CreateSnapshotsResult getCreateSnapshotsResult() throws ClassCastException { return (CreateSnapshotsResult) super.getActualInstance(); } diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeRecoveryPointManagementInput.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeRecoveryPointManagementInput.java index 4aaf8756..b298842d 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeRecoveryPointManagementInput.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeRecoveryPointManagementInput.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** VolumeRecoveryPointManagementInput */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeRecoveryPointManagementInput { public static final String SERIALIZED_NAME_INHERIT_VOLUME_LABELS = "inheritVolumeLabels"; @@ -282,10 +283,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -394,7 +392,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeTemplateAutomationInput.java b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeTemplateAutomationInput.java index 8edc3530..e0126ca5 100644 --- a/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeTemplateAutomationInput.java +++ b/services/automation/src/main/java/cloud/stackit/sdk/automation/v1betaapi/model/VolumeTemplateAutomationInput.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.automation.v1betaapi.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** VolumeTemplateAutomationInput */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeTemplateAutomationInput { /** Gets or Sets kind */ @JsonAdapter(KindEnum.Adapter.class) @@ -194,10 +195,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -288,7 +286,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject());