From 9686b66aede2d9793f4d815ad17d81c80a8e5e4d Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 24 Mar 2026 10:07:34 +0000 Subject: [PATCH] Generate objectstorage --- services/objectstorage/oas_commit | 2 +- .../cloud/stackit/sdk/objectstorage/JSON.java | 20 + .../sdk/objectstorage/api/DefaultApi.java | 1802 +++++++++++++++-- .../sdk/objectstorage/model/Bucket.java | 50 +- .../model/ComplianceLockResponse.java | 336 +++ .../model/CredentialsGroupExtended.java | 418 ++++ .../model/DefaultRetentionResponse.java | 402 ++++ .../model/DeleteDefaultRetentionResponse.java | 350 ++++ .../model/GetCredentialsGroupResponse.java | 343 ++++ .../objectstorage/model/RetentionMode.java | 256 +++ .../model/SetDefaultRetentionPayload.java | 333 +++ 11 files changed, 4129 insertions(+), 183 deletions(-) create mode 100644 services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/ComplianceLockResponse.java create mode 100644 services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/CredentialsGroupExtended.java create mode 100644 services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/DefaultRetentionResponse.java create mode 100644 services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/DeleteDefaultRetentionResponse.java create mode 100644 services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/GetCredentialsGroupResponse.java create mode 100644 services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/RetentionMode.java create mode 100644 services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/SetDefaultRetentionPayload.java diff --git a/services/objectstorage/oas_commit b/services/objectstorage/oas_commit index 6694ae65..dacd3323 100644 --- a/services/objectstorage/oas_commit +++ b/services/objectstorage/oas_commit @@ -1 +1 @@ -29ed135519d2a7b1b043cd0c8243bb8d423a784b +9076cbf51de99a26e19e782377877382f549a123 diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/JSON.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/JSON.java index b843958d..cfff1467 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/JSON.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/JSON.java @@ -99,6 +99,9 @@ private static Class getClassByDiscriminator( new cloud.stackit.sdk.objectstorage.model.AccessKey.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.model.Bucket.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.objectstorage.model.ComplianceLockResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.model.CreateAccessKeyPayload .CustomTypeAdapterFactory()); @@ -117,6 +120,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.model.CredentialsGroup .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.objectstorage.model.CredentialsGroupExtended + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.objectstorage.model.DefaultRetentionResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.model.DeleteAccessKeyResponse .CustomTypeAdapterFactory()); @@ -126,6 +135,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.model.DeleteCredentialsGroupResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.objectstorage.model.DeleteDefaultRetentionResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.model.DetailedError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -133,6 +145,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.model.GetBucketResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.objectstorage.model.GetCredentialsGroupResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.model.HTTPValidationError .CustomTypeAdapterFactory()); @@ -149,6 +164,11 @@ private static Class getClassByDiscriminator( new cloud.stackit.sdk.objectstorage.model.LocationInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.model.ProjectStatus.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.objectstorage.model.RetentionMode.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.objectstorage.model.SetDefaultRetentionPayload + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.objectstorage.model.ValidationError .CustomTypeAdapterFactory()); diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/api/DefaultApi.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/api/DefaultApi.java index b63a4bfd..1e3fcba8 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/api/DefaultApi.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/api/DefaultApi.java @@ -18,19 +18,24 @@ import cloud.stackit.sdk.objectstorage.ApiClient; import cloud.stackit.sdk.objectstorage.ApiResponse; import cloud.stackit.sdk.objectstorage.Pair; +import cloud.stackit.sdk.objectstorage.model.ComplianceLockResponse; import cloud.stackit.sdk.objectstorage.model.CreateAccessKeyPayload; import cloud.stackit.sdk.objectstorage.model.CreateAccessKeyResponse; import cloud.stackit.sdk.objectstorage.model.CreateBucketResponse; import cloud.stackit.sdk.objectstorage.model.CreateCredentialsGroupPayload; import cloud.stackit.sdk.objectstorage.model.CreateCredentialsGroupResponse; +import cloud.stackit.sdk.objectstorage.model.DefaultRetentionResponse; import cloud.stackit.sdk.objectstorage.model.DeleteAccessKeyResponse; import cloud.stackit.sdk.objectstorage.model.DeleteBucketResponse; import cloud.stackit.sdk.objectstorage.model.DeleteCredentialsGroupResponse; +import cloud.stackit.sdk.objectstorage.model.DeleteDefaultRetentionResponse; import cloud.stackit.sdk.objectstorage.model.GetBucketResponse; +import cloud.stackit.sdk.objectstorage.model.GetCredentialsGroupResponse; import cloud.stackit.sdk.objectstorage.model.ListAccessKeysResponse; import cloud.stackit.sdk.objectstorage.model.ListBucketsResponse; import cloud.stackit.sdk.objectstorage.model.ListCredentialsGroupsResponse; import cloud.stackit.sdk.objectstorage.model.ProjectStatus; +import cloud.stackit.sdk.objectstorage.model.SetDefaultRetentionPayload; import com.google.gson.reflect.TypeToken; import java.io.IOException; import java.lang.reflect.Type; @@ -354,6 +359,8 @@ public okhttp3.Call createAccessKeyAsync( * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) * @param bucketName The name has to be dns-conform. (required) + * @param objectLockEnabled Enable S3 Object Lock on this bucket. Can only be set at creation + * time. Requires an active project-level compliance lock. (optional, default to false) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -373,6 +380,7 @@ public okhttp3.Call createBucketCall( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, @javax.annotation.Nonnull String bucketName, + @javax.annotation.Nullable Boolean objectLockEnabled, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -409,6 +417,11 @@ public okhttp3.Call createBucketCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (objectLockEnabled != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("objectLockEnabled", objectLockEnabled)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -442,6 +455,7 @@ private okhttp3.Call createBucketValidateBeforeCall( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, @javax.annotation.Nonnull String bucketName, + @javax.annotation.Nullable Boolean objectLockEnabled, final ApiCallback _callback) throws ApiException { // verify the required parameter 'projectId' is set @@ -462,7 +476,7 @@ private okhttp3.Call createBucketValidateBeforeCall( "Missing the required parameter 'bucketName' when calling createBucket(Async)"); } - return createBucketCall(projectId, region, bucketName, _callback); + return createBucketCall(projectId, region, bucketName, objectLockEnabled, _callback); } /** @@ -472,6 +486,8 @@ private okhttp3.Call createBucketValidateBeforeCall( * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) * @param bucketName The name has to be dns-conform. (required) + * @param objectLockEnabled Enable S3 Object Lock on this bucket. Can only be set at creation + * time. Requires an active project-level compliance lock. (optional, default to false) * @return CreateBucketResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -490,10 +506,11 @@ private okhttp3.Call createBucketValidateBeforeCall( public CreateBucketResponse createBucket( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull String bucketName) + @javax.annotation.Nonnull String bucketName, + @javax.annotation.Nullable Boolean objectLockEnabled) throws ApiException { ApiResponse localVarResp = - createBucketWithHttpInfo(projectId, region, bucketName); + createBucketWithHttpInfo(projectId, region, bucketName, objectLockEnabled); return localVarResp.getData(); } @@ -504,6 +521,8 @@ public CreateBucketResponse createBucket( * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) * @param bucketName The name has to be dns-conform. (required) + * @param objectLockEnabled Enable S3 Object Lock on this bucket. Can only be set at creation + * time. Requires an active project-level compliance lock. (optional, default to false) * @return ApiResponse<CreateBucketResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -522,10 +541,12 @@ public CreateBucketResponse createBucket( public ApiResponse createBucketWithHttpInfo( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull String bucketName) + @javax.annotation.Nonnull String bucketName, + @javax.annotation.Nullable Boolean objectLockEnabled) throws ApiException { okhttp3.Call localVarCall = - createBucketValidateBeforeCall(projectId, region, bucketName, null); + createBucketValidateBeforeCall( + projectId, region, bucketName, objectLockEnabled, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -537,6 +558,8 @@ public ApiResponse createBucketWithHttpInfo( * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) * @param bucketName The name has to be dns-conform. (required) + * @param objectLockEnabled Enable S3 Object Lock on this bucket. Can only be set at creation + * time. Requires an active project-level compliance lock. (optional, default to false) * @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 @@ -557,16 +580,205 @@ public okhttp3.Call createBucketAsync( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, @javax.annotation.Nonnull String bucketName, + @javax.annotation.Nullable Boolean objectLockEnabled, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createBucketValidateBeforeCall(projectId, region, bucketName, _callback); + createBucketValidateBeforeCall( + projectId, region, bucketName, objectLockEnabled, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for createComplianceLock + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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
201 Successful Response -
404 Not Found -
409 Conflict -
500 Internal Server Error -
+ */ + public okhttp3.Call createComplianceLockCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + 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 = null; + + // create path and map variables + String localVarPath = + "/v2/project/{projectId}/regions/{region}/compliance-lock" + .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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createComplianceLockValidateBeforeCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + 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 createComplianceLock(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling createComplianceLock(Async)"); + } + + return createComplianceLockCall(projectId, region, _callback); + } + + /** + * Create Compliance Lock Enable compliance lock for a project. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @return ComplianceLockResponse + * @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
201 Successful Response -
404 Not Found -
409 Conflict -
500 Internal Server Error -
+ */ + public ComplianceLockResponse createComplianceLock( + @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + throws ApiException { + ApiResponse localVarResp = + createComplianceLockWithHttpInfo(projectId, region); + return localVarResp.getData(); + } + + /** + * Create Compliance Lock Enable compliance lock for a project. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @return ApiResponse<ComplianceLockResponse> + * @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
201 Successful Response -
404 Not Found -
409 Conflict -
500 Internal Server Error -
+ */ + public ApiResponse createComplianceLockWithHttpInfo( + @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + throws ApiException { + okhttp3.Call localVarCall = createComplianceLockValidateBeforeCall(projectId, region, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Compliance Lock (asynchronously) Enable compliance lock for a project. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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
201 Successful Response -
404 Not Found -
409 Conflict -
500 Internal Server Error -
+ */ + public okhttp3.Call createComplianceLockAsync( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createComplianceLockValidateBeforeCall(projectId, region, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for createCredentialsGroup * @@ -1236,11 +1448,10 @@ public okhttp3.Call deleteBucketAsync( } /** - * Build call for deleteCredentialsGroup + * Build call for deleteComplianceLock * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) - * @param groupId Id of the credentials group (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1249,16 +1460,14 @@ public okhttp3.Call deleteBucketAsync( * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 401 Unauthorized - * 404 Not Found - - * 422 Validation Error - + * 409 Conflict - * 500 Internal Server Error - * */ - public okhttp3.Call deleteCredentialsGroupCall( + public okhttp3.Call deleteComplianceLockCall( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull String groupId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1278,16 +1487,13 @@ public okhttp3.Call deleteCredentialsGroupCall( // create path and map variables String localVarPath = - "/v2/project/{projectId}/regions/{region}/credentials-group/{groupId}" + "/v2/project/{projectId}/regions/{region}/compliance-lock" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())) - .replace( - "{" + "groupId" + "}", - localVarApiClient.escapeString(groupId.toString())); + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1324,41 +1530,32 @@ public okhttp3.Call deleteCredentialsGroupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteCredentialsGroupValidateBeforeCall( + private okhttp3.Call deleteComplianceLockValidateBeforeCall( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull String groupId, 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 deleteCredentialsGroup(Async)"); + "Missing the required parameter 'projectId' when calling deleteComplianceLock(Async)"); } // verify the required parameter 'region' is set if (region == null) { throw new ApiException( - "Missing the required parameter 'region' when calling deleteCredentialsGroup(Async)"); - } - - // verify the required parameter 'groupId' is set - if (groupId == null) { - throw new ApiException( - "Missing the required parameter 'groupId' when calling deleteCredentialsGroup(Async)"); + "Missing the required parameter 'region' when calling deleteComplianceLock(Async)"); } - return deleteCredentialsGroupCall(projectId, region, groupId, _callback); + return deleteComplianceLockCall(projectId, region, _callback); } /** - * Delete Credentials Group Delete a credentials group inside a project if the project exists - * and no valid access keys are left in the group. + * Delete Compliance Lock Remove compliance lock from a project. * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) - * @param groupId Id of the credentials group (required) - * @return DeleteCredentialsGroupResponse + * @return ComplianceLockResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1366,30 +1563,25 @@ private okhttp3.Call deleteCredentialsGroupValidateBeforeCall( * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 401 Unauthorized - * 404 Not Found - - * 422 Validation Error - + * 409 Conflict - * 500 Internal Server Error - * */ - public DeleteCredentialsGroupResponse deleteCredentialsGroup( - @javax.annotation.Nonnull String projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull String groupId) + public ComplianceLockResponse deleteComplianceLock( + @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) throws ApiException { - ApiResponse localVarResp = - deleteCredentialsGroupWithHttpInfo(projectId, region, groupId); + ApiResponse localVarResp = + deleteComplianceLockWithHttpInfo(projectId, region); return localVarResp.getData(); } /** - * Delete Credentials Group Delete a credentials group inside a project if the project exists - * and no valid access keys are left in the group. + * Delete Compliance Lock Remove compliance lock from a project. * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) - * @param groupId Id of the credentials group (required) - * @return ApiResponse<DeleteCredentialsGroupResponse> + * @return ApiResponse<ComplianceLockResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1397,30 +1589,24 @@ public DeleteCredentialsGroupResponse deleteCredentialsGroup( * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 401 Unauthorized - * 404 Not Found - - * 422 Validation Error - + * 409 Conflict - * 500 Internal Server Error - * */ - public ApiResponse deleteCredentialsGroupWithHttpInfo( - @javax.annotation.Nonnull String projectId, - @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull String groupId) + public ApiResponse deleteComplianceLockWithHttpInfo( + @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) throws ApiException { - okhttp3.Call localVarCall = - deleteCredentialsGroupValidateBeforeCall(projectId, region, groupId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = deleteComplianceLockValidateBeforeCall(projectId, region, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Credentials Group (asynchronously) Delete a credentials group inside a project if the - * project exists and no valid access keys are left in the group. + * Delete Compliance Lock (asynchronously) Remove compliance lock from a project. * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) - * @param groupId Id of the credentials group (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 @@ -1430,31 +1616,30 @@ public ApiResponse deleteCredentialsGroupWithHtt * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 401 Unauthorized - * 404 Not Found - - * 422 Validation Error - + * 409 Conflict - * 500 Internal Server Error - * */ - public okhttp3.Call deleteCredentialsGroupAsync( + public okhttp3.Call deleteComplianceLockAsync( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull String groupId, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteCredentialsGroupValidateBeforeCall(projectId, region, groupId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + deleteComplianceLockValidateBeforeCall(projectId, region, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for disableService + * Build call for deleteCredentialsGroup * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) + * @param groupId Id of the credentials group (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1463,17 +1648,16 @@ public okhttp3.Call deleteCredentialsGroupAsync( * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 400 Bad Request - * 401 Unauthorized - - * 403 Forbidden - * 404 Not Found - - * 422 Unprocessable Entity - + * 422 Validation Error - * 500 Internal Server Error - * */ - public okhttp3.Call disableServiceCall( + public okhttp3.Call deleteCredentialsGroupCall( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String groupId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1493,13 +1677,16 @@ public okhttp3.Call disableServiceCall( // create path and map variables String localVarPath = - "/v2/project/{projectId}/regions/{region}" + "/v2/project/{projectId}/regions/{region}/credentials-group/{groupId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "groupId" + "}", + localVarApiClient.escapeString(groupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1536,32 +1723,41 @@ public okhttp3.Call disableServiceCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call disableServiceValidateBeforeCall( + private okhttp3.Call deleteCredentialsGroupValidateBeforeCall( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String groupId, 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 disableService(Async)"); + "Missing the required parameter 'projectId' when calling deleteCredentialsGroup(Async)"); } // verify the required parameter 'region' is set if (region == null) { throw new ApiException( - "Missing the required parameter 'region' when calling disableService(Async)"); + "Missing the required parameter 'region' when calling deleteCredentialsGroup(Async)"); } - return disableServiceCall(projectId, region, _callback); + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException( + "Missing the required parameter 'groupId' when calling deleteCredentialsGroup(Async)"); + } + + return deleteCredentialsGroupCall(projectId, region, groupId, _callback); } /** - * Delete Project Delete the given project + * Delete Credentials Group Delete a credentials group inside a project if the project exists + * and no valid access keys are left in the group. * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) - * @return ProjectStatus + * @param groupId Id of the credentials group (required) + * @return DeleteCredentialsGroupResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1569,27 +1765,30 @@ private okhttp3.Call disableServiceValidateBeforeCall( * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 400 Bad Request - * 401 Unauthorized - - * 403 Forbidden - * 404 Not Found - - * 422 Unprocessable Entity - + * 422 Validation Error - * 500 Internal Server Error - * */ - public ProjectStatus disableService( - @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + public DeleteCredentialsGroupResponse deleteCredentialsGroup( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String groupId) throws ApiException { - ApiResponse localVarResp = disableServiceWithHttpInfo(projectId, region); + ApiResponse localVarResp = + deleteCredentialsGroupWithHttpInfo(projectId, region, groupId); return localVarResp.getData(); } /** - * Delete Project Delete the given project + * Delete Credentials Group Delete a credentials group inside a project if the project exists + * and no valid access keys are left in the group. * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) - * @return ApiResponse<ProjectStatus> + * @param groupId Id of the credentials group (required) + * @return ApiResponse<DeleteCredentialsGroupResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1597,27 +1796,30 @@ public ProjectStatus disableService( * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 400 Bad Request - * 401 Unauthorized - - * 403 Forbidden - * 404 Not Found - - * 422 Unprocessable Entity - + * 422 Validation Error - * 500 Internal Server Error - * */ - public ApiResponse disableServiceWithHttpInfo( - @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + public ApiResponse deleteCredentialsGroupWithHttpInfo( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String groupId) throws ApiException { - okhttp3.Call localVarCall = disableServiceValidateBeforeCall(projectId, region, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + deleteCredentialsGroupValidateBeforeCall(projectId, region, groupId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Project (asynchronously) Delete the given project + * Delete Credentials Group (asynchronously) Delete a credentials group inside a project if the + * project exists and no valid access keys are left in the group. * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) + * @param groupId Id of the credentials group (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 @@ -1627,31 +1829,32 @@ public ApiResponse disableServiceWithHttpInfo( * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 400 Bad Request - * 401 Unauthorized - - * 403 Forbidden - * 404 Not Found - - * 422 Unprocessable Entity - + * 422 Validation Error - * 500 Internal Server Error - * */ - public okhttp3.Call disableServiceAsync( + public okhttp3.Call deleteCredentialsGroupAsync( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, - final ApiCallback _callback) + @javax.annotation.Nonnull String groupId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = disableServiceValidateBeforeCall(projectId, region, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + deleteCredentialsGroupValidateBeforeCall(projectId, region, groupId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for enableService + * Build call for deleteDefaultRetention * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) + * @param bucketName The name has to be dns-conform. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1659,18 +1862,16 @@ public okhttp3.Call disableServiceAsync( * * * - * - * - * - * + * + * * - * * *
Response Details
Status Code Description Response Headers
200 OK -
201 Successful Response -
401 Unauthorized -
403 Forbidden -
200 Successful Response -
404 Not Found -
409 Conflict -
422 Validation Error -
500 Internal Server Error -
*/ - public okhttp3.Call enableServiceCall( + public okhttp3.Call deleteDefaultRetentionCall( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1690,13 +1891,16 @@ public okhttp3.Call enableServiceCall( // create path and map variables String localVarPath = - "/v2/project/{projectId}/regions/{region}" + "/v2/project/{projectId}/regions/{region}/bucket/{bucketName}/default-retention" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( "{" + "region" + "}", - localVarApiClient.escapeString(region.toString())); + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "bucketName" + "}", + localVarApiClient.escapeString(bucketName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1721,7 +1925,7 @@ public okhttp3.Call enableServiceCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1733,91 +1937,1109 @@ public okhttp3.Call enableServiceCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call enableServiceValidateBeforeCall( + private okhttp3.Call deleteDefaultRetentionValidateBeforeCall( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName, 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 enableService(Async)"); + "Missing the required parameter 'projectId' when calling deleteDefaultRetention(Async)"); } // verify the required parameter 'region' is set if (region == null) { throw new ApiException( - "Missing the required parameter 'region' when calling enableService(Async)"); + "Missing the required parameter 'region' when calling deleteDefaultRetention(Async)"); } - return enableServiceCall(projectId, region, _callback); + // verify the required parameter 'bucketName' is set + if (bucketName == null) { + throw new ApiException( + "Missing the required parameter 'bucketName' when calling deleteDefaultRetention(Async)"); + } + + return deleteDefaultRetentionCall(projectId, region, bucketName, _callback); } /** - * Create Project Create a project. Creation will also be successful if the project already - * exists, but will not create a duplicate + * Delete Default Retention Remove the default retention from a bucket. Object Lock itself + * remains enabled. * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) - * @return ProjectStatus + * @param bucketName The name has to be dns-conform. (required) + * @return DeleteDefaultRetentionResponse * @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 OK -
201 Successful Response -
401 Unauthorized -
403 Forbidden -
200 Successful Response -
404 Not Found -
409 Conflict -
422 Validation Error -
500 Internal Server Error -
*/ - public ProjectStatus enableService( - @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + public DeleteDefaultRetentionResponse deleteDefaultRetention( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName) throws ApiException { - ApiResponse localVarResp = enableServiceWithHttpInfo(projectId, region); + ApiResponse localVarResp = + deleteDefaultRetentionWithHttpInfo(projectId, region, bucketName); return localVarResp.getData(); } /** - * Create Project Create a project. Creation will also be successful if the project already - * exists, but will not create a duplicate + * Delete Default Retention Remove the default retention from a bucket. Object Lock itself + * remains enabled. * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) - * @return ApiResponse<ProjectStatus> + * @param bucketName The name has to be dns-conform. (required) + * @return ApiResponse<DeleteDefaultRetentionResponse> * @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 OK -
201 Successful Response -
200 Successful Response -
404 Not Found -
409 Conflict -
500 Internal Server Error -
+ */ + public ApiResponse deleteDefaultRetentionWithHttpInfo( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName) + throws ApiException { + okhttp3.Call localVarCall = + deleteDefaultRetentionValidateBeforeCall(projectId, region, bucketName, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Default Retention (asynchronously) Remove the default retention from a bucket. Object + * Lock itself remains enabled. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param bucketName The name has to be dns-conform. (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 -
404 Not Found -
409 Conflict -
500 Internal Server Error -
+ */ + public okhttp3.Call deleteDefaultRetentionAsync( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteDefaultRetentionValidateBeforeCall(projectId, region, bucketName, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for disableService + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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 -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call disableServiceCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + 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 = null; + + // 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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call disableServiceValidateBeforeCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + 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 disableService(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling disableService(Async)"); + } + + return disableServiceCall(projectId, region, _callback); + } + + /** + * Delete Project Delete the given project + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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 -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ProjectStatus disableService( + @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + throws ApiException { + ApiResponse localVarResp = disableServiceWithHttpInfo(projectId, region); + return localVarResp.getData(); + } + + /** + * Delete Project Delete the given project + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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 -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public ApiResponse disableServiceWithHttpInfo( + @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + throws ApiException { + okhttp3.Call localVarCall = disableServiceValidateBeforeCall(projectId, region, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Project (asynchronously) Delete the given project + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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 -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
409 Conflict -
422 Unprocessable Entity -
500 Internal Server Error -
+ */ + public okhttp3.Call disableServiceAsync( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = disableServiceValidateBeforeCall(projectId, region, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for enableService + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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 OK -
201 Successful Response -
401 Unauthorized -
403 Forbidden -
409 Conflict -
422 Validation Error -
500 Internal Server Error -
+ */ + public okhttp3.Call enableServiceCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + 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 = null; + + // 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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call enableServiceValidateBeforeCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + 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 enableService(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling enableService(Async)"); + } + + return enableServiceCall(projectId, region, _callback); + } + + /** + * Create Project Create a project. Creation will also be successful if the project already + * exists, but will not create a duplicate + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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 OK -
201 Successful Response -
401 Unauthorized -
403 Forbidden -
409 Conflict -
422 Validation Error -
500 Internal Server Error -
+ */ + public ProjectStatus enableService( + @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + throws ApiException { + ApiResponse localVarResp = enableServiceWithHttpInfo(projectId, region); + return localVarResp.getData(); + } + + /** + * Create Project Create a project. Creation will also be successful if the project already + * exists, but will not create a duplicate + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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 OK -
201 Successful Response -
401 Unauthorized -
403 Forbidden -
409 Conflict -
422 Validation Error -
500 Internal Server Error -
+ */ + public ApiResponse enableServiceWithHttpInfo( + @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + throws ApiException { + okhttp3.Call localVarCall = enableServiceValidateBeforeCall(projectId, region, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Project (asynchronously) Create a project. Creation will also be successful if the + * project already exists, but will not create a duplicate + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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 OK -
201 Successful Response -
401 Unauthorized -
403 Forbidden -
409 Conflict -
422 Validation Error -
500 Internal Server Error -
+ */ + public okhttp3.Call enableServiceAsync( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = enableServiceValidateBeforeCall(projectId, region, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getBucket + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param bucketName The name has to be dns-conform. (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 -
500 Internal Server Error -
+ */ + public okhttp3.Call getBucketCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName, + 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 = null; + + // create path and map variables + String localVarPath = + "/v2/project/{projectId}/regions/{region}/bucket/{bucketName}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "bucketName" + "}", + localVarApiClient.escapeString(bucketName.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBucketValidateBeforeCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName, + 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 getBucket(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getBucket(Async)"); + } + + // verify the required parameter 'bucketName' is set + if (bucketName == null) { + throw new ApiException( + "Missing the required parameter 'bucketName' when calling getBucket(Async)"); + } + + return getBucketCall(projectId, region, bucketName, _callback); + } + + /** + * Get Bucket Get information for the given bucket in the project. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param bucketName The name has to be dns-conform. (required) + * @return GetBucketResponse + * @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 -
500 Internal Server Error -
+ */ + public GetBucketResponse getBucket( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName) + throws ApiException { + ApiResponse localVarResp = + getBucketWithHttpInfo(projectId, region, bucketName); + return localVarResp.getData(); + } + + /** + * Get Bucket Get information for the given bucket in the project. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param bucketName The name has to be dns-conform. (required) + * @return ApiResponse<GetBucketResponse> + * @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 -
500 Internal Server Error -
+ */ + public ApiResponse getBucketWithHttpInfo( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName) + throws ApiException { + okhttp3.Call localVarCall = + getBucketValidateBeforeCall(projectId, region, bucketName, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Bucket (asynchronously) Get information for the given bucket in the project. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param bucketName The name has to be dns-conform. (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 -
500 Internal Server Error -
+ */ + public okhttp3.Call getBucketAsync( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getBucketValidateBeforeCall(projectId, region, bucketName, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getComplianceLock + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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 -
404 Not Found -
500 Internal Server Error -
+ */ + public okhttp3.Call getComplianceLockCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + 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 = null; + + // create path and map variables + String localVarPath = + "/v2/project/{projectId}/regions/{region}/compliance-lock" + .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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getComplianceLockValidateBeforeCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + 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 getComplianceLock(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getComplianceLock(Async)"); + } + + return getComplianceLockCall(projectId, region, _callback); + } + + /** + * Get Compliance Lock Get the project-level compliance lock. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @return ComplianceLockResponse + * @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 -
404 Not Found -
500 Internal Server Error -
+ */ + public ComplianceLockResponse getComplianceLock( + @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + throws ApiException { + ApiResponse localVarResp = + getComplianceLockWithHttpInfo(projectId, region); + return localVarResp.getData(); + } + + /** + * Get Compliance Lock Get the project-level compliance lock. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @return ApiResponse<ComplianceLockResponse> + * @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 -
404 Not Found -
500 Internal Server Error -
+ */ + public ApiResponse getComplianceLockWithHttpInfo( + @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + throws ApiException { + okhttp3.Call localVarCall = getComplianceLockValidateBeforeCall(projectId, region, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Compliance Lock (asynchronously) Get the project-level compliance lock. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (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 -
404 Not Found -
500 Internal Server Error -
+ */ + public okhttp3.Call getComplianceLockAsync( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getComplianceLockValidateBeforeCall(projectId, region, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getCredentialsGroup + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param groupId Id of the credentials group (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 -
404 Not Found -
422 Validation Error -
500 Internal Server Error -
+ */ + public okhttp3.Call getCredentialsGroupCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String groupId, + 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 = null; + + // create path and map variables + String localVarPath = + "/v2/project/{projectId}/regions/{region}/credentials-group/{groupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "groupId" + "}", + localVarApiClient.escapeString(groupId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCredentialsGroupValidateBeforeCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String groupId, + 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 getCredentialsGroup(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getCredentialsGroup(Async)"); + } + + // verify the required parameter 'groupId' is set + if (groupId == null) { + throw new ApiException( + "Missing the required parameter 'groupId' when calling getCredentialsGroup(Async)"); + } + + return getCredentialsGroupCall(projectId, region, groupId, _callback); + } + + /** + * Get Credentials Group Get the details of a single credentials group + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param groupId Id of the credentials group (required) + * @return GetCredentialsGroupResponse + * @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 -
404 Not Found -
422 Validation Error -
500 Internal Server Error -
+ */ + public GetCredentialsGroupResponse getCredentialsGroup( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String groupId) + throws ApiException { + ApiResponse localVarResp = + getCredentialsGroupWithHttpInfo(projectId, region, groupId); + return localVarResp.getData(); + } + + /** + * Get Credentials Group Get the details of a single credentials group + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param groupId Id of the credentials group (required) + * @return ApiResponse<GetCredentialsGroupResponse> + * @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 -
404 Not Found -
422 Validation Error -
500 Internal Server Error -
*/ - public ApiResponse enableServiceWithHttpInfo( - @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region) + public ApiResponse getCredentialsGroupWithHttpInfo( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String groupId) throws ApiException { - okhttp3.Call localVarCall = enableServiceValidateBeforeCall(projectId, region, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getCredentialsGroupValidateBeforeCall(projectId, region, groupId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Project (asynchronously) Create a project. Creation will also be successful if the - * project already exists, but will not create a duplicate + * Get Credentials Group (asynchronously) Get the details of a single credentials group * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) + * @param groupId Id of the credentials group (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 @@ -1826,29 +3048,28 @@ public ApiResponse enableServiceWithHttpInfo( * * * - * - * - * - * - * + * + * * * *
Response Details
Status Code Description Response Headers
200 OK -
201 Successful Response -
401 Unauthorized -
403 Forbidden -
409 Conflict -
200 Successful Response -
404 Not Found -
422 Validation Error -
500 Internal Server Error -
*/ - public okhttp3.Call enableServiceAsync( + public okhttp3.Call getCredentialsGroupAsync( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, - final ApiCallback _callback) + @javax.annotation.Nonnull String groupId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = enableServiceValidateBeforeCall(projectId, region, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getCredentialsGroupValidateBeforeCall(projectId, region, groupId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getBucket + * Build call for getDefaultRetention * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) @@ -1861,14 +3082,12 @@ public okhttp3.Call enableServiceAsync( * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 401 Unauthorized - - * 403 Forbidden - * 404 Not Found - - * 422 Validation Error - + * 409 Conflict - * 500 Internal Server Error - * */ - public okhttp3.Call getBucketCall( + public okhttp3.Call getDefaultRetentionCall( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, @javax.annotation.Nonnull String bucketName, @@ -1891,7 +3110,7 @@ public okhttp3.Call getBucketCall( // create path and map variables String localVarPath = - "/v2/project/{projectId}/regions/{region}/bucket/{bucketName}" + "/v2/project/{projectId}/regions/{region}/bucket/{bucketName}/default-retention" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) @@ -1937,7 +3156,7 @@ public okhttp3.Call getBucketCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getBucketValidateBeforeCall( + private okhttp3.Call getDefaultRetentionValidateBeforeCall( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, @javax.annotation.Nonnull String bucketName, @@ -1946,31 +3165,31 @@ private okhttp3.Call getBucketValidateBeforeCall( // verify the required parameter 'projectId' is set if (projectId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling getBucket(Async)"); + "Missing the required parameter 'projectId' when calling getDefaultRetention(Async)"); } // verify the required parameter 'region' is set if (region == null) { throw new ApiException( - "Missing the required parameter 'region' when calling getBucket(Async)"); + "Missing the required parameter 'region' when calling getDefaultRetention(Async)"); } // verify the required parameter 'bucketName' is set if (bucketName == null) { throw new ApiException( - "Missing the required parameter 'bucketName' when calling getBucket(Async)"); + "Missing the required parameter 'bucketName' when calling getDefaultRetention(Async)"); } - return getBucketCall(projectId, region, bucketName, _callback); + return getDefaultRetentionCall(projectId, region, bucketName, _callback); } /** - * Get Bucket Get information for the given bucket in the project. + * Get Default Retention Get the default retention configuration for a bucket. * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) * @param bucketName The name has to be dns-conform. (required) - * @return GetBucketResponse + * @return DefaultRetentionResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1978,30 +3197,28 @@ private okhttp3.Call getBucketValidateBeforeCall( * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 401 Unauthorized - - * 403 Forbidden - * 404 Not Found - - * 422 Validation Error - + * 409 Conflict - * 500 Internal Server Error - * */ - public GetBucketResponse getBucket( + public DefaultRetentionResponse getDefaultRetention( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, @javax.annotation.Nonnull String bucketName) throws ApiException { - ApiResponse localVarResp = - getBucketWithHttpInfo(projectId, region, bucketName); + ApiResponse localVarResp = + getDefaultRetentionWithHttpInfo(projectId, region, bucketName); return localVarResp.getData(); } /** - * Get Bucket Get information for the given bucket in the project. + * Get Default Retention Get the default retention configuration for a bucket. * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) * @param bucketName The name has to be dns-conform. (required) - * @return ApiResponse<GetBucketResponse> + * @return ApiResponse<DefaultRetentionResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -2009,26 +3226,24 @@ public GetBucketResponse getBucket( * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 401 Unauthorized - - * 403 Forbidden - * 404 Not Found - - * 422 Validation Error - + * 409 Conflict - * 500 Internal Server Error - * */ - public ApiResponse getBucketWithHttpInfo( + public ApiResponse getDefaultRetentionWithHttpInfo( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, @javax.annotation.Nonnull String bucketName) throws ApiException { okhttp3.Call localVarCall = - getBucketValidateBeforeCall(projectId, region, bucketName, null); - Type localVarReturnType = new TypeToken() {}.getType(); + getDefaultRetentionValidateBeforeCall(projectId, region, bucketName, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Bucket (asynchronously) Get information for the given bucket in the project. + * Get Default Retention (asynchronously) Get the default retention configuration for a bucket. * * @param projectId STACKIT project ID (required) * @param region STACKIT Region (required) @@ -2042,23 +3257,21 @@ public ApiResponse getBucketWithHttpInfo( * Response Details * Status Code Description Response Headers * 200 Successful Response - - * 401 Unauthorized - - * 403 Forbidden - * 404 Not Found - - * 422 Validation Error - + * 409 Conflict - * 500 Internal Server Error - * */ - public okhttp3.Call getBucketAsync( + public okhttp3.Call getDefaultRetentionAsync( @javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String region, @javax.annotation.Nonnull String bucketName, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getBucketValidateBeforeCall(projectId, region, bucketName, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getDefaultRetentionValidateBeforeCall(projectId, region, bucketName, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -2854,4 +4067,235 @@ public okhttp3.Call listCredentialsGroupsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + + /** + * Build call for setDefaultRetention + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param bucketName The name has to be dns-conform. (required) + * @param setDefaultRetentionPayload (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 -
400 Bad Request -
404 Not Found -
409 Conflict -
500 Internal Server Error -
+ */ + public okhttp3.Call setDefaultRetentionCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName, + @javax.annotation.Nonnull SetDefaultRetentionPayload setDefaultRetentionPayload, + 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 = setDefaultRetentionPayload; + + // create path and map variables + String localVarPath = + "/v2/project/{projectId}/regions/{region}/bucket/{bucketName}/default-retention" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "bucketName" + "}", + localVarApiClient.escapeString(bucketName.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 setDefaultRetentionValidateBeforeCall( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName, + @javax.annotation.Nonnull SetDefaultRetentionPayload setDefaultRetentionPayload, + 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 setDefaultRetention(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling setDefaultRetention(Async)"); + } + + // verify the required parameter 'bucketName' is set + if (bucketName == null) { + throw new ApiException( + "Missing the required parameter 'bucketName' when calling setDefaultRetention(Async)"); + } + + // verify the required parameter 'setDefaultRetentionPayload' is set + if (setDefaultRetentionPayload == null) { + throw new ApiException( + "Missing the required parameter 'setDefaultRetentionPayload' when calling setDefaultRetention(Async)"); + } + + return setDefaultRetentionCall( + projectId, region, bucketName, setDefaultRetentionPayload, _callback); + } + + /** + * Update Default Retention Set or update the default retention for a bucket. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param bucketName The name has to be dns-conform. (required) + * @param setDefaultRetentionPayload (required) + * @return DefaultRetentionResponse + * @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 -
400 Bad Request -
404 Not Found -
409 Conflict -
500 Internal Server Error -
+ */ + public DefaultRetentionResponse setDefaultRetention( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName, + @javax.annotation.Nonnull SetDefaultRetentionPayload setDefaultRetentionPayload) + throws ApiException { + ApiResponse localVarResp = + setDefaultRetentionWithHttpInfo( + projectId, region, bucketName, setDefaultRetentionPayload); + return localVarResp.getData(); + } + + /** + * Update Default Retention Set or update the default retention for a bucket. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param bucketName The name has to be dns-conform. (required) + * @param setDefaultRetentionPayload (required) + * @return ApiResponse<DefaultRetentionResponse> + * @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 -
400 Bad Request -
404 Not Found -
409 Conflict -
500 Internal Server Error -
+ */ + public ApiResponse setDefaultRetentionWithHttpInfo( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName, + @javax.annotation.Nonnull SetDefaultRetentionPayload setDefaultRetentionPayload) + throws ApiException { + okhttp3.Call localVarCall = + setDefaultRetentionValidateBeforeCall( + projectId, region, bucketName, setDefaultRetentionPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Default Retention (asynchronously) Set or update the default retention for a bucket. + * + * @param projectId STACKIT project ID (required) + * @param region STACKIT Region (required) + * @param bucketName The name has to be dns-conform. (required) + * @param setDefaultRetentionPayload (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 -
400 Bad Request -
404 Not Found -
409 Conflict -
500 Internal Server Error -
+ */ + public okhttp3.Call setDefaultRetentionAsync( + @javax.annotation.Nonnull String projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String bucketName, + @javax.annotation.Nonnull SetDefaultRetentionPayload setDefaultRetentionPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + setDefaultRetentionValidateBeforeCall( + projectId, region, bucketName, setDefaultRetentionPayload, _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/model/Bucket.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/Bucket.java index 0609a3b4..91d71342 100644 --- a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/Bucket.java +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/Bucket.java @@ -41,6 +41,12 @@ public class Bucket { @javax.annotation.Nonnull private String name; + public static final String SERIALIZED_NAME_OBJECT_LOCK_ENABLED = "objectLockEnabled"; + + @SerializedName(SERIALIZED_NAME_OBJECT_LOCK_ENABLED) + @javax.annotation.Nonnull + private Boolean objectLockEnabled; + public static final String SERIALIZED_NAME_REGION = "region"; @SerializedName(SERIALIZED_NAME_REGION) @@ -80,6 +86,25 @@ public void setName(@javax.annotation.Nonnull String name) { this.name = name; } + public Bucket objectLockEnabled(@javax.annotation.Nonnull Boolean objectLockEnabled) { + this.objectLockEnabled = objectLockEnabled; + return this; + } + + /** + * Whether S3 Object Lock is enabled for this bucket + * + * @return objectLockEnabled + */ + @javax.annotation.Nonnull + public Boolean getObjectLockEnabled() { + return objectLockEnabled; + } + + public void setObjectLockEnabled(@javax.annotation.Nonnull Boolean objectLockEnabled) { + this.objectLockEnabled = objectLockEnabled; + } + public Bucket region(@javax.annotation.Nonnull String region) { this.region = region; return this; @@ -191,6 +216,7 @@ public boolean equals(Object o) { } Bucket bucket = (Bucket) o; return Objects.equals(this.name, bucket.name) + && Objects.equals(this.objectLockEnabled, bucket.objectLockEnabled) && Objects.equals(this.region, bucket.region) && Objects.equals(this.urlPathStyle, bucket.urlPathStyle) && Objects.equals(this.urlVirtualHostedStyle, bucket.urlVirtualHostedStyle) @@ -200,7 +226,12 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - name, region, urlPathStyle, urlVirtualHostedStyle, additionalProperties); + name, + objectLockEnabled, + region, + urlPathStyle, + urlVirtualHostedStyle, + additionalProperties); } @Override @@ -208,6 +239,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Bucket {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" objectLockEnabled: ") + .append(toIndentedString(objectLockEnabled)) + .append("\n"); sb.append(" region: ").append(toIndentedString(region)).append("\n"); sb.append(" urlPathStyle: ").append(toIndentedString(urlPathStyle)).append("\n"); sb.append(" urlVirtualHostedStyle: ") @@ -238,12 +272,22 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet( - Arrays.asList("name", "region", "urlPathStyle", "urlVirtualHostedStyle")); + Arrays.asList( + "name", + "objectLockEnabled", + "region", + "urlPathStyle", + "urlVirtualHostedStyle")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet( - Arrays.asList("name", "region", "urlPathStyle", "urlVirtualHostedStyle")); + Arrays.asList( + "name", + "objectLockEnabled", + "region", + "urlPathStyle", + "urlVirtualHostedStyle")); } /** diff --git a/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/ComplianceLockResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/ComplianceLockResponse.java new file mode 100644 index 00000000..d53d60fd --- /dev/null +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/ComplianceLockResponse.java @@ -0,0 +1,336 @@ +/* + * 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.model; + +import cloud.stackit.sdk.objectstorage.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +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; + +/** ComplianceLockResponse */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class ComplianceLockResponse { + public static final String SERIALIZED_NAME_MAX_RETENTION_DAYS = "maxRetentionDays"; + + @SerializedName(SERIALIZED_NAME_MAX_RETENTION_DAYS) + @javax.annotation.Nonnull + private Integer maxRetentionDays; + + public static final String SERIALIZED_NAME_PROJECT = "project"; + + @SerializedName(SERIALIZED_NAME_PROJECT) + @javax.annotation.Nonnull + private String project; + + public ComplianceLockResponse() {} + + public ComplianceLockResponse maxRetentionDays( + @javax.annotation.Nonnull Integer maxRetentionDays) { + this.maxRetentionDays = maxRetentionDays; + return this; + } + + /** + * Maximum retention period in days + * + * @return maxRetentionDays + */ + @javax.annotation.Nonnull + public Integer getMaxRetentionDays() { + return maxRetentionDays; + } + + public void setMaxRetentionDays(@javax.annotation.Nonnull Integer maxRetentionDays) { + this.maxRetentionDays = maxRetentionDays; + } + + public ComplianceLockResponse project(@javax.annotation.Nonnull String project) { + this.project = project; + return this; + } + + /** + * Project ID + * + * @return project + */ + @javax.annotation.Nonnull + public String getProject() { + return project; + } + + public void setProject(@javax.annotation.Nonnull String project) { + this.project = project; + } + + /** + * 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 ComplianceLockResponse instance itself + */ + public ComplianceLockResponse 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; + } + ComplianceLockResponse complianceLockResponse = (ComplianceLockResponse) o; + return Objects.equals(this.maxRetentionDays, complianceLockResponse.maxRetentionDays) + && Objects.equals(this.project, complianceLockResponse.project) + && Objects.equals( + this.additionalProperties, complianceLockResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(maxRetentionDays, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComplianceLockResponse {\n"); + sb.append(" maxRetentionDays: ").append(toIndentedString(maxRetentionDays)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).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) { + if (o == null) { + return "null"; + } + return 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("maxRetentionDays", "project")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("maxRetentionDays", "project")); + } + + /** + * 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 ComplianceLockResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ComplianceLockResponse.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 ComplianceLockResponse is not found in the empty JSON string", + ComplianceLockResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ComplianceLockResponse.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(); + if (!jsonObj.get("project").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `project` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("project").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ComplianceLockResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ComplianceLockResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ComplianceLockResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ComplianceLockResponse 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.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ComplianceLockResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ComplianceLockResponse 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 ComplianceLockResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ComplianceLockResponse + * @throws IOException if the JSON string is invalid with respect to ComplianceLockResponse + */ + public static ComplianceLockResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ComplianceLockResponse.class); + } + + /** + * Convert an instance of ComplianceLockResponse 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/model/CredentialsGroupExtended.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/CredentialsGroupExtended.java new file mode 100644 index 00000000..d9f94001 --- /dev/null +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/CredentialsGroupExtended.java @@ -0,0 +1,418 @@ +/* + * 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.model; + +import cloud.stackit.sdk.objectstorage.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +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; + +/** CredentialsGroupExtended */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class CredentialsGroupExtended { + public static final String SERIALIZED_NAME_CREDENTIALS_GROUP_ID = "credentialsGroupId"; + + @SerializedName(SERIALIZED_NAME_CREDENTIALS_GROUP_ID) + @javax.annotation.Nonnull + private String credentialsGroupId; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; + + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nonnull + private String displayName; + + public static final String SERIALIZED_NAME_URN = "urn"; + + @SerializedName(SERIALIZED_NAME_URN) + @javax.annotation.Nonnull + private String urn; + + public static final String SERIALIZED_NAME_USER_URN = "userUrn"; + + @SerializedName(SERIALIZED_NAME_USER_URN) + @javax.annotation.Nonnull + private String userUrn; + + public CredentialsGroupExtended() {} + + public CredentialsGroupExtended credentialsGroupId( + @javax.annotation.Nonnull String credentialsGroupId) { + this.credentialsGroupId = credentialsGroupId; + return this; + } + + /** + * The ID of the credentials group + * + * @return credentialsGroupId + */ + @javax.annotation.Nonnull + public String getCredentialsGroupId() { + return credentialsGroupId; + } + + public void setCredentialsGroupId(@javax.annotation.Nonnull String credentialsGroupId) { + this.credentialsGroupId = credentialsGroupId; + } + + public CredentialsGroupExtended displayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Name of the group holding credentials + * + * @return displayName + */ + @javax.annotation.Nonnull + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + } + + public CredentialsGroupExtended urn(@javax.annotation.Nonnull String urn) { + this.urn = urn; + return this; + } + + /** + * StorageGRID group URN + * + * @return urn + */ + @javax.annotation.Nonnull + public String getUrn() { + return urn; + } + + public void setUrn(@javax.annotation.Nonnull String urn) { + this.urn = urn; + } + + public CredentialsGroupExtended userUrn(@javax.annotation.Nonnull String userUrn) { + this.userUrn = userUrn; + return this; + } + + /** + * StorageGRID user URN + * + * @return userUrn + */ + @javax.annotation.Nonnull + public String getUserUrn() { + return userUrn; + } + + public void setUserUrn(@javax.annotation.Nonnull String userUrn) { + this.userUrn = userUrn; + } + + /** + * 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 CredentialsGroupExtended instance itself + */ + public CredentialsGroupExtended 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; + } + CredentialsGroupExtended credentialsGroupExtended = (CredentialsGroupExtended) o; + return Objects.equals(this.credentialsGroupId, credentialsGroupExtended.credentialsGroupId) + && Objects.equals(this.displayName, credentialsGroupExtended.displayName) + && Objects.equals(this.urn, credentialsGroupExtended.urn) + && Objects.equals(this.userUrn, credentialsGroupExtended.userUrn) + && Objects.equals( + this.additionalProperties, credentialsGroupExtended.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(credentialsGroupId, displayName, urn, userUrn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CredentialsGroupExtended {\n"); + sb.append(" credentialsGroupId: ") + .append(toIndentedString(credentialsGroupId)) + .append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" urn: ").append(toIndentedString(urn)).append("\n"); + sb.append(" userUrn: ").append(toIndentedString(userUrn)).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) { + if (o == null) { + return "null"; + } + return 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("credentialsGroupId", "displayName", "urn", "userUrn")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = + new HashSet( + Arrays.asList("credentialsGroupId", "displayName", "urn", "userUrn")); + } + + /** + * 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 CredentialsGroupExtended + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CredentialsGroupExtended.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 CredentialsGroupExtended is not found in the empty JSON string", + CredentialsGroupExtended.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CredentialsGroupExtended.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(); + if (!jsonObj.get("credentialsGroupId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `credentialsGroupId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("credentialsGroupId").toString())); + } + if (!jsonObj.get("displayName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("displayName").toString())); + } + if (!jsonObj.get("urn").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `urn` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("urn").toString())); + } + if (!jsonObj.get("userUrn").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `userUrn` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("userUrn").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CredentialsGroupExtended.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CredentialsGroupExtended' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CredentialsGroupExtended.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CredentialsGroupExtended 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.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CredentialsGroupExtended read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CredentialsGroupExtended 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 CredentialsGroupExtended given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialsGroupExtended + * @throws IOException if the JSON string is invalid with respect to CredentialsGroupExtended + */ + public static CredentialsGroupExtended fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CredentialsGroupExtended.class); + } + + /** + * Convert an instance of CredentialsGroupExtended 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/model/DefaultRetentionResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/DefaultRetentionResponse.java new file mode 100644 index 00000000..eca8851e --- /dev/null +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/DefaultRetentionResponse.java @@ -0,0 +1,402 @@ +/* + * 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.model; + +import cloud.stackit.sdk.objectstorage.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +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; + +/** DefaultRetentionResponse */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class DefaultRetentionResponse { + public static final String SERIALIZED_NAME_BUCKET = "bucket"; + + @SerializedName(SERIALIZED_NAME_BUCKET) + @javax.annotation.Nonnull + private String bucket; + + public static final String SERIALIZED_NAME_DAYS = "days"; + + @SerializedName(SERIALIZED_NAME_DAYS) + @javax.annotation.Nonnull + private Integer days; + + public static final String SERIALIZED_NAME_MODE = "mode"; + + @SerializedName(SERIALIZED_NAME_MODE) + @javax.annotation.Nonnull + private RetentionMode mode; + + public static final String SERIALIZED_NAME_PROJECT = "project"; + + @SerializedName(SERIALIZED_NAME_PROJECT) + @javax.annotation.Nonnull + private String project; + + public DefaultRetentionResponse() {} + + public DefaultRetentionResponse bucket(@javax.annotation.Nonnull String bucket) { + this.bucket = bucket; + return this; + } + + /** + * Name of the bucket + * + * @return bucket + */ + @javax.annotation.Nonnull + public String getBucket() { + return bucket; + } + + public void setBucket(@javax.annotation.Nonnull String bucket) { + this.bucket = bucket; + } + + public DefaultRetentionResponse days(@javax.annotation.Nonnull Integer days) { + this.days = days; + return this; + } + + /** + * Retention period in days + * + * @return days + */ + @javax.annotation.Nonnull + public Integer getDays() { + return days; + } + + public void setDays(@javax.annotation.Nonnull Integer days) { + this.days = days; + } + + public DefaultRetentionResponse mode(@javax.annotation.Nonnull RetentionMode mode) { + this.mode = mode; + return this; + } + + /** + * Get mode + * + * @return mode + */ + @javax.annotation.Nonnull + public RetentionMode getMode() { + return mode; + } + + public void setMode(@javax.annotation.Nonnull RetentionMode mode) { + this.mode = mode; + } + + public DefaultRetentionResponse project(@javax.annotation.Nonnull String project) { + this.project = project; + return this; + } + + /** + * Project ID + * + * @return project + */ + @javax.annotation.Nonnull + public String getProject() { + return project; + } + + public void setProject(@javax.annotation.Nonnull String project) { + this.project = project; + } + + /** + * 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 DefaultRetentionResponse instance itself + */ + public DefaultRetentionResponse 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; + } + DefaultRetentionResponse defaultRetentionResponse = (DefaultRetentionResponse) o; + return Objects.equals(this.bucket, defaultRetentionResponse.bucket) + && Objects.equals(this.days, defaultRetentionResponse.days) + && Objects.equals(this.mode, defaultRetentionResponse.mode) + && Objects.equals(this.project, defaultRetentionResponse.project) + && Objects.equals( + this.additionalProperties, defaultRetentionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(bucket, days, mode, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultRetentionResponse {\n"); + sb.append(" bucket: ").append(toIndentedString(bucket)).append("\n"); + sb.append(" days: ").append(toIndentedString(days)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).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) { + if (o == null) { + return "null"; + } + return 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("bucket", "days", "mode", "project")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = + new HashSet(Arrays.asList("bucket", "days", "mode", "project")); + } + + /** + * 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 DefaultRetentionResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DefaultRetentionResponse.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 DefaultRetentionResponse is not found in the empty JSON string", + DefaultRetentionResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DefaultRetentionResponse.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(); + if (!jsonObj.get("bucket").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `bucket` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("bucket").toString())); + } + // validate the required field `mode` + RetentionMode.validateJsonElement(jsonObj.get("mode")); + // validate the required field `mode` + RetentionMode.validateJsonElement(jsonObj.get("mode")); + if (!jsonObj.get("project").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `project` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("project").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DefaultRetentionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DefaultRetentionResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DefaultRetentionResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DefaultRetentionResponse 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.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DefaultRetentionResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DefaultRetentionResponse 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 DefaultRetentionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DefaultRetentionResponse + * @throws IOException if the JSON string is invalid with respect to DefaultRetentionResponse + */ + public static DefaultRetentionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DefaultRetentionResponse.class); + } + + /** + * Convert an instance of DefaultRetentionResponse 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/model/DeleteDefaultRetentionResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/DeleteDefaultRetentionResponse.java new file mode 100644 index 00000000..e19939ff --- /dev/null +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/DeleteDefaultRetentionResponse.java @@ -0,0 +1,350 @@ +/* + * 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.model; + +import cloud.stackit.sdk.objectstorage.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +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; + +/** DeleteDefaultRetentionResponse */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class DeleteDefaultRetentionResponse { + public static final String SERIALIZED_NAME_BUCKET = "bucket"; + + @SerializedName(SERIALIZED_NAME_BUCKET) + @javax.annotation.Nonnull + private String bucket; + + public static final String SERIALIZED_NAME_PROJECT = "project"; + + @SerializedName(SERIALIZED_NAME_PROJECT) + @javax.annotation.Nonnull + private String project; + + public DeleteDefaultRetentionResponse() {} + + public DeleteDefaultRetentionResponse bucket(@javax.annotation.Nonnull String bucket) { + this.bucket = bucket; + return this; + } + + /** + * Name of the bucket + * + * @return bucket + */ + @javax.annotation.Nonnull + public String getBucket() { + return bucket; + } + + public void setBucket(@javax.annotation.Nonnull String bucket) { + this.bucket = bucket; + } + + public DeleteDefaultRetentionResponse project(@javax.annotation.Nonnull String project) { + this.project = project; + return this; + } + + /** + * Project ID + * + * @return project + */ + @javax.annotation.Nonnull + public String getProject() { + return project; + } + + public void setProject(@javax.annotation.Nonnull String project) { + this.project = project; + } + + /** + * 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 DeleteDefaultRetentionResponse instance itself + */ + public DeleteDefaultRetentionResponse 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; + } + DeleteDefaultRetentionResponse deleteDefaultRetentionResponse = + (DeleteDefaultRetentionResponse) o; + return Objects.equals(this.bucket, deleteDefaultRetentionResponse.bucket) + && Objects.equals(this.project, deleteDefaultRetentionResponse.project) + && Objects.equals( + this.additionalProperties, + deleteDefaultRetentionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(bucket, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteDefaultRetentionResponse {\n"); + sb.append(" bucket: ").append(toIndentedString(bucket)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).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) { + if (o == null) { + return "null"; + } + return 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("bucket", "project")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("bucket", "project")); + } + + /** + * 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 + * DeleteDefaultRetentionResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteDefaultRetentionResponse.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 DeleteDefaultRetentionResponse is not found in the empty JSON string", + DeleteDefaultRetentionResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteDefaultRetentionResponse.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(); + if (!jsonObj.get("bucket").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `bucket` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("bucket").toString())); + } + if (!jsonObj.get("project").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `project` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("project").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteDefaultRetentionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteDefaultRetentionResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteDefaultRetentionResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteDefaultRetentionResponse 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.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeleteDefaultRetentionResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeleteDefaultRetentionResponse 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 DeleteDefaultRetentionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteDefaultRetentionResponse + * @throws IOException if the JSON string is invalid with respect to + * DeleteDefaultRetentionResponse + */ + public static DeleteDefaultRetentionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteDefaultRetentionResponse.class); + } + + /** + * Convert an instance of DeleteDefaultRetentionResponse 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/model/GetCredentialsGroupResponse.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/GetCredentialsGroupResponse.java new file mode 100644 index 00000000..0b512377 --- /dev/null +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/GetCredentialsGroupResponse.java @@ -0,0 +1,343 @@ +/* + * 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.model; + +import cloud.stackit.sdk.objectstorage.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +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; + +/** GetCredentialsGroupResponse */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class GetCredentialsGroupResponse { + public static final String SERIALIZED_NAME_CREDENTIALS_GROUP = "credentialsGroup"; + + @SerializedName(SERIALIZED_NAME_CREDENTIALS_GROUP) + @javax.annotation.Nonnull + private CredentialsGroupExtended credentialsGroup; + + public static final String SERIALIZED_NAME_PROJECT = "project"; + + @SerializedName(SERIALIZED_NAME_PROJECT) + @javax.annotation.Nonnull + private String project; + + public GetCredentialsGroupResponse() {} + + public GetCredentialsGroupResponse credentialsGroup( + @javax.annotation.Nonnull CredentialsGroupExtended credentialsGroup) { + this.credentialsGroup = credentialsGroup; + return this; + } + + /** + * Get credentialsGroup + * + * @return credentialsGroup + */ + @javax.annotation.Nonnull + public CredentialsGroupExtended getCredentialsGroup() { + return credentialsGroup; + } + + public void setCredentialsGroup( + @javax.annotation.Nonnull CredentialsGroupExtended credentialsGroup) { + this.credentialsGroup = credentialsGroup; + } + + public GetCredentialsGroupResponse project(@javax.annotation.Nonnull String project) { + this.project = project; + return this; + } + + /** + * Project ID + * + * @return project + */ + @javax.annotation.Nonnull + public String getProject() { + return project; + } + + public void setProject(@javax.annotation.Nonnull String project) { + this.project = project; + } + + /** + * 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 GetCredentialsGroupResponse instance itself + */ + public GetCredentialsGroupResponse 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; + } + GetCredentialsGroupResponse getCredentialsGroupResponse = (GetCredentialsGroupResponse) o; + return Objects.equals(this.credentialsGroup, getCredentialsGroupResponse.credentialsGroup) + && Objects.equals(this.project, getCredentialsGroupResponse.project) + && Objects.equals( + this.additionalProperties, + getCredentialsGroupResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(credentialsGroup, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCredentialsGroupResponse {\n"); + sb.append(" credentialsGroup: ").append(toIndentedString(credentialsGroup)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).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) { + if (o == null) { + return "null"; + } + return 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("credentialsGroup", "project")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("credentialsGroup", "project")); + } + + /** + * 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 + * GetCredentialsGroupResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetCredentialsGroupResponse.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 GetCredentialsGroupResponse is not found in the empty JSON string", + GetCredentialsGroupResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetCredentialsGroupResponse.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(); + // validate the required field `credentialsGroup` + CredentialsGroupExtended.validateJsonElement(jsonObj.get("credentialsGroup")); + if (!jsonObj.get("project").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `project` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("project").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetCredentialsGroupResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetCredentialsGroupResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetCredentialsGroupResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetCredentialsGroupResponse 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.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetCredentialsGroupResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetCredentialsGroupResponse 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 GetCredentialsGroupResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetCredentialsGroupResponse + * @throws IOException if the JSON string is invalid with respect to GetCredentialsGroupResponse + */ + public static GetCredentialsGroupResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetCredentialsGroupResponse.class); + } + + /** + * Convert an instance of GetCredentialsGroupResponse 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/model/RetentionMode.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/RetentionMode.java new file mode 100644 index 00000000..77393aec --- /dev/null +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/RetentionMode.java @@ -0,0 +1,256 @@ +/* + * 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.model; + +import cloud.stackit.sdk.objectstorage.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +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.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The retention mode for default retention on a bucket. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class RetentionMode { + public RetentionMode() {} + + /** + * 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 RetentionMode instance itself + */ + public RetentionMode 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; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RetentionMode {\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) { + if (o == null) { + return "null"; + } + return 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(0); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * 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 RetentionMode + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RetentionMode.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 RetentionMode is not found in the empty JSON string", + RetentionMode.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RetentionMode.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RetentionMode' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RetentionMode.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RetentionMode 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.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RetentionMode read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RetentionMode 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 RetentionMode given an JSON string + * + * @param jsonString JSON string + * @return An instance of RetentionMode + * @throws IOException if the JSON string is invalid with respect to RetentionMode + */ + public static RetentionMode fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RetentionMode.class); + } + + /** + * Convert an instance of RetentionMode 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/model/SetDefaultRetentionPayload.java b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/SetDefaultRetentionPayload.java new file mode 100644 index 00000000..8560b26f --- /dev/null +++ b/services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/model/SetDefaultRetentionPayload.java @@ -0,0 +1,333 @@ +/* + * 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.model; + +import cloud.stackit.sdk.objectstorage.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +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; + +/** SetDefaultRetentionPayload */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class SetDefaultRetentionPayload { + public static final String SERIALIZED_NAME_DAYS = "days"; + + @SerializedName(SERIALIZED_NAME_DAYS) + @javax.annotation.Nonnull + private Integer days; + + public static final String SERIALIZED_NAME_MODE = "mode"; + + @SerializedName(SERIALIZED_NAME_MODE) + @javax.annotation.Nonnull + private RetentionMode mode; + + public SetDefaultRetentionPayload() {} + + public SetDefaultRetentionPayload days(@javax.annotation.Nonnull Integer days) { + this.days = days; + return this; + } + + /** + * Retention period in days minimum: 0 + * + * @return days + */ + @javax.annotation.Nonnull + public Integer getDays() { + return days; + } + + public void setDays(@javax.annotation.Nonnull Integer days) { + this.days = days; + } + + public SetDefaultRetentionPayload mode(@javax.annotation.Nonnull RetentionMode mode) { + this.mode = mode; + return this; + } + + /** + * Get mode + * + * @return mode + */ + @javax.annotation.Nonnull + public RetentionMode getMode() { + return mode; + } + + public void setMode(@javax.annotation.Nonnull RetentionMode mode) { + this.mode = mode; + } + + /** + * 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 SetDefaultRetentionPayload instance itself + */ + public SetDefaultRetentionPayload 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; + } + SetDefaultRetentionPayload setDefaultRetentionPayload = (SetDefaultRetentionPayload) o; + return Objects.equals(this.days, setDefaultRetentionPayload.days) + && Objects.equals(this.mode, setDefaultRetentionPayload.mode) + && Objects.equals( + this.additionalProperties, setDefaultRetentionPayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(days, mode, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetDefaultRetentionPayload {\n"); + sb.append(" days: ").append(toIndentedString(days)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).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) { + if (o == null) { + return "null"; + } + return 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("days", "mode")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("days", "mode")); + } + + /** + * 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 SetDefaultRetentionPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetDefaultRetentionPayload.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 SetDefaultRetentionPayload is not found in the empty JSON string", + SetDefaultRetentionPayload.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetDefaultRetentionPayload.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(); + // validate the required field `mode` + RetentionMode.validateJsonElement(jsonObj.get("mode")); + // validate the required field `mode` + RetentionMode.validateJsonElement(jsonObj.get("mode")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetDefaultRetentionPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetDefaultRetentionPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SetDefaultRetentionPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SetDefaultRetentionPayload 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.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SetDefaultRetentionPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SetDefaultRetentionPayload 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 SetDefaultRetentionPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetDefaultRetentionPayload + * @throws IOException if the JSON string is invalid with respect to SetDefaultRetentionPayload + */ + public static SetDefaultRetentionPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetDefaultRetentionPayload.class); + } + + /** + * Convert an instance of SetDefaultRetentionPayload to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +}