diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ef370fb..1238fca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## Release (2026-MM-DD) + +- `resourcemanager`: + - [v0.7.0](services/resourcemanager/CHANGELOG.md#v070) + - **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12` + - **Feature:** The `members` attribute in the `CreateProjectPayload` model class is now optional (previously required) and therefore changed from `@javax.annotation.Nonnull` to `@javax.annotation.Nullable` + ## Release (2026-10-16) - `alb`: [v0.7.0](services/alb/CHANGELOG.md#v070) diff --git a/services/resourcemanager/CHANGELOG.md b/services/resourcemanager/CHANGELOG.md index b5ecb406..6243ad59 100644 --- a/services/resourcemanager/CHANGELOG.md +++ b/services/resourcemanager/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.7.0 +- **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12` +- **Feature:** The `members` attribute in the `CreateProjectPayload` model class is now optional (previously required) and therefore changed from `@javax.annotation.Nonnull` to `@javax.annotation.Nullable` + ## v0.6.1 - `v0api`: - Updated javadoc comments regarding labels of model classes diff --git a/services/resourcemanager/VERSION b/services/resourcemanager/VERSION index ee6cdce3..faef31a4 100644 --- a/services/resourcemanager/VERSION +++ b/services/resourcemanager/VERSION @@ -1 +1 @@ -0.6.1 +0.7.0 diff --git a/services/resourcemanager/build.gradle b/services/resourcemanager/build.gradle index 314067c8..aafa5f0b 100644 --- a/services/resourcemanager/build.gradle +++ b/services/resourcemanager/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/resourcemanager/oas_commit b/services/resourcemanager/oas_commit index e227d544..06fd3389 100644 --- a/services/resourcemanager/oas_commit +++ b/services/resourcemanager/oas_commit @@ -1 +1 @@ -7a688091c603097448c818da2fd8386f3b02a6d8 +3d55d58fe8607afa4f894077e1e5c0a19ef57b3f diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/ApiClient.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/ApiClient.java index 946849fb..1e1b93ab 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/ApiClient.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/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.resourcemanager.v0api.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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/JSON.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/JSON.java index 19562416..29ff92e6 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/JSON.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/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.resourcemanager.v0api.model.CreateFolderPayload @@ -349,6 +354,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); } @@ -357,6 +409,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/Pair.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/Pair.java index 5d9fd214..4f2d6ad4 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/Pair.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/Pair.java @@ -12,7 +12,7 @@ package cloud.stackit.sdk.resourcemanager.v0api; -@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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/ServerConfiguration.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/ServerConfiguration.java index db6b2335..a9c06a1f 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/ServerConfiguration.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/ServerVariable.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/ServerVariable.java index 87ac469e..ae054dbc 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/ServerVariable.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/StringUtil.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/StringUtil.java index 59e154b7..3bc75085 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/StringUtil.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/AbstractOpenApiSchema.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/AbstractOpenApiSchema.java index 833bf8df..295bf584 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/AbstractOpenApiSchema.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/CreateFolderPayload.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/CreateFolderPayload.java index 1903ed7d..cadd04b9 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/CreateFolderPayload.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/CreateFolderPayload.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; @@ -34,7 +35,7 @@ import java.util.Set; /** CreateFolderPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateFolderPayload { public static final String SERIALIZED_NAME_CONTAINER_PARENT_ID = "containerParentId"; @@ -67,8 +68,7 @@ public CreateFolderPayload containerParentId( } /** - * Identifier of the parent resource container - containerId as well as UUID identifier is - * supported. + * Identifier of the parent resource container * * @return containerParentId */ @@ -95,8 +95,8 @@ public CreateFolderPayload putLabelsItem(String key, String labelsItem) { } /** - * Key-value string pairs attached to an existing resource container. Certain labels may be - * enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long + * Key-value string pairs attached to a resource container during creation. Certain labels may + * be enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long * (excluding an optional domain prefix). Must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots * (.). May include an optional domain prefix up to 250 characters (a lowercase DNS subdomain @@ -104,8 +104,11 @@ public CreateFolderPayload putLabelsItem(String key, String labelsItem) { * Total maximum key length is 314 characters. * **Value:** Must be 63 characters or less. May * be empty (\"\"). If non-empty, must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots - * (.). > Note: Additional naming restrictions may apply depending on your specific - * organization.* + * (.). * Either a `\"scope\": \"PUBLIC\"` label or a valid + * `networkArea` label must be provided for project creation. * To create a project + * within a STACKIT Network Area, you must set the label `\"networkArea\": + * \"<networkAreaID>\"`. > **Important:** The `networkArea` + * label is immutable and **cannot be changed** after project creation. * * @return labels */ @@ -131,8 +134,7 @@ public CreateFolderPayload addMembersItem(Member membersItem) { } /** - * The initial members assigned to the project. At least one subject needs to be a user, and not - * a client or service account. + * The initial members assigned to the folder. * * @return members */ @@ -150,8 +152,8 @@ public CreateFolderPayload name(@javax.annotation.Nonnull String name) { } /** - * The name of the folder matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( - * ?[a-zA-ZäüöÄÜÖß0-9_+&-]){0,39}$`. + * Folder name matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( + * ?[a-zA-ZäüöÄÜÖß0-9_+&-]){1,40}$`. * * @return name */ @@ -252,10 +254,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; @@ -369,7 +368,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/CreateProjectPayload.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/CreateProjectPayload.java index f7120a1b..d9a56a44 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/CreateProjectPayload.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/CreateProjectPayload.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; @@ -34,7 +35,7 @@ import java.util.Set; /** CreateProjectPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateProjectPayload { public static final String SERIALIZED_NAME_CONTAINER_PARENT_ID = "containerParentId"; @@ -50,8 +51,7 @@ public class CreateProjectPayload { public static final String SERIALIZED_NAME_MEMBERS = "members"; @SerializedName(SERIALIZED_NAME_MEMBERS) - @javax.annotation.Nonnull - private Set members = new LinkedHashSet<>(); + @javax.annotation.Nullable private Set members = new LinkedHashSet<>(); public static final String SERIALIZED_NAME_NAME = "name"; @@ -121,7 +121,7 @@ public void setLabels(@javax.annotation.Nullable Map labels) { this.labels = labels; } - public CreateProjectPayload members(@javax.annotation.Nonnull Set members) { + public CreateProjectPayload members(@javax.annotation.Nullable Set members) { this.members = members; return this; } @@ -140,12 +140,11 @@ public CreateProjectPayload addMembersItem(Member membersItem) { * * @return members */ - @javax.annotation.Nonnull - public Set getMembers() { + @javax.annotation.Nullable public Set getMembers() { return members; } - public void setMembers(@javax.annotation.Nonnull Set members) { + public void setMembers(@javax.annotation.Nullable Set members) { this.members = members; } @@ -156,7 +155,7 @@ public CreateProjectPayload name(@javax.annotation.Nonnull String name) { /** * Project name matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( - * ?[a-zA-ZäüöÄÜÖß0-9_+&-]){0,39}$`. + * ?[a-zA-ZäüöÄÜÖß0-9_+&-]){1,40}$`. * * @return name */ @@ -257,10 +256,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; @@ -273,8 +269,7 @@ private String toIndentedString(Object o) { Arrays.asList("containerParentId", "labels", "members", "name")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = - new HashSet(Arrays.asList("containerParentId", "members", "name")); + openapiRequiredFields = new HashSet(Arrays.asList("containerParentId", "name")); } /** @@ -314,21 +309,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expected the field `containerParentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("containerParentId").toString())); } - // ensure the json data is an array - if (!jsonObj.get("members").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `members` to be an array in the JSON string but got `%s`", - jsonObj.get("members").toString())); - } - - JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); - // validate the required field `members` (array) - for (int i = 0; i < jsonArraymembers.size(); i++) { - Member.validateJsonElement(jsonArraymembers.get(i)); + if (jsonObj.get("members") != null && !jsonObj.get("members").isJsonNull()) { + JsonArray jsonArraymembers = jsonObj.getAsJsonArray("members"); + if (jsonArraymembers != null) { + // ensure the json data is an array + if (!jsonObj.get("members").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `members` to be an array in the JSON string but got `%s`", + jsonObj.get("members").toString())); + } + + // validate the optional field `members` (array) + for (int i = 0; i < jsonArraymembers.size(); i++) { + Member.validateJsonElement(jsonArraymembers.get(i)); + } + ; + } } - ; if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -371,7 +370,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ErrorResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ErrorResponse.java index dfe013f3..61a12cfd 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ErrorResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ErrorResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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.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"; @@ -249,10 +250,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; @@ -355,7 +353,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/FolderResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/FolderResponse.java index 6d95509f..17f6bdce 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/FolderResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/FolderResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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; /** FolderResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class FolderResponse { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; @@ -149,8 +150,8 @@ public FolderResponse putLabelsItem(String key, String labelsItem) { } /** - * Key-value string pairs attached to an existing resource container. Certain labels may be - * enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long + * Key-value string pairs attached to a resource container during creation. Certain labels may + * be enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long * (excluding an optional domain prefix). Must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots * (.). May include an optional domain prefix up to 250 characters (a lowercase DNS subdomain @@ -158,8 +159,11 @@ public FolderResponse putLabelsItem(String key, String labelsItem) { * Total maximum key length is 314 characters. * **Value:** Must be 63 characters or less. May * be empty (\"\"). If non-empty, must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots - * (.). > Note: Additional naming restrictions may apply depending on your specific - * organization.* + * (.). * Either a `\"scope\": \"PUBLIC\"` label or a valid + * `networkArea` label must be provided for project creation. * To create a project + * within a STACKIT Network Area, you must set the label `\"networkArea\": + * \"<networkAreaID>\"`. > **Important:** The `networkArea` + * label is immutable and **cannot be changed** after project creation. * * @return labels */ @@ -327,10 +331,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 +449,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/GetFolderDetailsResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/GetFolderDetailsResponse.java index 5c2f43ca..2c7fea98 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/GetFolderDetailsResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/GetFolderDetailsResponse.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; @@ -35,7 +36,7 @@ import java.util.UUID; /** GetFolderDetailsResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetFolderDetailsResponse { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; @@ -157,8 +158,8 @@ public GetFolderDetailsResponse putLabelsItem(String key, String labelsItem) { } /** - * Key-value string pairs attached to an existing resource container. Certain labels may be - * enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long + * Key-value string pairs attached to a resource container during creation. Certain labels may + * be enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long * (excluding an optional domain prefix). Must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots * (.). May include an optional domain prefix up to 250 characters (a lowercase DNS subdomain @@ -166,8 +167,11 @@ public GetFolderDetailsResponse putLabelsItem(String key, String labelsItem) { * Total maximum key length is 314 characters. * **Value:** Must be 63 characters or less. May * be empty (\"\"). If non-empty, must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots - * (.). > Note: Additional naming restrictions may apply depending on your specific - * organization.* + * (.). * Either a `\"scope\": \"PUBLIC\"` label or a valid + * `networkArea` label must be provided for project creation. * To create a project + * within a STACKIT Network Area, you must set the label `\"networkArea\": + * \"<networkAreaID>\"`. > **Important:** The `networkArea` + * label is immutable and **cannot be changed** after project creation. * * @return labels */ @@ -367,10 +371,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; @@ -510,7 +511,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/GetProjectResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/GetProjectResponse.java index 403aad8e..e9783eae 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/GetProjectResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/GetProjectResponse.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; @@ -35,7 +36,7 @@ import java.util.UUID; /** GetProjectResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetProjectResponse { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; @@ -143,8 +144,8 @@ public GetProjectResponse putLabelsItem(String key, String labelsItem) { } /** - * Key-value string pairs attached to an existing resource container. Certain labels may be - * enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long + * Key-value string pairs attached to a resource container during creation. Certain labels may + * be enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long * (excluding an optional domain prefix). Must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots * (.). May include an optional domain prefix up to 250 characters (a lowercase DNS subdomain @@ -152,8 +153,11 @@ public GetProjectResponse putLabelsItem(String key, String labelsItem) { * Total maximum key length is 314 characters. * **Value:** Must be 63 characters or less. May * be empty (\"\"). If non-empty, must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots - * (.). > Note: Additional naming restrictions may apply depending on your specific - * organization.* + * (.). * Either a `\"scope\": \"PUBLIC\"` label or a valid + * `networkArea` label must be provided for project creation. * To create a project + * within a STACKIT Network Area, you must set the label `\"networkArea\": + * \"<networkAreaID>\"`. > **Important:** The `networkArea` + * label is immutable and **cannot be changed** after project creation. * * @return labels */ @@ -393,10 +397,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; @@ -539,7 +540,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListFoldersResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListFoldersResponse.java index 3abb3e69..37c5bcb2 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListFoldersResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListFoldersResponse.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; @@ -34,7 +35,7 @@ import java.util.Objects; /** ListFoldersResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListFoldersResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -207,10 +208,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,21 +252,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++) { - ListFoldersResponseItemsInner.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++) { + ListFoldersResponseItemsInner.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -304,7 +301,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListFoldersResponseItemsInner.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListFoldersResponseItemsInner.java index 242c5a66..5d83e438 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListFoldersResponseItemsInner.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListFoldersResponseItemsInner.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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; /** ListFoldersResponseItemsInner */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListFoldersResponseItemsInner { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; @@ -151,8 +152,8 @@ public ListFoldersResponseItemsInner putLabelsItem(String key, String labelsItem } /** - * Key-value string pairs attached to an existing resource container. Certain labels may be - * enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long + * Key-value string pairs attached to a resource container during creation. Certain labels may + * be enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long * (excluding an optional domain prefix). Must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots * (.). May include an optional domain prefix up to 250 characters (a lowercase DNS subdomain @@ -160,8 +161,11 @@ public ListFoldersResponseItemsInner putLabelsItem(String key, String labelsItem * Total maximum key length is 314 characters. * **Value:** Must be 63 characters or less. May * be empty (\"\"). If non-empty, must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots - * (.). > Note: Additional naming restrictions may apply depending on your specific - * organization.* + * (.). * Either a `\"scope\": \"PUBLIC\"` label or a valid + * `networkArea` label must be provided for project creation. * To create a project + * within a STACKIT Network Area, you must set the label `\"networkArea\": + * \"<networkAreaID>\"`. > **Important:** The `networkArea` + * label is immutable and **cannot be changed** after project creation. * * @return labels */ @@ -333,10 +337,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; @@ -458,7 +459,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListOrganizationsResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListOrganizationsResponse.java index 7ff554bd..4bf43dd6 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListOrganizationsResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListOrganizationsResponse.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; @@ -34,7 +35,7 @@ import java.util.Objects; /** ListOrganizationsResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListOrganizationsResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -208,10 +209,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,21 +253,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++) { - ListOrganizationsResponseItemsInner.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++) { + ListOrganizationsResponseItemsInner.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -306,7 +303,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListOrganizationsResponseItemsInner.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListOrganizationsResponseItemsInner.java index c05c7b88..f7b41c00 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListOrganizationsResponseItemsInner.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListOrganizationsResponseItemsInner.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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; /** ListOrganizationsResponseItemsInner */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListOrganizationsResponseItemsInner { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; @@ -133,8 +134,8 @@ public ListOrganizationsResponseItemsInner putLabelsItem(String key, String labe } /** - * Key-value string pairs attached to an existing resource container. Certain labels may be - * enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long + * Key-value string pairs attached to a resource container during creation. Certain labels may + * be enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long * (excluding an optional domain prefix). Must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots * (.). May include an optional domain prefix up to 250 characters (a lowercase DNS subdomain @@ -142,8 +143,11 @@ public ListOrganizationsResponseItemsInner putLabelsItem(String key, String labe * Total maximum key length is 314 characters. * **Value:** Must be 63 characters or less. May * be empty (\"\"). If non-empty, must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots - * (.). > Note: Additional naming restrictions may apply depending on your specific - * organization.* + * (.). * Either a `\"scope\": \"PUBLIC\"` label or a valid + * `networkArea` label must be provided for project creation. * To create a project + * within a STACKIT Network Area, you must set the label `\"networkArea\": + * \"<networkAreaID>\"`. > **Important:** The `networkArea` + * label is immutable and **cannot be changed** after project creation. * * @return labels */ @@ -339,10 +343,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; @@ -465,7 +466,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListProjectsResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListProjectsResponse.java index ab584366..e56400f0 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListProjectsResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ListProjectsResponse.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; @@ -34,7 +35,7 @@ import java.util.Objects; /** ListProjectsResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListProjectsResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -206,10 +207,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,21 +251,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++) { - Project.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++) { + Project.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -303,7 +300,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Member.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Member.java index 9cf0af4e..6068075a 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Member.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Member.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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; /** Member */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Member { public static final String SERIALIZED_NAME_ROLE = "role"; @@ -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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/OrganizationResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/OrganizationResponse.java index 443202cb..2e25b34f 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/OrganizationResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/OrganizationResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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; /** OrganizationResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class OrganizationResponse { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; @@ -131,8 +132,8 @@ public OrganizationResponse putLabelsItem(String key, String labelsItem) { } /** - * Key-value string pairs attached to an existing resource container. Certain labels may be - * enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long + * Key-value string pairs attached to a resource container during creation. Certain labels may + * be enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long * (excluding an optional domain prefix). Must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots * (.). May include an optional domain prefix up to 250 characters (a lowercase DNS subdomain @@ -140,8 +141,11 @@ public OrganizationResponse putLabelsItem(String key, String labelsItem) { * Total maximum key length is 314 characters. * **Value:** Must be 63 characters or less. May * be empty (\"\"). If non-empty, must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots - * (.). > Note: Additional naming restrictions may apply depending on your specific - * organization.* + * (.). * Either a `\"scope\": \"PUBLIC\"` label or a valid + * `networkArea` label must be provided for project creation. * To create a project + * within a STACKIT Network Area, you must set the label `\"networkArea\": + * \"<networkAreaID>\"`. > **Important:** The `networkArea` + * label is immutable and **cannot be changed** after project creation. * * @return labels */ @@ -330,10 +334,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; @@ -452,7 +453,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Parent.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Parent.java index f091bbd1..24caa85f 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Parent.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Parent.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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; /** Parent container. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Parent { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; @@ -248,10 +249,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; @@ -352,7 +350,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ParentListInner.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ParentListInner.java index 32748504..a541bd0c 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ParentListInner.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/ParentListInner.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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; /** ParentListInner */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ParentListInner { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; @@ -328,10 +329,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; @@ -466,7 +464,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateFolderPayload.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateFolderPayload.java index 7e5ceec1..bff85492 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateFolderPayload.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateFolderPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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; /** PartialUpdateFolderPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PartialUpdateFolderPayload { public static final String SERIALIZED_NAME_CONTAINER_PARENT_ID = "containerParentId"; @@ -95,8 +96,8 @@ public PartialUpdateFolderPayload putLabelsItem(String key, String labelsItem) { * followed by a slash (/). Total maximum key length is 314 characters. * **Value:** Must be 63 * characters or less. May be empty (\"\"). If non-empty, must start and end with an * alphanumeric character `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), - * underscores (_), and dots (.). > Note: Additional naming restrictions may apply depending - * on your specific organization.* + * underscores (_), and dots (.). Can be set to null to delete the label. > Note: Additional + * naming restrictions may apply depending on your specific organization.* * * @return labels */ @@ -115,7 +116,7 @@ public PartialUpdateFolderPayload name(@javax.annotation.Nullable String name) { /** * New name for the resource container matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( - * ?[a-zA-ZäüöÄÜÖß0-9_+&-]){0,39}$`. + * ?[a-zA-ZäüöÄÜÖß0-9_+&-]){1,40}$`. * * @return name */ @@ -213,10 +214,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; @@ -301,7 +299,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateOrganizationPayload.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateOrganizationPayload.java index 147f0e68..ec9b2f9a 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateOrganizationPayload.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateOrganizationPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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; /** PartialUpdateOrganizationPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PartialUpdateOrganizationPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -70,8 +71,8 @@ public PartialUpdateOrganizationPayload putLabelsItem(String key, String labelsI * followed by a slash (/). Total maximum key length is 314 characters. * **Value:** Must be 63 * characters or less. May be empty (\"\"). If non-empty, must start and end with an * alphanumeric character `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), - * underscores (_), and dots (.). > Note: Additional naming restrictions may apply depending - * on your specific organization.* + * underscores (_), and dots (.). Can be set to null to delete the label. > Note: Additional + * naming restrictions may apply depending on your specific organization.* * * @return labels */ @@ -90,7 +91,7 @@ public PartialUpdateOrganizationPayload name(@javax.annotation.Nullable String n /** * The new name of the organization matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( - * ?[a-zA-ZäüöÄÜÖß0-9_+&-]){0,39}$`. + * ?[a-zA-ZäüöÄÜÖß0-9_+&-]){1,40}$`. * * @return name */ @@ -186,10 +187,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; @@ -267,7 +265,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateProjectPayload.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateProjectPayload.java index 6e765d80..0371a4a3 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateProjectPayload.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/PartialUpdateProjectPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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; /** PartialUpdateProjectPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PartialUpdateProjectPayload { public static final String SERIALIZED_NAME_CONTAINER_PARENT_ID = "containerParentId"; @@ -95,8 +96,8 @@ public PartialUpdateProjectPayload putLabelsItem(String key, String labelsItem) * followed by a slash (/). Total maximum key length is 314 characters. * **Value:** Must be 63 * characters or less. May be empty (\"\"). If non-empty, must start and end with an * alphanumeric character `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), - * underscores (_), and dots (.). > Note: Additional naming restrictions may apply depending - * on your specific organization.* + * underscores (_), and dots (.). Can be set to null to delete the label. > Note: Additional + * naming restrictions may apply depending on your specific organization.* * * @return labels */ @@ -115,7 +116,7 @@ public PartialUpdateProjectPayload name(@javax.annotation.Nullable String name) /** * New name for the resource container matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( - * ?[a-zA-ZäüöÄÜÖß0-9_+&-]){0,39}$`. + * ?[a-zA-ZäüöÄÜÖß0-9_+&-]){1,40}$`. * * @return name */ @@ -214,10 +215,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; @@ -303,7 +301,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/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Project.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Project.java index 75788b15..21820175 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Project.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/v0api/model/Project.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.resourcemanager.v0api.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; /** Project */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Project { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; @@ -136,8 +137,8 @@ public Project putLabelsItem(String key, String labelsItem) { } /** - * Key-value string pairs attached to an existing resource container. Certain labels may be - * enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long + * Key-value string pairs attached to a resource container during creation. Certain labels may + * be enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long * (excluding an optional domain prefix). Must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots * (.). May include an optional domain prefix up to 250 characters (a lowercase DNS subdomain @@ -145,8 +146,11 @@ public Project putLabelsItem(String key, String labelsItem) { * Total maximum key length is 314 characters. * **Value:** Must be 63 characters or less. May * be empty (\"\"). If non-empty, must start and end with an alphanumeric character * `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots - * (.). > Note: Additional naming restrictions may apply depending on your specific - * organization.* + * (.). * Either a `\"scope\": \"PUBLIC\"` label or a valid + * `networkArea` label must be provided for project creation. * To create a project + * within a STACKIT Network Area, you must set the label `\"networkArea\": + * \"<networkAreaID>\"`. > **Important:** The `networkArea` + * label is immutable and **cannot be changed** after project creation. * * @return labels */ @@ -355,10 +359,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; @@ -480,7 +481,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());