diff --git a/services/objectstorage/build.gradle b/services/objectstorage/build.gradle index 314067c8..aafa5f0b 100644 --- a/services/objectstorage/build.gradle +++ b/services/objectstorage/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/objectstorage/oas_commit b/services/objectstorage/oas_commit index cdd59cce..cdc3a7c3 100644 --- a/services/objectstorage/oas_commit +++ b/services/objectstorage/oas_commit @@ -1 +1 @@ -404d55ddc0cbde39bb4bbc0a3792ea8a56cc58fa +c2afb47c530277ab9289d3d54cc32a606a28fd4b diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiCallback.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiCallback.java index 11907dd7..d1997268 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiCallback.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiCallback.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiClient.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiClient.java index 2f35bec9..84390195 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiClient.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiClient.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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.objectstorage.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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiResponse.java index 0e3cec48..829da6b4 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/GzipRequestInterceptor.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/GzipRequestInterceptor.java index 470ded7e..6780997d 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/GzipRequestInterceptor.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/GzipRequestInterceptor.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/JSON.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/JSON.java index e66e5543..4ea82a41 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/JSON.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/JSON.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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.objectstorage.v1api.model.AccessKey @@ -175,6 +180,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.v1api.model.SetDefaultRetentionPayload .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.objectstorage.v1api.model.UpdateServicePayload + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.v1api.model.ValidationError .CustomTypeAdapterFactory()); @@ -375,6 +383,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); } @@ -383,6 +438,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/Pair.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/Pair.java index 917aba06..1ac93e29 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/Pair.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/Pair.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -12,7 +12,7 @@ package cloud.stackit.sdk.objectstorage.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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ProgressRequestBody.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ProgressRequestBody.java index 8310cf14..2b2bbab8 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ProgressRequestBody.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ProgressRequestBody.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ProgressResponseBody.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ProgressResponseBody.java index 61c71ba7..2e2f8958 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ProgressResponseBody.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ProgressResponseBody.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ServerConfiguration.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ServerConfiguration.java index 3aa1934f..68458ac9 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ServerConfiguration.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ServerConfiguration.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ServerVariable.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ServerVariable.java index 1b80d835..bffed826 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ServerVariable.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ServerVariable.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/StringUtil.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/StringUtil.java index 193c0fc0..c61e3cde 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/StringUtil.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/StringUtil.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/api/DefaultApi.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/api/DefaultApi.java index f9c62808..bac7a948 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/api/DefaultApi.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/api/DefaultApi.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -36,6 +36,7 @@ import cloud.stackit.sdk.objectstorage.v1api.model.ListCredentialsGroupsResponse; import cloud.stackit.sdk.objectstorage.v1api.model.ProjectStatus; import cloud.stackit.sdk.objectstorage.v1api.model.SetDefaultRetentionPayload; +import cloud.stackit.sdk.objectstorage.v1api.model.UpdateServicePayload; import com.google.gson.reflect.TypeToken; import java.io.IOException; import java.lang.reflect.Type; @@ -3939,4 +3940,203 @@ public okhttp3.Call setDefaultRetentionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + + /** + * Build call for updateService + * + * @param projectId STACKIT project ID (required) + * @param updateServicePayload (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Successful Response -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Validation Error -
429 Too Many Requests -
500 Internal Server Error -
+ */ + public okhttp3.Call updateServiceCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull UpdateServicePayload updateServicePayload, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateServicePayload; + + // create path and map variables + String localVarPath = + "/v1/project/{projectId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateServiceValidateBeforeCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull UpdateServicePayload updateServicePayload, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + "Missing the required parameter 'projectId' when calling updateService(Async)"); + } + + // verify the required parameter 'updateServicePayload' is set + if (updateServicePayload == null) { + throw new ApiException( + "Missing the required parameter 'updateServicePayload' when calling updateService(Async)"); + } + + return updateServiceCall(projectId, updateServicePayload, _callback); + } + + /** + * Update Project Update project details. + * + * @param projectId STACKIT project ID (required) + * @param updateServicePayload (required) + * @return ProjectStatus + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Successful Response -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Validation Error -
429 Too Many Requests -
500 Internal Server Error -
+ */ + public ProjectStatus updateService( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull UpdateServicePayload updateServicePayload) + throws ApiException { + ApiResponse localVarResp = + updateServiceWithHttpInfo(projectId, updateServicePayload); + return localVarResp.getData(); + } + + /** + * Update Project Update project details. + * + * @param projectId STACKIT project ID (required) + * @param updateServicePayload (required) + * @return ApiResponse<ProjectStatus> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Successful Response -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Validation Error -
429 Too Many Requests -
500 Internal Server Error -
+ */ + public ApiResponse updateServiceWithHttpInfo( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull UpdateServicePayload updateServicePayload) + throws ApiException { + okhttp3.Call localVarCall = + updateServiceValidateBeforeCall(projectId, updateServicePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Project (asynchronously) Update project details. + * + * @param projectId STACKIT project ID (required) + * @param updateServicePayload (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Successful Response -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Validation Error -
429 Too Many Requests -
500 Internal Server Error -
+ */ + public okhttp3.Call updateServiceAsync( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull UpdateServicePayload updateServicePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateServiceValidateBeforeCall(projectId, updateServicePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/api/ObjectStorageApi.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/api/ObjectStorageApi.java index 6df2f4df..0e99bb72 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/api/ObjectStorageApi.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/api/ObjectStorageApi.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/AbstractOpenApiSchema.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/AbstractOpenApiSchema.java index ea3a0a70..cdb47c15 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/AbstractOpenApiSchema.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/AbstractOpenApiSchema.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/AccessKey.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/AccessKey.java index 0995fb04..91ceeb6c 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/AccessKey.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/AccessKey.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** AccessKey */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AccessKey { public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; @@ -191,10 +192,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; @@ -295,7 +293,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/Bucket.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/Bucket.java index d321340c..5a02e714 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/Bucket.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/Bucket.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** Bucket */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Bucket { public static final String SERIALIZED_NAME_NAME = "name"; @@ -257,10 +258,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; @@ -380,7 +378,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ComplianceLockResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ComplianceLockResponse.java index 3e5c85c7..bfab4e4c 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ComplianceLockResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ComplianceLockResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** ComplianceLockResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ComplianceLockResponse { public static final String SERIALIZED_NAME_MAX_RETENTION_DAYS = "maxRetentionDays"; @@ -168,10 +169,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -257,7 +255,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateAccessKeyPayload.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateAccessKeyPayload.java index 8c85dc73..9edd66c0 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateAccessKeyPayload.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateAccessKeyPayload.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** CreateAccessKeyPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateAccessKeyPayload { public static final String SERIALIZED_NAME_EXPIRES = "expires"; @@ -156,10 +157,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -226,7 +224,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateAccessKeyResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateAccessKeyResponse.java index 990e74e6..33165fdd 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateAccessKeyResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateAccessKeyResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CreateAccessKeyResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateAccessKeyResponse { public static final String SERIALIZED_NAME_ACCESS_KEY = "accessKey"; @@ -281,10 +282,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -423,7 +421,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateBucketResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateBucketResponse.java index 5c2def5c..ca01584d 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateBucketResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateBucketResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CreateBucketResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateBucketResponse { public static final String SERIALIZED_NAME_BUCKET = "bucket"; @@ -167,10 +168,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; @@ -263,7 +261,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateCredentialsGroupPayload.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateCredentialsGroupPayload.java index 8be2a98b..cdcdac8e 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateCredentialsGroupPayload.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateCredentialsGroupPayload.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CreateCredentialsGroupPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateCredentialsGroupPayload { public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; @@ -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; @@ -234,7 +232,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateCredentialsGroupResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateCredentialsGroupResponse.java index 4d84136d..ff43ede7 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateCredentialsGroupResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CreateCredentialsGroupResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CreateCredentialsGroupResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateCredentialsGroupResponse { public static final String SERIALIZED_NAME_CREDENTIALS_GROUP = "credentialsGroup"; @@ -171,10 +172,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; @@ -265,7 +263,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CredentialsGroup.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CredentialsGroup.java index 184557e7..99b84194 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CredentialsGroup.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CredentialsGroup.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CredentialsGroup */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CredentialsGroup { public static final String SERIALIZED_NAME_CREDENTIALS_GROUP_ID = "credentialsGroupId"; @@ -196,10 +197,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CredentialsGroupExtended.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CredentialsGroupExtended.java index 2b524856..83c34486 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CredentialsGroupExtended.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/CredentialsGroupExtended.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CredentialsGroupExtended */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CredentialsGroupExtended { public static final String SERIALIZED_NAME_CREDENTIALS_GROUP_ID = "credentialsGroupId"; @@ -224,10 +225,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; @@ -339,7 +337,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DefaultRetentionResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DefaultRetentionResponse.java index bf23525a..ae71dc89 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DefaultRetentionResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DefaultRetentionResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DefaultRetentionResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DefaultRetentionResponse { public static final String SERIALIZED_NAME_BUCKET = "bucket"; @@ -221,10 +222,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -321,7 +319,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteAccessKeyResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteAccessKeyResponse.java index 15632e99..6936d825 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteAccessKeyResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteAccessKeyResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DeleteAccessKeyResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DeleteAccessKeyResponse { public static final String SERIALIZED_NAME_KEY_ID = "keyId"; @@ -167,10 +168,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; @@ -264,7 +262,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteBucketResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteBucketResponse.java index 9635c275..65bdfaaa 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteBucketResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteBucketResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DeleteBucketResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DeleteBucketResponse { public static final String SERIALIZED_NAME_BUCKET = "bucket"; @@ -167,10 +168,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; @@ -263,7 +261,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteCredentialsGroupResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteCredentialsGroupResponse.java index 8e8cb1a6..2cd8e47b 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteCredentialsGroupResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteCredentialsGroupResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DeleteCredentialsGroupResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DeleteCredentialsGroupResponse { public static final String SERIALIZED_NAME_CREDENTIALS_GROUP_ID = "credentialsGroupId"; @@ -173,10 +174,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; @@ -272,7 +270,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteDefaultRetentionResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteDefaultRetentionResponse.java index 167e2a9b..3875d16c 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteDefaultRetentionResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DeleteDefaultRetentionResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DeleteDefaultRetentionResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DeleteDefaultRetentionResponse { public static final String SERIALIZED_NAME_BUCKET = "bucket"; @@ -169,10 +170,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; @@ -268,7 +266,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DetailedError.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DetailedError.java index fc30b45a..23bf8f3f 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DetailedError.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/DetailedError.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DetailedError */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DetailedError { public static final String SERIALIZED_NAME_KEY = "key"; @@ -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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ErrorMessage.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ErrorMessage.java index 18e83068..a2058850 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ErrorMessage.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ErrorMessage.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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; /** ErrorMessage */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ErrorMessage { public static final String SERIALIZED_NAME_DETAIL = "detail"; @@ -149,10 +150,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -196,21 +194,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("detail").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `detail` to be an array in the JSON string but got `%s`", - jsonObj.get("detail").toString())); - } - - JsonArray jsonArraydetail = jsonObj.getAsJsonArray("detail"); - // validate the required field `detail` (array) - for (int i = 0; i < jsonArraydetail.size(); i++) { - DetailedError.validateJsonElement(jsonArraydetail.get(i)); + if (jsonObj.get("detail") != null) { + if (!jsonObj.get("detail").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `detail` to be an array in the JSON string but got `%s`", + jsonObj.get("detail").toString())); + } + JsonArray jsonArraydetail = jsonObj.getAsJsonArray("detail"); + // validate the required field `detail` (array) + for (int i = 0; i < jsonArraydetail.size(); i++) { + DetailedError.validateJsonElement(jsonArraydetail.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -245,7 +242,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/GetBucketResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/GetBucketResponse.java index 18054929..0b53d799 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/GetBucketResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/GetBucketResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** GetBucketResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetBucketResponse { public static final String SERIALIZED_NAME_BUCKET = "bucket"; @@ -167,10 +168,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; @@ -258,7 +256,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/GetCredentialsGroupResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/GetCredentialsGroupResponse.java index c5ac57ec..32af4ceb 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/GetCredentialsGroupResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/GetCredentialsGroupResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** GetCredentialsGroupResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetCredentialsGroupResponse { public static final String SERIALIZED_NAME_CREDENTIALS_GROUP = "credentialsGroup"; @@ -170,10 +171,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; @@ -263,7 +261,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/HTTPValidationError.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/HTTPValidationError.java index f9d4cb74..ff9af9ee 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/HTTPValidationError.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/HTTPValidationError.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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; /** HTTPValidationError */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class HTTPValidationError { public static final String SERIALIZED_NAME_DETAIL = "detail"; @@ -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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListAccessKeysResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListAccessKeysResponse.java index 8df06548..dbd36299 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListAccessKeysResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListAccessKeysResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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; /** ListAccessKeysResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListAccessKeysResponse { public static final String SERIALIZED_NAME_ACCESS_KEYS = "accessKeys"; @@ -177,10 +178,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -224,21 +222,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("accessKeys").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `accessKeys` to be an array in the JSON string but got `%s`", - jsonObj.get("accessKeys").toString())); - } - - JsonArray jsonArrayaccessKeys = jsonObj.getAsJsonArray("accessKeys"); - // validate the required field `accessKeys` (array) - for (int i = 0; i < jsonArrayaccessKeys.size(); i++) { - AccessKey.validateJsonElement(jsonArrayaccessKeys.get(i)); + if (jsonObj.get("accessKeys") != null) { + if (!jsonObj.get("accessKeys").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `accessKeys` to be an array in the JSON string but got `%s`", + jsonObj.get("accessKeys").toString())); + } + JsonArray jsonArrayaccessKeys = jsonObj.getAsJsonArray("accessKeys"); + // validate the required field `accessKeys` (array) + for (int i = 0; i < jsonArrayaccessKeys.size(); i++) { + AccessKey.validateJsonElement(jsonArrayaccessKeys.get(i)); + } } - ; if (!jsonObj.get("project").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -281,7 +278,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListBucketsResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListBucketsResponse.java index 6f3cadfb..6ea1ce5a 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListBucketsResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListBucketsResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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; /** ListBucketsResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListBucketsResponse { public static final String SERIALIZED_NAME_BUCKETS = "buckets"; @@ -177,10 +178,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -224,21 +222,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("buckets").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `buckets` to be an array in the JSON string but got `%s`", - jsonObj.get("buckets").toString())); - } - - JsonArray jsonArraybuckets = jsonObj.getAsJsonArray("buckets"); - // validate the required field `buckets` (array) - for (int i = 0; i < jsonArraybuckets.size(); i++) { - Bucket.validateJsonElement(jsonArraybuckets.get(i)); + if (jsonObj.get("buckets") != null) { + if (!jsonObj.get("buckets").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `buckets` to be an array in the JSON string but got `%s`", + jsonObj.get("buckets").toString())); + } + JsonArray jsonArraybuckets = jsonObj.getAsJsonArray("buckets"); + // validate the required field `buckets` (array) + for (int i = 0; i < jsonArraybuckets.size(); i++) { + Bucket.validateJsonElement(jsonArraybuckets.get(i)); + } } - ; if (!jsonObj.get("project").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -281,7 +278,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListCredentialsGroupsResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListCredentialsGroupsResponse.java index a4f19afc..69aee6cf 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListCredentialsGroupsResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ListCredentialsGroupsResponse.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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; /** ListCredentialsGroupsResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListCredentialsGroupsResponse { public static final String SERIALIZED_NAME_CREDENTIALS_GROUPS = "credentialsGroups"; @@ -185,10 +186,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; @@ -233,21 +231,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("credentialsGroups").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `credentialsGroups` to be an array in the JSON string but got `%s`", - jsonObj.get("credentialsGroups").toString())); - } - - JsonArray jsonArraycredentialsGroups = jsonObj.getAsJsonArray("credentialsGroups"); - // validate the required field `credentialsGroups` (array) - for (int i = 0; i < jsonArraycredentialsGroups.size(); i++) { - CredentialsGroup.validateJsonElement(jsonArraycredentialsGroups.get(i)); + if (jsonObj.get("credentialsGroups") != null) { + if (!jsonObj.get("credentialsGroups").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `credentialsGroups` to be an array in the JSON string but got `%s`", + jsonObj.get("credentialsGroups").toString())); + } + JsonArray jsonArraycredentialsGroups = jsonObj.getAsJsonArray("credentialsGroups"); + // validate the required field `credentialsGroups` (array) + for (int i = 0; i < jsonArraycredentialsGroups.size(); i++) { + CredentialsGroup.validateJsonElement(jsonArraycredentialsGroups.get(i)); + } } - ; if (!jsonObj.get("project").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -292,7 +289,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/LocationInner.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/LocationInner.java index 96635ca0..0256e4db 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/LocationInner.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/LocationInner.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -28,7 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class LocationInner extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(LocationInner.class.getName()); diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ProjectScope.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ProjectScope.java index 27f08c9f..406f2301 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ProjectScope.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ProjectScope.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ProjectStatus.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ProjectStatus.java index ee9b09dd..40705575 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ProjectStatus.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ProjectStatus.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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,8 +32,13 @@ import java.util.Objects; /** ProjectStatus */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ProjectStatus { + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Map labels = new HashMap<>(); + public static final String SERIALIZED_NAME_PROJECT = "project"; @SerializedName(SERIALIZED_NAME_PROJECT) @@ -47,6 +53,32 @@ public class ProjectStatus { public ProjectStatus() {} + public ProjectStatus labels(@javax.annotation.Nullable Map labels) { + this.labels = labels; + return this; + } + + public ProjectStatus putLabelsItem(String key, String labelsItem) { + if (this.labels == null) { + this.labels = new HashMap<>(); + } + this.labels.put(key, labelsItem); + return this; + } + + /** + * Project labels + * + * @return labels + */ + @javax.annotation.Nullable public Map getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Map labels) { + this.labels = labels; + } + public ProjectStatus project(@javax.annotation.Nonnull String project) { this.project = project; return this; @@ -138,20 +170,22 @@ public boolean equals(Object o) { return false; } ProjectStatus projectStatus = (ProjectStatus) o; - return Objects.equals(this.project, projectStatus.project) + return Objects.equals(this.labels, projectStatus.labels) + && Objects.equals(this.project, projectStatus.project) && Objects.equals(this.scope, projectStatus.scope) && Objects.equals(this.additionalProperties, projectStatus.additionalProperties); } @Override public int hashCode() { - return Objects.hash(project, scope, additionalProperties); + return Objects.hash(labels, project, scope, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProjectStatus {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" project: ").append(toIndentedString(project)).append("\n"); sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); sb.append(" additionalProperties: ") @@ -166,10 +200,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; @@ -177,7 +208,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("project", "scope")); + openapiFields = new HashSet(Arrays.asList("labels", "project", "scope")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("project", "scope")); @@ -256,7 +287,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/RateLimitError.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/RateLimitError.java index 4ff1bb7d..455d658b 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/RateLimitError.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/RateLimitError.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** RateLimitError */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RateLimitError { public static final String SERIALIZED_NAME_ERROR = "error"; @@ -238,10 +239,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; @@ -333,7 +331,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/RetentionMode.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/RetentionMode.java index f2c62612..8d7b0733 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/RetentionMode.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/RetentionMode.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/SetDefaultRetentionPayload.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/SetDefaultRetentionPayload.java index cf9ade62..546fe21c 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/SetDefaultRetentionPayload.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/SetDefaultRetentionPayload.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** SetDefaultRetentionPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SetDefaultRetentionPayload { public static final String SERIALIZED_NAME_DAYS = "days"; @@ -167,10 +168,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; @@ -252,7 +250,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/UpdateServicePayload.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/UpdateServicePayload.java new file mode 100644 index 00000000..98f1d61f --- /dev/null +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/UpdateServicePayload.java @@ -0,0 +1,307 @@ +/* + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 + * + * The version of the OpenAPI document: 1.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package cloud.stackit.sdk.objectstorage.v1api.model; + +import cloud.stackit.sdk.objectstorage.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; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** UpdateServicePayload */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") +public class UpdateServicePayload { + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nonnull + private Map labels = new HashMap<>(); + + public UpdateServicePayload() {} + + public UpdateServicePayload labels(@javax.annotation.Nonnull Map labels) { + this.labels = labels; + return this; + } + + public UpdateServicePayload putLabelsItem(String key, String labelsItem) { + if (this.labels == null) { + this.labels = new HashMap<>(); + } + this.labels.put(key, labelsItem); + return this; + } + + /** + * Project labels + * + * @return labels + */ + @javax.annotation.Nonnull + public Map getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nonnull Map labels) { + this.labels = labels; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateServicePayload instance itself + */ + public UpdateServicePayload putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateServicePayload updateServicePayload = (UpdateServicePayload) o; + return Objects.equals(this.labels, updateServicePayload.labels) + && Objects.equals( + this.additionalProperties, updateServicePayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(labels, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateServicePayload {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("labels")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("labels")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateServicePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateServicePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The required field(s) %s in UpdateServicePayload is not found in the empty JSON string", + UpdateServicePayload.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateServicePayload.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The required field `%s` is not found in the JSON string: %s", + requiredField, + jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateServicePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateServicePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateServicePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateServicePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : + value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty( + entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateServicePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateServicePayload instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty( + entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty( + entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty( + entry.getKey(), + entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The field `%s` has unknown primitive type. Value: %s", + entry.getKey(), + entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty( + entry.getKey(), + gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty( + entry.getKey(), + gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateServicePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateServicePayload + * @throws IOException if the JSON string is invalid with respect to UpdateServicePayload + */ + public static UpdateServicePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateServicePayload.class); + } + + /** + * Convert an instance of UpdateServicePayload to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ValidationError.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ValidationError.java index a6509378..4f0f4aaf 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ValidationError.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/model/ValidationError.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * @@ -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; /** ValidationError */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ValidationError { public static final String SERIALIZED_NAME_LOC = "loc"; @@ -203,10 +204,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; @@ -250,21 +248,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("loc").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `loc` to be an array in the JSON string but got `%s`", - jsonObj.get("loc").toString())); - } - - JsonArray jsonArrayloc = jsonObj.getAsJsonArray("loc"); - // validate the required field `loc` (array) - for (int i = 0; i < jsonArrayloc.size(); i++) { - LocationInner.validateJsonElement(jsonArrayloc.get(i)); + if (jsonObj.get("loc") != null) { + if (!jsonObj.get("loc").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `loc` to be an array in the JSON string but got `%s`", + jsonObj.get("loc").toString())); + } + JsonArray jsonArrayloc = jsonObj.getAsJsonArray("loc"); + // validate the required field `loc` (array) + for (int i = 0; i < jsonArrayloc.size(); i++) { + LocationInner.validateJsonElement(jsonArrayloc.get(i)); + } } - ; if (!jsonObj.get("msg").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -314,7 +311,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/ApiClient.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/ApiClient.java index 535ffa7d..57779c96 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/ApiClient.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/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.objectstorage.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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/JSON.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/JSON.java index 6e02fb0d..e3188dfd 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/JSON.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/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.objectstorage.v2api.model.AccessKey @@ -175,6 +180,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.v2api.model.SetDefaultRetentionPayload .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.objectstorage.v2api.model.UpdateServicePayload + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.v2api.model.ValidationError .CustomTypeAdapterFactory()); @@ -375,6 +383,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); } @@ -383,6 +438,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/Pair.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/Pair.java index 498fa9d3..a8d04093 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/Pair.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/Pair.java @@ -12,7 +12,7 @@ package cloud.stackit.sdk.objectstorage.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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/ServerConfiguration.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/ServerConfiguration.java index c48d62b7..f0cb5c21 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/ServerConfiguration.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/ServerVariable.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/ServerVariable.java index 84d52e54..e01482e5 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/ServerVariable.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/StringUtil.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/StringUtil.java index 27c9e42f..c9739d0d 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/StringUtil.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/api/DefaultApi.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/api/DefaultApi.java index 3557ecfb..8d5470d4 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/api/DefaultApi.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/api/DefaultApi.java @@ -36,6 +36,7 @@ import cloud.stackit.sdk.objectstorage.v2api.model.ListCredentialsGroupsResponse; import cloud.stackit.sdk.objectstorage.v2api.model.ProjectStatus; import cloud.stackit.sdk.objectstorage.v2api.model.SetDefaultRetentionPayload; +import cloud.stackit.sdk.objectstorage.v2api.model.UpdateServicePayload; import com.google.gson.reflect.TypeToken; import java.io.IOException; import java.lang.reflect.Type; @@ -4350,4 +4351,221 @@ public okhttp3.Call setDefaultRetentionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + + /** + * Build call for updateService + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param updateServicePayload (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Successful Response -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Validation Error -
429 Too Many Requests -
500 Internal Server Error -
+ */ + public okhttp3.Call updateServiceCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UpdateServicePayload updateServicePayload, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateServicePayload; + + // create path and map variables + String localVarPath = + "/v2/project/{projectId}/regions/{region}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateServiceValidateBeforeCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UpdateServicePayload updateServicePayload, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + "Missing the required parameter 'projectId' when calling updateService(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateService(Async)"); + } + + // verify the required parameter 'updateServicePayload' is set + if (updateServicePayload == null) { + throw new ApiException( + "Missing the required parameter 'updateServicePayload' when calling updateService(Async)"); + } + + return updateServiceCall(projectId, region, updateServicePayload, _callback); + } + + /** + * Update Project Update project details. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param updateServicePayload (required) + * @return ProjectStatus + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Successful Response -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Validation Error -
429 Too Many Requests -
500 Internal Server Error -
+ */ + public ProjectStatus updateService( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UpdateServicePayload updateServicePayload) + throws ApiException { + ApiResponse localVarResp = + updateServiceWithHttpInfo(projectId, region, updateServicePayload); + return localVarResp.getData(); + } + + /** + * Update Project Update project details. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param updateServicePayload (required) + * @return ApiResponse<ProjectStatus> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Successful Response -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Validation Error -
429 Too Many Requests -
500 Internal Server Error -
+ */ + public ApiResponse updateServiceWithHttpInfo( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UpdateServicePayload updateServicePayload) + throws ApiException { + okhttp3.Call localVarCall = + updateServiceValidateBeforeCall(projectId, region, updateServicePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Project (asynchronously) Update project details. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param updateServicePayload (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Successful Response -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Validation Error -
429 Too Many Requests -
500 Internal Server Error -
+ */ + public okhttp3.Call updateServiceAsync( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UpdateServicePayload updateServicePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateServiceValidateBeforeCall(projectId, region, updateServicePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/AbstractOpenApiSchema.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/AbstractOpenApiSchema.java index 86375bdf..1b939852 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/AbstractOpenApiSchema.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/AccessKey.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/AccessKey.java index 43d5287f..15747b18 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/AccessKey.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/AccessKey.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** AccessKey */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AccessKey { public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; @@ -191,10 +192,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; @@ -295,7 +293,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/Bucket.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/Bucket.java index f3a84846..62382f1c 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/Bucket.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/Bucket.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** Bucket */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Bucket { public static final String SERIALIZED_NAME_NAME = "name"; @@ -257,10 +258,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; @@ -380,7 +378,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ComplianceLockResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ComplianceLockResponse.java index d6f8fb7b..c86b6b9d 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ComplianceLockResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ComplianceLockResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** ComplianceLockResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ComplianceLockResponse { public static final String SERIALIZED_NAME_MAX_RETENTION_DAYS = "maxRetentionDays"; @@ -168,10 +169,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -257,7 +255,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateAccessKeyPayload.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateAccessKeyPayload.java index 61a61d83..f0d32139 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateAccessKeyPayload.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateAccessKeyPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; @@ -33,7 +34,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** CreateAccessKeyPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateAccessKeyPayload { public static final String SERIALIZED_NAME_EXPIRES = "expires"; @@ -156,10 +157,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -226,7 +224,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateAccessKeyResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateAccessKeyResponse.java index b8753230..cda3de23 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateAccessKeyResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateAccessKeyResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CreateAccessKeyResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateAccessKeyResponse { public static final String SERIALIZED_NAME_ACCESS_KEY = "accessKey"; @@ -281,10 +282,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -423,7 +421,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateBucketResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateBucketResponse.java index 5302b7e6..56296e52 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateBucketResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateBucketResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CreateBucketResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateBucketResponse { public static final String SERIALIZED_NAME_BUCKET = "bucket"; @@ -167,10 +168,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; @@ -263,7 +261,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateCredentialsGroupPayload.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateCredentialsGroupPayload.java index 53eb0feb..57c12ea5 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateCredentialsGroupPayload.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateCredentialsGroupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CreateCredentialsGroupPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateCredentialsGroupPayload { public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; @@ -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; @@ -234,7 +232,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateCredentialsGroupResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateCredentialsGroupResponse.java index adfa324b..4a6d8fcb 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateCredentialsGroupResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CreateCredentialsGroupResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CreateCredentialsGroupResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateCredentialsGroupResponse { public static final String SERIALIZED_NAME_CREDENTIALS_GROUP = "credentialsGroup"; @@ -171,10 +172,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; @@ -265,7 +263,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CredentialsGroup.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CredentialsGroup.java index 17f4824b..649e4c8d 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CredentialsGroup.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CredentialsGroup.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CredentialsGroup */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CredentialsGroup { public static final String SERIALIZED_NAME_CREDENTIALS_GROUP_ID = "credentialsGroupId"; @@ -196,10 +197,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CredentialsGroupExtended.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CredentialsGroupExtended.java index ceea7b43..a321099a 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CredentialsGroupExtended.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/CredentialsGroupExtended.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** CredentialsGroupExtended */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CredentialsGroupExtended { public static final String SERIALIZED_NAME_CREDENTIALS_GROUP_ID = "credentialsGroupId"; @@ -224,10 +225,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; @@ -339,7 +337,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DefaultRetentionResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DefaultRetentionResponse.java index 57232de5..6e6f029b 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DefaultRetentionResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DefaultRetentionResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DefaultRetentionResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DefaultRetentionResponse { public static final String SERIALIZED_NAME_BUCKET = "bucket"; @@ -221,10 +222,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -321,7 +319,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteAccessKeyResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteAccessKeyResponse.java index de6be75f..037d1622 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteAccessKeyResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteAccessKeyResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DeleteAccessKeyResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DeleteAccessKeyResponse { public static final String SERIALIZED_NAME_KEY_ID = "keyId"; @@ -167,10 +168,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; @@ -264,7 +262,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteBucketResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteBucketResponse.java index 52fbc313..5699f489 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteBucketResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteBucketResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DeleteBucketResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DeleteBucketResponse { public static final String SERIALIZED_NAME_BUCKET = "bucket"; @@ -167,10 +168,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; @@ -263,7 +261,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteCredentialsGroupResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteCredentialsGroupResponse.java index e960572b..86be0f50 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteCredentialsGroupResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteCredentialsGroupResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DeleteCredentialsGroupResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DeleteCredentialsGroupResponse { public static final String SERIALIZED_NAME_CREDENTIALS_GROUP_ID = "credentialsGroupId"; @@ -173,10 +174,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; @@ -272,7 +270,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteDefaultRetentionResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteDefaultRetentionResponse.java index c1fd7df2..db26e5e4 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteDefaultRetentionResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DeleteDefaultRetentionResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DeleteDefaultRetentionResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DeleteDefaultRetentionResponse { public static final String SERIALIZED_NAME_BUCKET = "bucket"; @@ -169,10 +170,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; @@ -268,7 +266,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DetailedError.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DetailedError.java index c994eae4..7a55bdcb 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DetailedError.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/DetailedError.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** DetailedError */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DetailedError { public static final String SERIALIZED_NAME_KEY = "key"; @@ -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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ErrorMessage.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ErrorMessage.java index 305d4b22..c2997c78 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ErrorMessage.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ErrorMessage.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; /** ErrorMessage */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ErrorMessage { public static final String SERIALIZED_NAME_DETAIL = "detail"; @@ -149,10 +150,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -196,21 +194,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("detail").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `detail` to be an array in the JSON string but got `%s`", - jsonObj.get("detail").toString())); - } - - JsonArray jsonArraydetail = jsonObj.getAsJsonArray("detail"); - // validate the required field `detail` (array) - for (int i = 0; i < jsonArraydetail.size(); i++) { - DetailedError.validateJsonElement(jsonArraydetail.get(i)); + if (jsonObj.get("detail") != null) { + if (!jsonObj.get("detail").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `detail` to be an array in the JSON string but got `%s`", + jsonObj.get("detail").toString())); + } + JsonArray jsonArraydetail = jsonObj.getAsJsonArray("detail"); + // validate the required field `detail` (array) + for (int i = 0; i < jsonArraydetail.size(); i++) { + DetailedError.validateJsonElement(jsonArraydetail.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -245,7 +242,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/GetBucketResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/GetBucketResponse.java index bde21a9a..0303ffda 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/GetBucketResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/GetBucketResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** GetBucketResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetBucketResponse { public static final String SERIALIZED_NAME_BUCKET = "bucket"; @@ -167,10 +168,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; @@ -258,7 +256,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/GetCredentialsGroupResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/GetCredentialsGroupResponse.java index 94a8c286..19305e2a 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/GetCredentialsGroupResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/GetCredentialsGroupResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** GetCredentialsGroupResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetCredentialsGroupResponse { public static final String SERIALIZED_NAME_CREDENTIALS_GROUP = "credentialsGroup"; @@ -170,10 +171,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; @@ -263,7 +261,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/HTTPValidationError.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/HTTPValidationError.java index f7efd35c..8841b91b 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/HTTPValidationError.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/HTTPValidationError.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; /** HTTPValidationError */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class HTTPValidationError { public static final String SERIALIZED_NAME_DETAIL = "detail"; @@ -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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListAccessKeysResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListAccessKeysResponse.java index cf7df8e6..e27f1138 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListAccessKeysResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListAccessKeysResponse.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; /** ListAccessKeysResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListAccessKeysResponse { public static final String SERIALIZED_NAME_ACCESS_KEYS = "accessKeys"; @@ -177,10 +178,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -224,21 +222,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("accessKeys").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `accessKeys` to be an array in the JSON string but got `%s`", - jsonObj.get("accessKeys").toString())); - } - - JsonArray jsonArrayaccessKeys = jsonObj.getAsJsonArray("accessKeys"); - // validate the required field `accessKeys` (array) - for (int i = 0; i < jsonArrayaccessKeys.size(); i++) { - AccessKey.validateJsonElement(jsonArrayaccessKeys.get(i)); + if (jsonObj.get("accessKeys") != null) { + if (!jsonObj.get("accessKeys").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `accessKeys` to be an array in the JSON string but got `%s`", + jsonObj.get("accessKeys").toString())); + } + JsonArray jsonArrayaccessKeys = jsonObj.getAsJsonArray("accessKeys"); + // validate the required field `accessKeys` (array) + for (int i = 0; i < jsonArrayaccessKeys.size(); i++) { + AccessKey.validateJsonElement(jsonArrayaccessKeys.get(i)); + } } - ; if (!jsonObj.get("project").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -281,7 +278,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListBucketsResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListBucketsResponse.java index 96beaab1..9448663c 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListBucketsResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListBucketsResponse.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; /** ListBucketsResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListBucketsResponse { public static final String SERIALIZED_NAME_BUCKETS = "buckets"; @@ -177,10 +178,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -224,21 +222,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("buckets").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `buckets` to be an array in the JSON string but got `%s`", - jsonObj.get("buckets").toString())); - } - - JsonArray jsonArraybuckets = jsonObj.getAsJsonArray("buckets"); - // validate the required field `buckets` (array) - for (int i = 0; i < jsonArraybuckets.size(); i++) { - Bucket.validateJsonElement(jsonArraybuckets.get(i)); + if (jsonObj.get("buckets") != null) { + if (!jsonObj.get("buckets").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `buckets` to be an array in the JSON string but got `%s`", + jsonObj.get("buckets").toString())); + } + JsonArray jsonArraybuckets = jsonObj.getAsJsonArray("buckets"); + // validate the required field `buckets` (array) + for (int i = 0; i < jsonArraybuckets.size(); i++) { + Bucket.validateJsonElement(jsonArraybuckets.get(i)); + } } - ; if (!jsonObj.get("project").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -281,7 +278,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListCredentialsGroupsResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListCredentialsGroupsResponse.java index 3b1d649e..65e28792 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListCredentialsGroupsResponse.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ListCredentialsGroupsResponse.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; /** ListCredentialsGroupsResponse */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ListCredentialsGroupsResponse { public static final String SERIALIZED_NAME_CREDENTIALS_GROUPS = "credentialsGroups"; @@ -185,10 +186,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; @@ -233,21 +231,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("credentialsGroups").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `credentialsGroups` to be an array in the JSON string but got `%s`", - jsonObj.get("credentialsGroups").toString())); - } - - JsonArray jsonArraycredentialsGroups = jsonObj.getAsJsonArray("credentialsGroups"); - // validate the required field `credentialsGroups` (array) - for (int i = 0; i < jsonArraycredentialsGroups.size(); i++) { - CredentialsGroup.validateJsonElement(jsonArraycredentialsGroups.get(i)); + if (jsonObj.get("credentialsGroups") != null) { + if (!jsonObj.get("credentialsGroups").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `credentialsGroups` to be an array in the JSON string but got `%s`", + jsonObj.get("credentialsGroups").toString())); + } + JsonArray jsonArraycredentialsGroups = jsonObj.getAsJsonArray("credentialsGroups"); + // validate the required field `credentialsGroups` (array) + for (int i = 0; i < jsonArraycredentialsGroups.size(); i++) { + CredentialsGroup.validateJsonElement(jsonArraycredentialsGroups.get(i)); + } } - ; if (!jsonObj.get("project").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -292,7 +289,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/LocationInner.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/LocationInner.java index 90e23751..ded53b54 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/LocationInner.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/LocationInner.java @@ -28,7 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class LocationInner extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(LocationInner.class.getName()); diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ProjectStatus.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ProjectStatus.java index 7c5a2b44..0752cb9f 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ProjectStatus.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ProjectStatus.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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,8 +32,13 @@ import java.util.Objects; /** ProjectStatus */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ProjectStatus { + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Map labels = new HashMap<>(); + public static final String SERIALIZED_NAME_PROJECT = "project"; @SerializedName(SERIALIZED_NAME_PROJECT) @@ -47,6 +53,32 @@ public class ProjectStatus { public ProjectStatus() {} + public ProjectStatus labels(@javax.annotation.Nullable Map labels) { + this.labels = labels; + return this; + } + + public ProjectStatus putLabelsItem(String key, String labelsItem) { + if (this.labels == null) { + this.labels = new HashMap<>(); + } + this.labels.put(key, labelsItem); + return this; + } + + /** + * Project labels + * + * @return labels + */ + @javax.annotation.Nullable public Map getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Map labels) { + this.labels = labels; + } + public ProjectStatus project(@javax.annotation.Nonnull String project) { this.project = project; return this; @@ -138,20 +170,22 @@ public boolean equals(Object o) { return false; } ProjectStatus projectStatus = (ProjectStatus) o; - return Objects.equals(this.project, projectStatus.project) + return Objects.equals(this.labels, projectStatus.labels) + && Objects.equals(this.project, projectStatus.project) && Objects.equals(this.scope, projectStatus.scope) && Objects.equals(this.additionalProperties, projectStatus.additionalProperties); } @Override public int hashCode() { - return Objects.hash(project, scope, additionalProperties); + return Objects.hash(labels, project, scope, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProjectStatus {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" project: ").append(toIndentedString(project)).append("\n"); sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); sb.append(" additionalProperties: ") @@ -166,10 +200,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; @@ -177,7 +208,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("project", "scope")); + openapiFields = new HashSet(Arrays.asList("labels", "project", "scope")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("project", "scope")); @@ -256,7 +287,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/RateLimitError.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/RateLimitError.java index 10bfeb5f..ac86e8c6 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/RateLimitError.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/RateLimitError.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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.Objects; /** RateLimitError */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RateLimitError { public static final String SERIALIZED_NAME_ERROR = "error"; @@ -238,10 +239,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; @@ -333,7 +331,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/SetDefaultRetentionPayload.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/SetDefaultRetentionPayload.java index 47fdec96..e0734a70 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/SetDefaultRetentionPayload.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/SetDefaultRetentionPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.objectstorage.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; /** SetDefaultRetentionPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SetDefaultRetentionPayload { public static final String SERIALIZED_NAME_DAYS = "days"; @@ -167,10 +168,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; @@ -252,7 +250,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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/UpdateServicePayload.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/UpdateServicePayload.java new file mode 100644 index 00000000..612e1862 --- /dev/null +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/UpdateServicePayload.java @@ -0,0 +1,307 @@ +/* + * STACKIT Object Storage API + * STACKIT API to manage the Object Storage + * + * The version of the OpenAPI document: 2.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package cloud.stackit.sdk.objectstorage.v2api.model; + +import cloud.stackit.sdk.objectstorage.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; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** UpdateServicePayload */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") +public class UpdateServicePayload { + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nonnull + private Map labels = new HashMap<>(); + + public UpdateServicePayload() {} + + public UpdateServicePayload labels(@javax.annotation.Nonnull Map labels) { + this.labels = labels; + return this; + } + + public UpdateServicePayload putLabelsItem(String key, String labelsItem) { + if (this.labels == null) { + this.labels = new HashMap<>(); + } + this.labels.put(key, labelsItem); + return this; + } + + /** + * Project labels + * + * @return labels + */ + @javax.annotation.Nonnull + public Map getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nonnull Map labels) { + this.labels = labels; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateServicePayload instance itself + */ + public UpdateServicePayload putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateServicePayload updateServicePayload = (UpdateServicePayload) o; + return Objects.equals(this.labels, updateServicePayload.labels) + && Objects.equals( + this.additionalProperties, updateServicePayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(labels, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateServicePayload {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("labels")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("labels")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateServicePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateServicePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The required field(s) %s in UpdateServicePayload is not found in the empty JSON string", + UpdateServicePayload.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateServicePayload.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The required field `%s` is not found in the JSON string: %s", + requiredField, + jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateServicePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateServicePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateServicePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateServicePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : + value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty( + entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateServicePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateServicePayload instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty( + entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty( + entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty( + entry.getKey(), + entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The field `%s` has unknown primitive type. Value: %s", + entry.getKey(), + entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty( + entry.getKey(), + gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty( + entry.getKey(), + gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateServicePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateServicePayload + * @throws IOException if the JSON string is invalid with respect to UpdateServicePayload + */ + public static UpdateServicePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateServicePayload.class); + } + + /** + * Convert an instance of UpdateServicePayload to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ValidationError.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ValidationError.java index 7ec5495a..56654627 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ValidationError.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v2api/model/ValidationError.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; /** ValidationError */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ValidationError { public static final String SERIALIZED_NAME_LOC = "loc"; @@ -203,10 +204,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; @@ -250,21 +248,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("loc").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `loc` to be an array in the JSON string but got `%s`", - jsonObj.get("loc").toString())); - } - - JsonArray jsonArrayloc = jsonObj.getAsJsonArray("loc"); - // validate the required field `loc` (array) - for (int i = 0; i < jsonArrayloc.size(); i++) { - LocationInner.validateJsonElement(jsonArrayloc.get(i)); + if (jsonObj.get("loc") != null) { + if (!jsonObj.get("loc").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `loc` to be an array in the JSON string but got `%s`", + jsonObj.get("loc").toString())); + } + JsonArray jsonArrayloc = jsonObj.getAsJsonArray("loc"); + // validate the required field `loc` (array) + for (int i = 0; i < jsonArrayloc.size(); i++) { + LocationInner.validateJsonElement(jsonArrayloc.get(i)); + } } - ; if (!jsonObj.get("msg").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -314,7 +311,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/objectstorage/src/test/java/cloud/stackit/sdk/objectstorage/v1api/api/DefaultApiTest.java b/services/objectstorage/src/test/java/cloud/stackit/sdk/objectstorage/v1api/api/DefaultApiTest.java index 3c110263..3e54efd8 100644 --- a/services/objectstorage/src/test/java/cloud/stackit/sdk/objectstorage/v1api/api/DefaultApiTest.java +++ b/services/objectstorage/src/test/java/cloud/stackit/sdk/objectstorage/v1api/api/DefaultApiTest.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 * diff --git a/services/objectstorage/src/test/java/cloud/stackit/sdk/objectstorage/v1api/api/ObjectStorageApiTest.java b/services/objectstorage/src/test/java/cloud/stackit/sdk/objectstorage/v1api/api/ObjectStorageApiTest.java index 5d26b744..2f14bc33 100644 --- a/services/objectstorage/src/test/java/cloud/stackit/sdk/objectstorage/v1api/api/ObjectStorageApiTest.java +++ b/services/objectstorage/src/test/java/cloud/stackit/sdk/objectstorage/v1api/api/ObjectStorageApiTest.java @@ -1,6 +1,6 @@ /* - * STACKIT Object Storage API - * STACKIT API to manage the Object Storage + * [DEPRECATED] STACKIT Object Storage API + * ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2 * * The version of the OpenAPI document: 1.1.0 *