From 00722e9a984af37f322fd4367186d178d9301b98 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 29 Oct 2026 08:05:33 +0000 Subject: [PATCH 1/2] Generate serverupdate --- services/serverupdate/build.gradle | 2 +- services/serverupdate/oas_commit | 2 +- .../sdk/serverupdate/v1api/ApiClient.java | 51 +++++++++++++++++ .../stackit/sdk/serverupdate/v1api/JSON.java | 56 +++++++++++++++++++ .../stackit/sdk/serverupdate/v1api/Pair.java | 2 +- .../v1api/ServerConfiguration.java | 2 +- .../serverupdate/v1api/ServerVariable.java | 2 +- .../sdk/serverupdate/v1api/StringUtil.java | 2 +- .../v1api/model/AbstractOpenApiSchema.java | 7 +-- .../v1api/model/CreateUpdatePayload.java | 12 ++-- .../model/CreateUpdateSchedulePayload.java | 12 ++-- .../v1api/model/EnableServicePayload.java | 12 ++-- .../model/EnableServiceResourcePayload.java | 12 ++-- .../model/GetUpdatePoliciesResponse.java | 12 ++-- .../model/GetUpdateSchedulesResponse.java | 12 ++-- .../v1api/model/GetUpdateServiceResponse.java | 12 ++-- .../v1api/model/GetUpdatesListResponse.java | 12 ++-- .../sdk/serverupdate/v1api/model/Update.java | 12 ++-- .../v1api/model/UpdatePolicy.java | 12 ++-- .../v1api/model/UpdateSchedule.java | 12 ++-- .../model/UpdateScheduleCreateRequest.java | 12 ++-- .../model/UpdateUpdateSchedulePayload.java | 12 ++-- .../sdk/serverupdate/v2api/ApiClient.java | 51 +++++++++++++++++ .../stackit/sdk/serverupdate/v2api/JSON.java | 56 +++++++++++++++++++ .../stackit/sdk/serverupdate/v2api/Pair.java | 2 +- .../v2api/ServerConfiguration.java | 2 +- .../serverupdate/v2api/ServerVariable.java | 2 +- .../sdk/serverupdate/v2api/StringUtil.java | 2 +- .../v2api/model/AbstractOpenApiSchema.java | 7 +-- .../v2api/model/CreateUpdatePayload.java | 12 ++-- .../model/CreateUpdateSchedulePayload.java | 12 ++-- .../model/EnableServiceResourcePayload.java | 12 ++-- .../v2api/model/ErrorResponse.java | 12 ++-- .../model/GetUpdatePoliciesResponse.java | 12 ++-- .../model/GetUpdateSchedulesResponse.java | 12 ++-- .../v2api/model/GetUpdateServiceResponse.java | 12 ++-- .../v2api/model/GetUpdatesListResponse.java | 12 ++-- .../sdk/serverupdate/v2api/model/Update.java | 12 ++-- .../v2api/model/UpdatePolicy.java | 12 ++-- .../v2api/model/UpdateSchedule.java | 12 ++-- .../model/UpdateScheduleCreateRequest.java | 12 ++-- .../model/UpdateUpdateSchedulePayload.java | 12 ++-- 42 files changed, 384 insertions(+), 176 deletions(-) diff --git a/services/serverupdate/build.gradle b/services/serverupdate/build.gradle index 314067c8..aafa5f0b 100644 --- a/services/serverupdate/build.gradle +++ b/services/serverupdate/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/serverupdate/oas_commit b/services/serverupdate/oas_commit index da1ca1ca..ed3614a2 100644 --- a/services/serverupdate/oas_commit +++ b/services/serverupdate/oas_commit @@ -1 +1 @@ -602a933a8a6cc22c52171febbca7ceaf63bc7538 +6c5332d5f71263507049f2f2ef036fe07937b63a diff --git a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/ApiClient.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/ApiClient.java index 420a2694..41ae04b1 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/ApiClient.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/ApiClient.java @@ -398,6 +398,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.serverupdate.v1api.ApiClient} object + */ + public ApiClient setLocalDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateTimeFormat(dateFormat); + return this; + } + /** * Set LenientOnJson. * @@ -598,6 +609,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/JSON.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/JSON.java index 0e0c7674..f575efe2 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/JSON.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/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.serverupdate.v1api.model.CreateUpdatePayload @@ -330,6 +335,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); } @@ -338,6 +390,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/Pair.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/Pair.java index c7d58922..21e53f7a 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/Pair.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/Pair.java @@ -12,7 +12,7 @@ package cloud.stackit.sdk.serverupdate.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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/ServerConfiguration.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/ServerConfiguration.java index a84f1df2..03bc416d 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/ServerConfiguration.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/ServerVariable.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/ServerVariable.java index 999378c5..3dde2e4c 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/ServerVariable.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/StringUtil.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/StringUtil.java index 0dc0b1ab..d7a35fa2 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/StringUtil.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/AbstractOpenApiSchema.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/AbstractOpenApiSchema.java index c192b0c8..bfc8784c 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/AbstractOpenApiSchema.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/CreateUpdatePayload.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/CreateUpdatePayload.java index 270b9628..0ff7d8e5 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/CreateUpdatePayload.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/CreateUpdatePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.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; /** CreateUpdatePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateUpdatePayload { public static final String SERIALIZED_NAME_BACKUP_BEFORE_UPDATE = "backupBeforeUpdate"; @@ -172,10 +173,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; @@ -255,7 +253,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/CreateUpdateSchedulePayload.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/CreateUpdateSchedulePayload.java index 6a64a0f2..cbe31d42 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/CreateUpdateSchedulePayload.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/CreateUpdateSchedulePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.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; /** CreateUpdateSchedulePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateUpdateSchedulePayload { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @@ -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; @@ -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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/EnableServicePayload.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/EnableServicePayload.java index 177e8856..cb116918 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/EnableServicePayload.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/EnableServicePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.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.UUID; /** EnableServicePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class EnableServicePayload { public static final String SERIALIZED_NAME_UPDATE_POLICY_ID = "updatePolicyId"; @@ -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; @@ -217,7 +215,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/EnableServiceResourcePayload.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/EnableServiceResourcePayload.java index 7ffc7519..18d6870a 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/EnableServiceResourcePayload.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/EnableServiceResourcePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.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.UUID; /** EnableServiceResourcePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class EnableServiceResourcePayload { public static final String SERIALIZED_NAME_UPDATE_POLICY_ID = "updatePolicyId"; @@ -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; @@ -223,7 +221,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdatePoliciesResponse.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdatePoliciesResponse.java index 5963993a..1216ed75 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdatePoliciesResponse.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdatePoliciesResponse.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; /** GetUpdatePoliciesResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetUpdatePoliciesResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -148,10 +149,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdateSchedulesResponse.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdateSchedulesResponse.java index 021bc314..0b9b5e58 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdateSchedulesResponse.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdateSchedulesResponse.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; /** GetUpdateSchedulesResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetUpdateSchedulesResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -148,10 +149,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdateServiceResponse.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdateServiceResponse.java index dffa067d..cb726377 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdateServiceResponse.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdateServiceResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.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; /** GetUpdateServiceResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetUpdateServiceResponse { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @@ -138,10 +139,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; @@ -209,7 +207,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdatesListResponse.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdatesListResponse.java index d8dca9ac..42a55614 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdatesListResponse.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/GetUpdatesListResponse.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; /** GetUpdatesListResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetUpdatesListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -148,10 +149,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; @@ -237,7 +235,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/Update.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/Update.java index 6492fa82..e4140ac0 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/Update.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/Update.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.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; /** Update */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Update { public static final String SERIALIZED_NAME_END_DATE = "endDate"; @@ -301,10 +302,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; @@ -421,7 +419,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdatePolicy.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdatePolicy.java index 4d7ba53e..5affbd5f 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdatePolicy.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdatePolicy.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.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; /** UpdatePolicy */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdatePolicy { public static final String SERIALIZED_NAME_DEFAULT = "default"; @@ -300,10 +301,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; @@ -410,7 +408,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateSchedule.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateSchedule.java index 768bfa71..d782742e 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateSchedule.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateSchedule.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.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; /** UpdateSchedule */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateSchedule { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @@ -252,10 +253,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; @@ -351,7 +349,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateScheduleCreateRequest.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateScheduleCreateRequest.java index d6885a0d..1f3e30b8 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateScheduleCreateRequest.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateScheduleCreateRequest.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.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; /** UpdateScheduleCreateRequest */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateScheduleCreateRequest { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @@ -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; @@ -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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateUpdateSchedulePayload.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateUpdateSchedulePayload.java index 97b9a7b8..5916f81e 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateUpdateSchedulePayload.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v1api/model/UpdateUpdateSchedulePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.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; /** UpdateUpdateSchedulePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateUpdateSchedulePayload { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @@ -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; @@ -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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/ApiClient.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/ApiClient.java index eaa6f652..84d29ec7 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/ApiClient.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/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.serverupdate.v2api.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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/JSON.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/JSON.java index 856468c1..717f8e62 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/JSON.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/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.serverupdate.v2api.model.CreateUpdatePayload @@ -330,6 +335,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); } @@ -338,6 +390,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/Pair.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/Pair.java index 9fac091c..f166e01a 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/Pair.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/Pair.java @@ -12,7 +12,7 @@ package cloud.stackit.sdk.serverupdate.v2api; -@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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/ServerConfiguration.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/ServerConfiguration.java index 151c3694..e628bd3c 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/ServerConfiguration.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/ServerVariable.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/ServerVariable.java index 210777f3..25f77c18 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/ServerVariable.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/StringUtil.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/StringUtil.java index 55d1d4c3..d5f18d4c 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/StringUtil.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/AbstractOpenApiSchema.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/AbstractOpenApiSchema.java index 8ab2536a..b4a0197b 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/AbstractOpenApiSchema.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/CreateUpdatePayload.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/CreateUpdatePayload.java index a5364a7b..4260aeba 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/CreateUpdatePayload.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/CreateUpdatePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.v2api.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; /** CreateUpdatePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateUpdatePayload { public static final String SERIALIZED_NAME_BACKUP_BEFORE_UPDATE = "backupBeforeUpdate"; @@ -172,10 +173,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; @@ -255,7 +253,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/CreateUpdateSchedulePayload.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/CreateUpdateSchedulePayload.java index cf5aa39c..6604bbbb 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/CreateUpdateSchedulePayload.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/CreateUpdateSchedulePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.v2api.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; /** CreateUpdateSchedulePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateUpdateSchedulePayload { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @@ -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; @@ -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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/EnableServiceResourcePayload.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/EnableServiceResourcePayload.java index a0edcf60..b9cd0082 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/EnableServiceResourcePayload.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/EnableServiceResourcePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.v2api.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; /** EnableServiceResourcePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class EnableServiceResourcePayload { public static final String SERIALIZED_NAME_UPDATE_POLICY_ID = "updatePolicyId"; @@ -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; @@ -223,7 +221,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/ErrorResponse.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/ErrorResponse.java index b9255f1d..1a7122af 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/ErrorResponse.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/ErrorResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.v2api.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_MESSAGE = "message"; @@ -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; @@ -261,7 +259,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdatePoliciesResponse.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdatePoliciesResponse.java index 2af1d3a5..286b3a0b 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdatePoliciesResponse.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdatePoliciesResponse.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; /** GetUpdatePoliciesResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetUpdatePoliciesResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -148,10 +149,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdateSchedulesResponse.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdateSchedulesResponse.java index f92db8e4..223a6608 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdateSchedulesResponse.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdateSchedulesResponse.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; /** GetUpdateSchedulesResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetUpdateSchedulesResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -148,10 +149,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdateServiceResponse.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdateServiceResponse.java index 81cce6f2..4c4c6181 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdateServiceResponse.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdateServiceResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.v2api.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; /** GetUpdateServiceResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetUpdateServiceResponse { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @@ -138,10 +139,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; @@ -209,7 +207,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdatesListResponse.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdatesListResponse.java index f2569da5..79be57aa 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdatesListResponse.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/GetUpdatesListResponse.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; /** GetUpdatesListResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetUpdatesListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -148,10 +149,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; @@ -237,7 +235,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/Update.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/Update.java index 42233c42..7f540036 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/Update.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/Update.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.v2api.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; /** Update */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Update { public static final String SERIALIZED_NAME_END_DATE = "endDate"; @@ -301,10 +302,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; @@ -421,7 +419,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdatePolicy.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdatePolicy.java index e70a9a45..75512bbd 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdatePolicy.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdatePolicy.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.v2api.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; /** UpdatePolicy */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdatePolicy { public static final String SERIALIZED_NAME_DEFAULT = "default"; @@ -300,10 +301,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; @@ -410,7 +408,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateSchedule.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateSchedule.java index 2dffa9d6..08f7d891 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateSchedule.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateSchedule.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.v2api.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; /** UpdateSchedule */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateSchedule { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @@ -252,10 +253,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; @@ -351,7 +349,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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateScheduleCreateRequest.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateScheduleCreateRequest.java index 91e64897..6411d49e 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateScheduleCreateRequest.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateScheduleCreateRequest.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.v2api.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; /** UpdateScheduleCreateRequest */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateScheduleCreateRequest { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @@ -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; @@ -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/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateUpdateSchedulePayload.java b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateUpdateSchedulePayload.java index 8ccf4622..f11c0408 100644 --- a/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateUpdateSchedulePayload.java +++ b/services/serverupdate/src/main/java/cloud/stackit/sdk/serverupdate/v2api/model/UpdateUpdateSchedulePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.serverupdate.v2api.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; /** UpdateUpdateSchedulePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateUpdateSchedulePayload { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @@ -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; @@ -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()); From a4dfb568194e761e08c62987f1d6c3a1319a77a2 Mon Sep 17 00:00:00 2001 From: Marcel Jacek <72880145+marceljk@users.noreply.github.com> Date: Thu, 29 Oct 2026 10:47:00 +0100 Subject: [PATCH 2/2] add changelog entry --- CHANGELOG.md | 3 +++ services/serverupdate/CHANGELOG.md | 3 +++ services/serverupdate/VERSION | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecf351c0..12ee2103 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ - `serverbackup`: - [v0.2.1](services/serverbackup/CHANGELOG.md#v021) - **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12` +- `serverupdate`: + - [v0.2.2](services/serverupdate/CHANGELOG.md#v022) + - **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12` - `resourcemanager`: - [v0.7.0](services/resourcemanager/CHANGELOG.md#v070) - **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12` diff --git a/services/serverupdate/CHANGELOG.md b/services/serverupdate/CHANGELOG.md index 7cd54b4a..b52dfb63 100644 --- a/services/serverupdate/CHANGELOG.md +++ b/services/serverupdate/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.2.2 +- **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12` + ## v0.2.1 - `v1api`: **Docs:** Extend the description of the attributes `rrule` and `maintenanceWindow` diff --git a/services/serverupdate/VERSION b/services/serverupdate/VERSION index 0c62199f..ee1372d3 100644 --- a/services/serverupdate/VERSION +++ b/services/serverupdate/VERSION @@ -1 +1 @@ -0.2.1 +0.2.2