diff --git a/CHANGELOG.md b/CHANGELOG.md index 83d0e28b..078d6fd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ - `automation`: [v0.1.0](services/automation/CHANGELOG.md#v010) - Initial onboarding of STACKIT Java SDK for Automation service +- `iaas`: [v1.6.0](services/iaas/CHANGELOG.md#v160) + - `v2alpha1api`: + - **Breaking Change:** In `DestinationCIDRv4`, `DestinationCIDRv6`, `NexthopBlackhole`, `NexthopIPv4`, `NexthopIPv6`, and `NexthopInternet`, changed `type` field from `String` to enum `TypeEnum`. + - **Feature:** Add operations to manage prefix lists: `deletePrefixList`, `getPrefixList`, `getPrefixListEntries`, and `listPrefixLists`. + - **Feature:** Add operations `getRouteOfRoutingTable`, `listAllRoutesOfRoutingTable`, and `retypeVolume`. + - **Feature:** Add new models for routes and prefix lists: `AllRouteListResponse`, `AnyRoute`, `AnyRouteDynamic`, `AnyRouteService`, `AnyRouteSource`, `AnyRouteSourceId`, `AnyRouteStatic`, `AnyRouteSystem`, `BaseRoute`, `PrefixEntries`, `PrefixList`, `PrefixListListResponse`, and `RetypeVolumePayload`. + - **Feature:** Add attribute `description` to model `PartialUpdateNetworkPayload`. + - **Docs:** Update documentation for `labels` field constraints across models. + - `v2api`: + - **Breaking Change:** In `DestinationCIDRv4`, `DestinationCIDRv6`, `NexthopBlackhole`, `NexthopIPv4`, `NexthopIPv6`, and `NexthopInternet`, changed `type` field from `String` to enum `TypeEnum`. + - **Feature:** Add attribute `description` to model `PartialUpdateNetworkPayload`. + - **Feature:** Add attributes `projectType` and `vpcId` to model `Project`. + - **Docs:** Update documentation for `labels` field constraints across models. + - `v2beta1api`: + - **Breaking Change:** In `NexthopBlackhole`, `NexthopIPv4`, `NexthopIPv6`, and `NexthopInternet`, changed `type` field from `String` to enum `TypeEnum`. + - **Feature:** Add attribute `description` to model `PartialUpdateNetworkPayload`. + - **Feature:** Add attributes `projectType` and `vpcId` to model `Project`. + - **Docs:** Update documentation for `labels` field constraints across models. - `objectstorage`: [v0.4.0](services/objectstorage/CHANGELOG.md#v040) - `v1api`: - **Feature:** New model class `RateLimitError` diff --git a/examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSVPCExample.java b/examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSVPCExample.java index b96439b9..54752b39 100644 --- a/examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSVPCExample.java +++ b/examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSVPCExample.java @@ -211,11 +211,14 @@ public static void main(String[] args) throws IOException { .destination( new AddVPCStaticRoutePayloadDestination( new DestinationCIDRv4() - .type("cidrv4") + .type(DestinationCIDRv4.TypeEnum.CIDRV4) .value("0.0.0.0/0"))) .nexthop( new AddVPCStaticRoutePayloadNexthop( - new NexthopInternet().type("internet")))); + new NexthopInternet() + .type( + NexthopInternet.TypeEnum + .INTERNET)))); System.out.println("static route created: " + r.staticRoute.getId()); // create a network range diff --git a/services/iaas/CHANGELOG.md b/services/iaas/CHANGELOG.md index f1f20dd7..116fe33a 100644 --- a/services/iaas/CHANGELOG.md +++ b/services/iaas/CHANGELOG.md @@ -1,3 +1,22 @@ +## v1.6.0 +- `v2alpha1api`: + - **Breaking Change:** In `DestinationCIDRv4`, `DestinationCIDRv6`, `NexthopBlackhole`, `NexthopIPv4`, `NexthopIPv6`, and `NexthopInternet`, changed `type` field from `String` to enum `TypeEnum`. + - **Feature:** Add operations to manage prefix lists: `deletePrefixList`, `getPrefixList`, `getPrefixListEntries`, and `listPrefixLists`. + - **Feature:** Add operations `getRouteOfRoutingTable`, `listAllRoutesOfRoutingTable`, and `retypeVolume`. + - **Feature:** Add new models for routes and prefix lists: `AllRouteListResponse`, `AnyRoute`, `AnyRouteDynamic`, `AnyRouteService`, `AnyRouteSource`, `AnyRouteSourceId`, `AnyRouteStatic`, `AnyRouteSystem`, `BaseRoute`, `PrefixEntries`, `PrefixList`, `PrefixListListResponse`, and `RetypeVolumePayload`. + - **Feature:** Add attribute `description` to model `PartialUpdateNetworkPayload`. + - **Docs:** Update documentation for `labels` field constraints across models. +- `v2api`: + - **Breaking Change:** In `DestinationCIDRv4`, `DestinationCIDRv6`, `NexthopBlackhole`, `NexthopIPv4`, `NexthopIPv6`, and `NexthopInternet`, changed `type` field from `String` to enum `TypeEnum`. + - **Feature:** Add attribute `description` to model `PartialUpdateNetworkPayload`. + - **Feature:** Add attributes `projectType` and `vpcId` to model `Project`. + - **Docs:** Update documentation for `labels` field constraints across models. +- `v2beta1api`: + - **Breaking Change:** In `NexthopBlackhole`, `NexthopIPv4`, `NexthopIPv6`, and `NexthopInternet`, changed `type` field from `String` to enum `TypeEnum`. + - **Feature:** Add attribute `description` to model `PartialUpdateNetworkPayload`. + - **Feature:** Add attributes `projectType` and `vpcId` to model `Project`. + - **Docs:** Update documentation for `labels` field constraints across models. + ## v1.5.0 - **Breaking Change:** Removed the `ServerVTPM` class and the corresponding `vtpm` field from the `Server` model, as this functionality was unintentionally released and non-functional. diff --git a/services/iaas/VERSION b/services/iaas/VERSION index bc80560f..dc1e644a 100644 --- a/services/iaas/VERSION +++ b/services/iaas/VERSION @@ -1 +1 @@ -1.5.0 +1.6.0 diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/JSON.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/JSON.java index 232b9ba5..7c6958c0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/JSON.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/JSON.java @@ -129,6 +129,43 @@ public static GsonBuilder createGson() { getDiscriminatorValue(readElement, "type")); } }) + .registerTypeSelector( + cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute.class, + new TypeSelector< + cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute>() { + @Override + public Class< + ? extends + cloud.stackit.sdk.iaas.v2alpha1api.model + .AnyRoute> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "dynamic", + cloud.stackit.sdk.iaas.v2alpha1api.model + .AnyRouteDynamic.class); + classByDiscriminatorValue.put( + "service", + cloud.stackit.sdk.iaas.v2alpha1api.model + .AnyRouteService.class); + classByDiscriminatorValue.put( + "static", + cloud.stackit.sdk.iaas.v2alpha1api.model + .AnyRouteStatic.class); + classByDiscriminatorValue.put( + "system", + cloud.stackit.sdk.iaas.v2alpha1api.model + .AnyRouteSystem.class); + classByDiscriminatorValue.put( + "AnyRoute", + cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute + .class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) .registerTypeSelector( cloud.stackit.sdk.iaas.v2alpha1api.model .CreateVPCNetworkRangePayload.class, @@ -337,6 +374,31 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2alpha1api.model.AddVPCStaticRoutePayloadNexthop .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.AllRouteListResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRoute.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteDynamic + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteService + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteSource + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteSourceId + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteStatic + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.AnyRouteSystem + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.BaseRoute.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2alpha1api.model.CreateNetworkIPv4 .CustomTypeAdapterFactory()); @@ -407,6 +469,14 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2alpha1api.model.PartialUpdateVPCPayload .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixEntries + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixListListResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2alpha1api.model.RegionalVPC .CustomTypeAdapterFactory()); @@ -416,6 +486,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2alpha1api.model.RegionalVPCList .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2alpha1api.model.RetypeVolumePayload + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2alpha1api.model.Route.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/api/DefaultApi.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/api/DefaultApi.java index 8ca18c08..26957163 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/api/DefaultApi.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/api/DefaultApi.java @@ -22,6 +22,7 @@ import cloud.stackit.sdk.iaas.v2alpha1api.model.AddRoutingTableToAreaPayload; import cloud.stackit.sdk.iaas.v2alpha1api.model.AddVPCRoutingTablePayload; import cloud.stackit.sdk.iaas.v2alpha1api.model.AddVPCStaticRoutePayload; +import cloud.stackit.sdk.iaas.v2alpha1api.model.AllRouteListResponse; import cloud.stackit.sdk.iaas.v2alpha1api.model.CreateNetworkPayload; import cloud.stackit.sdk.iaas.v2alpha1api.model.CreateVPCNetworkRangePayload; import cloud.stackit.sdk.iaas.v2alpha1api.model.CreateVPCPayload; @@ -30,8 +31,12 @@ import cloud.stackit.sdk.iaas.v2alpha1api.model.NetworkListResponse; import cloud.stackit.sdk.iaas.v2alpha1api.model.PartialUpdateNetworkPayload; import cloud.stackit.sdk.iaas.v2alpha1api.model.PartialUpdateVPCPayload; +import cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixEntries; +import cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixList; +import cloud.stackit.sdk.iaas.v2alpha1api.model.PrefixListListResponse; import cloud.stackit.sdk.iaas.v2alpha1api.model.RegionalVPC; import cloud.stackit.sdk.iaas.v2alpha1api.model.RegionalVPCList; +import cloud.stackit.sdk.iaas.v2alpha1api.model.RetypeVolumePayload; import cloud.stackit.sdk.iaas.v2alpha1api.model.Route; import cloud.stackit.sdk.iaas.v2alpha1api.model.RouteListResponse; import cloud.stackit.sdk.iaas.v2alpha1api.model.RoutingTable; @@ -2319,6 +2324,224 @@ public okhttp3.Call deleteNetworkAsync( return localVarCall; } + /** + * Build call for deletePrefixList + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (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
204 Delete request for prefix list has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deletePrefixListCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId, + 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 = + "/v2alpha1/projects/{projectId}/regions/{region}/prefix-lists/{prefixListId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "prefixListId" + "}", + localVarApiClient.escapeString(prefixListId.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 deletePrefixListValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId, + 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 deletePrefixList(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling deletePrefixList(Async)"); + } + + // verify the required parameter 'prefixListId' is set + if (prefixListId == null) { + throw new ApiException( + "Missing the required parameter 'prefixListId' when calling deletePrefixList(Async)"); + } + + return deletePrefixListCall(projectId, region, prefixListId, _callback); + } + + /** + * Delete prefix list. Delete a prefix list. If the prefix list is still in use, the deletion + * will fail. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) + * @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
204 Delete request for prefix list has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public void deletePrefixList( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId) + throws ApiException { + deletePrefixListWithHttpInfo(projectId, region, prefixListId); + } + + /** + * Delete prefix list. Delete a prefix list. If the prefix list is still in use, the deletion + * will fail. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) + * @return ApiResponse<Void> + * @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
204 Delete request for prefix list has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse deletePrefixListWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId) + throws ApiException { + okhttp3.Call localVarCall = + deletePrefixListValidateBeforeCall(projectId, region, prefixListId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete prefix list. (asynchronously) Delete a prefix list. If the prefix list is still in + * use, the deletion will fail. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (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
204 Delete request for prefix list has been accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deletePrefixListAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deletePrefixListValidateBeforeCall(projectId, region, prefixListId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** * Build call for deleteRouteFromRoutingTable * @@ -4193,13 +4416,11 @@ public okhttp3.Call getNetworkAsync( } /** - * Build call for getRouteOfRoutingTable + * Build call for getPrefixList * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4207,7 +4428,7 @@ public okhttp3.Call getNetworkAsync( * * * - * + * * * * @@ -4215,12 +4436,10 @@ public okhttp3.Call getNetworkAsync( * *
Response Details
Status Code Description Response Headers
200 Show the details of a route in a routing table. -
200 Show prefix list details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call getRouteOfRoutingTableCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + public okhttp3.Call getPrefixListCall( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, + @javax.annotation.Nonnull UUID prefixListId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -4240,22 +4459,16 @@ public okhttp3.Call getRouteOfRoutingTableCall( // create path and map variables String localVarPath = - "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "/v2alpha1/projects/{projectId}/regions/{region}/prefix-lists/{prefixListId}" .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) .replace( "{" + "region" + "}", localVarApiClient.escapeString(region.toString())) .replace( - "{" + "routingTableId" + "}", - localVarApiClient.escapeString(routingTableId.toString())) - .replace( - "{" + "routeId" + "}", - localVarApiClient.escapeString(routeId.toString())); + "{" + "prefixListId" + "}", + localVarApiClient.escapeString(prefixListId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4292,65 +4505,47 @@ public okhttp3.Call getRouteOfRoutingTableCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getRouteOfRoutingTableValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + private okhttp3.Call getPrefixListValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, + @javax.annotation.Nonnull UUID prefixListId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling getRouteOfRoutingTable(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling getRouteOfRoutingTable(Async)"); + "Missing the required parameter 'projectId' when calling getPrefixList(Async)"); } // verify the required parameter 'region' is set if (region == null) { throw new ApiException( - "Missing the required parameter 'region' when calling getRouteOfRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling getRouteOfRoutingTable(Async)"); + "Missing the required parameter 'region' when calling getPrefixList(Async)"); } - // verify the required parameter 'routeId' is set - if (routeId == null) { + // verify the required parameter 'prefixListId' is set + if (prefixListId == null) { throw new ApiException( - "Missing the required parameter 'routeId' when calling getRouteOfRoutingTable(Async)"); + "Missing the required parameter 'prefixListId' when calling getPrefixList(Async)"); } - return getRouteOfRoutingTableCall( - organizationId, areaId, region, routingTableId, routeId, _callback); + return getPrefixListCall(projectId, region, prefixListId, _callback); } /** - * Get details about a route of a routing table. Get details about a route defined in a routing - * table of a network area. + * Get prefix list details. Get details about a prefix list of a project. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @return Route + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) + * @return PrefixList * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -4358,22 +4553,482 @@ private okhttp3.Call getRouteOfRoutingTableValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show the details of a route in a routing table. -
200 Show prefix list details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public Route getRouteOfRoutingTable( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + public PrefixList getPrefixList( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId) + @javax.annotation.Nonnull UUID prefixListId) throws ApiException { - ApiResponse localVarResp = - getRouteOfRoutingTableWithHttpInfo( - organizationId, areaId, region, routingTableId, routeId); + ApiResponse localVarResp = + getPrefixListWithHttpInfo(projectId, region, prefixListId); return localVarResp.getData(); } /** - * Get details about a route of a routing table. Get details about a route defined in a routing - * table of a network area. + * Get prefix list details. Get details about a prefix list of a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) + * @return ApiResponse<PrefixList> + * @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 Show prefix list details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getPrefixListWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId) + throws ApiException { + okhttp3.Call localVarCall = + getPrefixListValidateBeforeCall(projectId, region, prefixListId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get prefix list details. (asynchronously) Get details about a prefix list of a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (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 Show prefix list details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getPrefixListAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getPrefixListValidateBeforeCall(projectId, region, prefixListId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getPrefixListEntries + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (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 Get prefix list entries was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getPrefixListEntriesCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId, + 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 = + "/v2alpha1/projects/{projectId}/regions/{region}/prefix-lists/{prefixListId}/entries" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "prefixListId" + "}", + localVarApiClient.escapeString(prefixListId.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 getPrefixListEntriesValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId, + 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 getPrefixListEntries(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getPrefixListEntries(Async)"); + } + + // verify the required parameter 'prefixListId' is set + if (prefixListId == null) { + throw new ApiException( + "Missing the required parameter 'prefixListId' when calling getPrefixListEntries(Async)"); + } + + return getPrefixListEntriesCall(projectId, region, prefixListId, _callback); + } + + /** + * Get prefix list entries. Get the list of all CIDR entries in a prefix list. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) + * @return PrefixEntries + * @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 Get prefix list entries was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public PrefixEntries getPrefixListEntries( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId) + throws ApiException { + ApiResponse localVarResp = + getPrefixListEntriesWithHttpInfo(projectId, region, prefixListId); + return localVarResp.getData(); + } + + /** + * Get prefix list entries. Get the list of all CIDR entries in a prefix list. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (required) + * @return ApiResponse<PrefixEntries> + * @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 Get prefix list entries was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getPrefixListEntriesWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId) + throws ApiException { + okhttp3.Call localVarCall = + getPrefixListEntriesValidateBeforeCall(projectId, region, prefixListId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get prefix list entries. (asynchronously) Get the list of all CIDR entries in a prefix list. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param prefixListId The identifier (ID) of a STACKIT Prefix List. (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 Get prefix list entries was successful. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getPrefixListEntriesAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID prefixListId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getPrefixListEntriesValidateBeforeCall(projectId, region, prefixListId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getRouteOfRoutingTable + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param region The STACKIT Region of the resources. (required) + * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) + * @param routeId The identifier (ID) of a STACKIT Route. (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 Show the details of a route in a routing table. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getRouteOfRoutingTableCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull UUID routeId, + 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 = + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "routingTableId" + "}", + localVarApiClient.escapeString(routingTableId.toString())) + .replace( + "{" + "routeId" + "}", + localVarApiClient.escapeString(routeId.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 getRouteOfRoutingTableValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull UUID routeId, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException( + "Missing the required parameter 'organizationId' when calling getRouteOfRoutingTable(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling getRouteOfRoutingTable(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getRouteOfRoutingTable(Async)"); + } + + // verify the required parameter 'routingTableId' is set + if (routingTableId == null) { + throw new ApiException( + "Missing the required parameter 'routingTableId' when calling getRouteOfRoutingTable(Async)"); + } + + // verify the required parameter 'routeId' is set + if (routeId == null) { + throw new ApiException( + "Missing the required parameter 'routeId' when calling getRouteOfRoutingTable(Async)"); + } + + return getRouteOfRoutingTableCall( + organizationId, areaId, region, routingTableId, routeId, _callback); + } + + /** + * Get details about a route of a routing table. Get details about a route defined in a routing + * table of a network area. + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param region The STACKIT Region of the resources. (required) + * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) + * @param routeId The identifier (ID) of a STACKIT Route. (required) + * @return Route + * @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 Show the details of a route in a routing table. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Route getRouteOfRoutingTable( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull UUID routeId) + throws ApiException { + ApiResponse localVarResp = + getRouteOfRoutingTableWithHttpInfo( + organizationId, areaId, region, routingTableId, routeId); + return localVarResp.getData(); + } + + /** + * Get details about a route of a routing table. Get details about a route defined in a routing + * table of a network area. * * @param organizationId The identifier (ID) of a STACKIT Organization. (required) * @param areaId The identifier (ID) of a STACKIT Network Area. (required) @@ -5830,15 +6485,274 @@ public ApiResponse getVPCStaticRouteWithHttpInfo( } /** - * Get details about a regional static route. (asynchronously) Get details about a static route - * of a VPC for this region. + * Get details about a regional static route. (asynchronously) Get details about a static route + * of a VPC for this region. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. + * (required) + * @param region The STACKIT Region of the resources. (required) + * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) + * @param routeId The identifier (ID) of a STACKIT Route. (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 Show static route details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getVPCStaticRouteAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID vpcId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull UUID routeId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getVPCStaticRouteValidateBeforeCall( + projectId, vpcId, region, routingTableId, routeId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listAllRoutesOfRoutingTable + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param region The STACKIT Region of the resources. (required) + * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) + * @param filter Filter resources by fields. A subset of expr-lang is supported. See + * https://expr-lang.org/docs/language-definition for usage details. (optional) + * @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 List all routes of a routing table including system, dynamic, service and static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listAllRoutesOfRoutingTableCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nullable String filter, + 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 = + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/all-routes" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "routingTableId" + "}", + localVarApiClient.escapeString(routingTableId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (filter != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter)); + } + + 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 listAllRoutesOfRoutingTableValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nullable String filter, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException( + "Missing the required parameter 'organizationId' when calling listAllRoutesOfRoutingTable(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling listAllRoutesOfRoutingTable(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling listAllRoutesOfRoutingTable(Async)"); + } + + // verify the required parameter 'routingTableId' is set + if (routingTableId == null) { + throw new ApiException( + "Missing the required parameter 'routingTableId' when calling listAllRoutesOfRoutingTable(Async)"); + } + + return listAllRoutesOfRoutingTableCall( + organizationId, areaId, region, routingTableId, filter, _callback); + } + + /** + * List all routes of a routing table. Get a list of all routes in a routing table including + * system, dynamic, service and static routes. + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param region The STACKIT Region of the resources. (required) + * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) + * @param filter Filter resources by fields. A subset of expr-lang is supported. See + * https://expr-lang.org/docs/language-definition for usage details. (optional) + * @return AllRouteListResponse + * @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 List all routes of a routing table including system, dynamic, service and static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public AllRouteListResponse listAllRoutesOfRoutingTable( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nullable String filter) + throws ApiException { + ApiResponse localVarResp = + listAllRoutesOfRoutingTableWithHttpInfo( + organizationId, areaId, region, routingTableId, filter); + return localVarResp.getData(); + } + + /** + * List all routes of a routing table. Get a list of all routes in a routing table including + * system, dynamic, service and static routes. + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param region The STACKIT Region of the resources. (required) + * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) + * @param filter Filter resources by fields. A subset of expr-lang is supported. See + * https://expr-lang.org/docs/language-definition for usage details. (optional) + * @return ApiResponse<AllRouteListResponse> + * @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 List all routes of a routing table including system, dynamic, service and static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse listAllRoutesOfRoutingTableWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nullable String filter) + throws ApiException { + okhttp3.Call localVarCall = + listAllRoutesOfRoutingTableValidateBeforeCall( + organizationId, areaId, region, routingTableId, filter, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List all routes of a routing table. (asynchronously) Get a list of all routes in a routing + * table including system, dynamic, service and static routes. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param vpcId The unique identifier (ID) of the target STACKIT VPC in the request path. - * (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) * @param region The STACKIT Region of the resources. (required) * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) + * @param filter Filter resources by fields. A subset of expr-lang is supported. See + * https://expr-lang.org/docs/language-definition for usage details. (optional) * @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 @@ -5847,28 +6761,27 @@ public ApiResponse getVPCStaticRouteWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
200 Show static route details. -
200 List all routes of a routing table including system, dynamic, service and static routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
424 The region of the vpc is not enabled. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call getVPCStaticRouteAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID vpcId, + public okhttp3.Call listAllRoutesOfRoutingTableAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID routingTableId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) + @javax.annotation.Nullable String filter, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getVPCStaticRouteValidateBeforeCall( - projectId, vpcId, region, routingTableId, routeId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listAllRoutesOfRoutingTableValidateBeforeCall( + organizationId, areaId, region, routingTableId, filter, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -6185,53 +7098,275 @@ private okhttp3.Call listNetworksOfRoutingTableValidateBeforeCall( @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull UUID routingTableId, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException( + "Missing the required parameter 'organizationId' when calling listNetworksOfRoutingTable(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling listNetworksOfRoutingTable(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling listNetworksOfRoutingTable(Async)"); + } + + // verify the required parameter 'routingTableId' is set + if (routingTableId == null) { + throw new ApiException( + "Missing the required parameter 'routingTableId' when calling listNetworksOfRoutingTable(Async)"); + } + + return listNetworksOfRoutingTableCall( + organizationId, areaId, region, routingTableId, _callback); + } + + /** + * List all networks in a routing table. Get a list of all networks in a routing table of a + * network area. + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param region The STACKIT Region of the resources. (required) + * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) + * @return NetworkListResponse + * @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 List all routing table networks. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public NetworkListResponse listNetworksOfRoutingTable( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId) + throws ApiException { + ApiResponse localVarResp = + listNetworksOfRoutingTableWithHttpInfo( + organizationId, areaId, region, routingTableId); + return localVarResp.getData(); + } + + /** + * List all networks in a routing table. Get a list of all networks in a routing table of a + * network area. + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param region The STACKIT Region of the resources. (required) + * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) + * @return ApiResponse<NetworkListResponse> + * @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 List all routing table networks. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse listNetworksOfRoutingTableWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId) + throws ApiException { + okhttp3.Call localVarCall = + listNetworksOfRoutingTableValidateBeforeCall( + organizationId, areaId, region, routingTableId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List all networks in a routing table. (asynchronously) Get a list of all networks in a + * routing table of a network area. + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param region The STACKIT Region of the resources. (required) + * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (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 List all routing table networks. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listNetworksOfRoutingTableAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listNetworksOfRoutingTableValidateBeforeCall( + organizationId, areaId, region, routingTableId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listPrefixLists + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @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 List all prefix lists of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listPrefixListsCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, + 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 = + "/v2alpha1/projects/{projectId}/regions/{region}/prefix-lists" + .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(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + 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 listPrefixListsValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { - throw new ApiException( - "Missing the required parameter 'organizationId' when calling listNetworksOfRoutingTable(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling listNetworksOfRoutingTable(Async)"); + "Missing the required parameter 'projectId' when calling listPrefixLists(Async)"); } // verify the required parameter 'region' is set if (region == null) { throw new ApiException( - "Missing the required parameter 'region' when calling listNetworksOfRoutingTable(Async)"); - } - - // verify the required parameter 'routingTableId' is set - if (routingTableId == null) { - throw new ApiException( - "Missing the required parameter 'routingTableId' when calling listNetworksOfRoutingTable(Async)"); + "Missing the required parameter 'region' when calling listPrefixLists(Async)"); } - return listNetworksOfRoutingTableCall( - organizationId, areaId, region, routingTableId, _callback); + return listPrefixListsCall(projectId, region, labelSelector, _callback); } /** - * List all networks in a routing table. Get a list of all networks in a routing table of a - * network area. + * List all prefix lists inside a project. Get a list of all prefix lists inside a project. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @return NetworkListResponse + * @param labelSelector Filter resources by labels. (optional) + * @return PrefixListListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -6239,34 +7374,30 @@ private okhttp3.Call listNetworksOfRoutingTableValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List all routing table networks. -
200 List all prefix lists of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public NetworkListResponse listNetworksOfRoutingTable( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + public PrefixListListResponse listPrefixLists( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) + @javax.annotation.Nullable String labelSelector) throws ApiException { - ApiResponse localVarResp = - listNetworksOfRoutingTableWithHttpInfo( - organizationId, areaId, region, routingTableId); + ApiResponse localVarResp = + listPrefixListsWithHttpInfo(projectId, region, labelSelector); return localVarResp.getData(); } /** - * List all networks in a routing table. Get a list of all networks in a routing table of a - * network area. + * List all prefix lists inside a project. Get a list of all prefix lists inside a project. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) - * @return ApiResponse<NetworkListResponse> + * @param labelSelector Filter resources by labels. (optional) + * @return ApiResponse<PrefixListListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -6274,27 +7405,24 @@ public NetworkListResponse listNetworksOfRoutingTable( * *
Response Details
Status Code Description Response Headers
200 List all routing table networks. -
200 List all prefix lists of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ApiResponse listNetworksOfRoutingTableWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + public ApiResponse listPrefixListsWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId) + @javax.annotation.Nullable String labelSelector) throws ApiException { okhttp3.Call localVarCall = - listNetworksOfRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + listPrefixListsValidateBeforeCall(projectId, region, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all networks in a routing table. (asynchronously) Get a list of all networks in a - * routing table of a network area. + * List all prefix lists inside a project. (asynchronously) Get a list of all prefix lists + * inside a project. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) * @param region The STACKIT Region of the resources. (required) - * @param routingTableId The identifier (ID) of a STACKIT Routing Table. (required) + * @param labelSelector Filter resources by labels. (optional) * @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 @@ -6303,7 +7431,7 @@ public ApiResponse listNetworksOfRoutingTableWithHttpInfo( * * * - * + * * * * @@ -6311,18 +7439,16 @@ public ApiResponse listNetworksOfRoutingTableWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List all routing table networks. -
200 List all prefix lists of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call listNetworksOfRoutingTableAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + public okhttp3.Call listPrefixListsAsync( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String region, - @javax.annotation.Nonnull UUID routingTableId, - final ApiCallback _callback) + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listNetworksOfRoutingTableValidateBeforeCall( - organizationId, areaId, region, routingTableId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listPrefixListsValidateBeforeCall(projectId, region, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -8464,6 +9590,241 @@ public okhttp3.Call partialUpdateVPCAsync( return localVarCall; } + /** + * Build call for retypeVolume + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param retypeVolumePayload Request a volume retype. (optional) + * @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
202 Volume retype request accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call retypeVolumeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable RetypeVolumePayload retypeVolumePayload, + 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 = retypeVolumePayload; + + // create path and map variables + String localVarPath = + "/v2alpha1/projects/{projectId}/regions/{region}/volumes/{volumeId}/retype" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "volumeId" + "}", + localVarApiClient.escapeString(volumeId.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, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call retypeVolumeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable RetypeVolumePayload retypeVolumePayload, + 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 retypeVolume(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling retypeVolume(Async)"); + } + + // verify the required parameter 'volumeId' is set + if (volumeId == null) { + throw new ApiException( + "Missing the required parameter 'volumeId' when calling retypeVolume(Async)"); + } + + return retypeVolumeCall(projectId, region, volumeId, retypeVolumePayload, _callback); + } + + /** + * Update the performanceClass of a volume. Update the performanceClass of a block device + * volume. This request can only be performend once in 7 days if the requested performanceClass + * is slower compared to the current one. Upgrades to faster performanceClasses are always + * allowed. This operation is async can take a few minutes to complete. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param retypeVolumePayload Request a volume retype. (optional) + * @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
202 Volume retype request accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public void retypeVolume( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable RetypeVolumePayload retypeVolumePayload) + throws ApiException { + retypeVolumeWithHttpInfo(projectId, region, volumeId, retypeVolumePayload); + } + + /** + * Update the performanceClass of a volume. Update the performanceClass of a block device + * volume. This request can only be performend once in 7 days if the requested performanceClass + * is slower compared to the current one. Upgrades to faster performanceClasses are always + * allowed. This operation is async can take a few minutes to complete. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param retypeVolumePayload Request a volume retype. (optional) + * @return ApiResponse<Void> + * @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
202 Volume retype request accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse retypeVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable RetypeVolumePayload retypeVolumePayload) + throws ApiException { + okhttp3.Call localVarCall = + retypeVolumeValidateBeforeCall( + projectId, region, volumeId, retypeVolumePayload, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update the performanceClass of a volume. (asynchronously) Update the performanceClass of a + * block device volume. This request can only be performend once in 7 days if the requested + * performanceClass is slower compared to the current one. Upgrades to faster performanceClasses + * are always allowed. This operation is async can take a few minutes to complete. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param retypeVolumePayload Request a volume retype. (optional) + * @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
202 Volume retype request accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call retypeVolumeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable RetypeVolumePayload retypeVolumePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + retypeVolumeValidateBeforeCall( + projectId, region, volumeId, retypeVolumePayload, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** * Build call for updateRouteOfRoutingTable * diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddRoutingTableToAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddRoutingTableToAreaPayload.java index 6a302d0d..e3af711f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddRoutingTableToAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddRoutingTableToAreaPayload.java @@ -167,11 +167,21 @@ public AddRoutingTableToAreaPayload labels(@javax.annotation.Nullable Object lab } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCRoutingTablePayload.java index 3139a5a1..5aa0e304 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCRoutingTablePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCRoutingTablePayload.java @@ -150,11 +150,21 @@ public AddVPCRoutingTablePayload labels(@javax.annotation.Nullable Object labels } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayload.java index ab4703bc..f0c09ec1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AddVPCStaticRoutePayload.java @@ -121,11 +121,21 @@ public AddVPCStaticRoutePayload labels(@javax.annotation.Nullable Object labels) } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AllRouteListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AllRouteListResponse.java new file mode 100644 index 00000000..9aafb7e9 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AllRouteListResponse.java @@ -0,0 +1,324 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +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.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** All routes list response. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class AllRouteListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public AllRouteListResponse() {} + + public AllRouteListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public AllRouteListResponse addItemsItem(AnyRoute itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of all routes. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + /** + * 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 AllRouteListResponse instance itself + */ + public AllRouteListResponse 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; + } + AllRouteListResponse allRouteListResponse = (AllRouteListResponse) o; + return Objects.equals(this.items, allRouteListResponse.items) + && Objects.equals( + this.additionalProperties, allRouteListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(items, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllRouteListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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("items")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("items")); + } + + /** + * 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 AllRouteListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AllRouteListResponse.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 AllRouteListResponse is not found in the empty JSON string", + AllRouteListResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AllRouteListResponse.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(); + // ensure the json data is an array + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + AnyRoute.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllRouteListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllRouteListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AllRouteListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AllRouteListResponse 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 AllRouteListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AllRouteListResponse 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 AllRouteListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllRouteListResponse + * @throws IOException if the JSON string is invalid with respect to AllRouteListResponse + */ + public static AllRouteListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllRouteListResponse.class); + } + + /** + * Convert an instance of AllRouteListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRoute.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRoute.java new file mode 100644 index 00000000..3b4e5348 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRoute.java @@ -0,0 +1,402 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +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.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class AnyRoute extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AnyRoute.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnyRoute.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnyRoute' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAnyRouteStatic = + gson.getDelegateAdapter(this, TypeToken.get(AnyRouteStatic.class)); + final TypeAdapter adapterAnyRouteDynamic = + gson.getDelegateAdapter(this, TypeToken.get(AnyRouteDynamic.class)); + final TypeAdapter adapterAnyRouteSystem = + gson.getDelegateAdapter(this, TypeToken.get(AnyRouteSystem.class)); + final TypeAdapter adapterAnyRouteService = + gson.getDelegateAdapter(this, TypeToken.get(AnyRouteService.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AnyRoute value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AnyRouteStatic` + if (value.getActualInstance() instanceof AnyRouteStatic) { + JsonElement element = + adapterAnyRouteStatic.toJsonTree( + (AnyRouteStatic) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AnyRouteDynamic` + if (value.getActualInstance() instanceof AnyRouteDynamic) { + JsonElement element = + adapterAnyRouteDynamic.toJsonTree( + (AnyRouteDynamic) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AnyRouteSystem` + if (value.getActualInstance() instanceof AnyRouteSystem) { + JsonElement element = + adapterAnyRouteSystem.toJsonTree( + (AnyRouteSystem) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AnyRouteService` + if (value.getActualInstance() instanceof AnyRouteService) { + JsonElement element = + adapterAnyRouteService.toJsonTree( + (AnyRouteService) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas: AnyRouteDynamic, AnyRouteService, AnyRouteStatic, AnyRouteSystem"); + } + + @Override + public AnyRoute read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AnyRouteStatic + try { + // validate the JSON object to see if any exception is thrown + AnyRouteStatic.validateJsonElement(jsonElement); + actualAdapter = adapterAnyRouteStatic; + match++; + log.log(Level.FINER, "Input data matches schema 'AnyRouteStatic'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for AnyRouteStatic failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AnyRouteStatic'", + e); + } + // deserialize AnyRouteDynamic + try { + // validate the JSON object to see if any exception is thrown + AnyRouteDynamic.validateJsonElement(jsonElement); + actualAdapter = adapterAnyRouteDynamic; + match++; + log.log(Level.FINER, "Input data matches schema 'AnyRouteDynamic'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for AnyRouteDynamic failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AnyRouteDynamic'", + e); + } + // deserialize AnyRouteSystem + try { + // validate the JSON object to see if any exception is thrown + AnyRouteSystem.validateJsonElement(jsonElement); + actualAdapter = adapterAnyRouteSystem; + match++; + log.log(Level.FINER, "Input data matches schema 'AnyRouteSystem'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for AnyRouteSystem failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AnyRouteSystem'", + e); + } + // deserialize AnyRouteService + try { + // validate the JSON object to see if any exception is thrown + AnyRouteService.validateJsonElement(jsonElement); + actualAdapter = adapterAnyRouteService; + match++; + log.log(Level.FINER, "Input data matches schema 'AnyRouteService'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for AnyRouteService failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AnyRouteService'", + e); + } + + if (match == 1) { + AnyRoute ret = new AnyRoute(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + java.util.Locale.ROOT, + "Failed deserialization for AnyRoute: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", + match, + errorMessages, + jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public AnyRoute() { + super("oneOf", Boolean.FALSE); + } + + public AnyRoute(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AnyRouteStatic", AnyRouteStatic.class); + schemas.put("AnyRouteDynamic", AnyRouteDynamic.class); + schemas.put("AnyRouteSystem", AnyRouteSystem.class); + schemas.put("AnyRouteService", AnyRouteService.class); + } + + @Override + public Map> getSchemas() { + return AnyRoute.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: AnyRouteDynamic, AnyRouteService, AnyRouteStatic, + * AnyRouteSystem + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AnyRouteStatic) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AnyRouteDynamic) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AnyRouteSystem) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AnyRouteService) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be AnyRouteDynamic, AnyRouteService, AnyRouteStatic, AnyRouteSystem"); + } + + /** + * Get the actual instance, which can be the following: AnyRouteDynamic, AnyRouteService, + * AnyRouteStatic, AnyRouteSystem + * + * @return The actual instance (AnyRouteDynamic, AnyRouteService, AnyRouteStatic, + * AnyRouteSystem) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AnyRouteStatic`. If the actual instance is not `AnyRouteStatic`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AnyRouteStatic` + * @throws ClassCastException if the instance is not `AnyRouteStatic` + */ + public AnyRouteStatic getAnyRouteStatic() throws ClassCastException { + return (AnyRouteStatic) super.getActualInstance(); + } + + /** + * Get the actual instance of `AnyRouteDynamic`. If the actual instance is not + * `AnyRouteDynamic`, the ClassCastException will be thrown. + * + * @return The actual instance of `AnyRouteDynamic` + * @throws ClassCastException if the instance is not `AnyRouteDynamic` + */ + public AnyRouteDynamic getAnyRouteDynamic() throws ClassCastException { + return (AnyRouteDynamic) super.getActualInstance(); + } + + /** + * Get the actual instance of `AnyRouteSystem`. If the actual instance is not `AnyRouteSystem`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AnyRouteSystem` + * @throws ClassCastException if the instance is not `AnyRouteSystem` + */ + public AnyRouteSystem getAnyRouteSystem() throws ClassCastException { + return (AnyRouteSystem) super.getActualInstance(); + } + + /** + * Get the actual instance of `AnyRouteService`. If the actual instance is not + * `AnyRouteService`, the ClassCastException will be thrown. + * + * @return The actual instance of `AnyRouteService` + * @throws ClassCastException if the instance is not `AnyRouteService` + */ + public AnyRouteService getAnyRouteService() throws ClassCastException { + return (AnyRouteService) super.getActualInstance(); + } + + /** + * 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 AnyRoute + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with AnyRouteStatic + try { + AnyRouteStatic.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for AnyRouteStatic failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with AnyRouteDynamic + try { + AnyRouteDynamic.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for AnyRouteDynamic failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with AnyRouteSystem + try { + AnyRouteSystem.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for AnyRouteSystem failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with AnyRouteService + try { + AnyRouteService.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for AnyRouteService failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + java.util.Locale.ROOT, + "The JSON string is invalid for AnyRoute with oneOf schemas: AnyRouteDynamic, AnyRouteService, AnyRouteStatic, AnyRouteSystem. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", + validCount, + errorMessages, + jsonElement.toString())); + } + } + + /** + * Create an instance of AnyRoute given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnyRoute + * @throws IOException if the JSON string is invalid with respect to AnyRoute + */ + public static AnyRoute fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnyRoute.class); + } + + /** + * Convert an instance of AnyRoute to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteDynamic.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteDynamic.java new file mode 100644 index 00000000..6c563c75 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteDynamic.java @@ -0,0 +1,364 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.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; + +/** Object representing route of type dynamic. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class AnyRouteDynamic { + public static final String SERIALIZED_NAME_DESTINATION = "destination"; + + @SerializedName(SERIALIZED_NAME_DESTINATION) + @javax.annotation.Nonnull + private RouteDestination destination; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable private AnyRouteSource source; + + public AnyRouteDynamic() {} + + public AnyRouteDynamic destination(@javax.annotation.Nonnull RouteDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination + */ + @javax.annotation.Nonnull + public RouteDestination getDestination() { + return destination; + } + + public void setDestination(@javax.annotation.Nonnull RouteDestination destination) { + this.destination = destination; + } + + public AnyRouteDynamic type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of the route. Possible values: `STATIC`, `DYNAMIC`, + * `SYSTEM`, `SERVICE`. + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + public AnyRouteDynamic source(@javax.annotation.Nullable AnyRouteSource source) { + this.source = source; + return this; + } + + /** + * Get source + * + * @return source + */ + @javax.annotation.Nullable public AnyRouteSource getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable AnyRouteSource source) { + this.source = source; + } + + /** + * 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 AnyRouteDynamic instance itself + */ + public AnyRouteDynamic 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; + } + AnyRouteDynamic anyRouteDynamic = (AnyRouteDynamic) o; + return Objects.equals(this.destination, anyRouteDynamic.destination) + && Objects.equals(this.type, anyRouteDynamic.type) + && Objects.equals(this.source, anyRouteDynamic.source) + && Objects.equals(this.additionalProperties, anyRouteDynamic.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(destination, type, source, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnyRouteDynamic {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).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("destination", "type", "source")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("destination", "type")); + } + + /** + * 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 AnyRouteDynamic + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnyRouteDynamic.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 AnyRouteDynamic is not found in the empty JSON string", + AnyRouteDynamic.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnyRouteDynamic.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 `destination` + RouteDestination.validateJsonElement(jsonObj.get("destination")); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `type` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("type").toString())); + } + // validate the optional field `source` + if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { + AnyRouteSource.validateJsonElement(jsonObj.get("source")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnyRouteDynamic.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnyRouteDynamic' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AnyRouteDynamic.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AnyRouteDynamic 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 AnyRouteDynamic read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnyRouteDynamic 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 AnyRouteDynamic given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnyRouteDynamic + * @throws IOException if the JSON string is invalid with respect to AnyRouteDynamic + */ + public static AnyRouteDynamic fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnyRouteDynamic.class); + } + + /** + * Convert an instance of AnyRouteDynamic to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteService.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteService.java new file mode 100644 index 00000000..7356b0e5 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteService.java @@ -0,0 +1,364 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.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; + +/** Object representing route of type service. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class AnyRouteService { + public static final String SERIALIZED_NAME_DESTINATION = "destination"; + + @SerializedName(SERIALIZED_NAME_DESTINATION) + @javax.annotation.Nonnull + private RouteDestination destination; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable private AnyRouteSource source; + + public AnyRouteService() {} + + public AnyRouteService destination(@javax.annotation.Nonnull RouteDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination + */ + @javax.annotation.Nonnull + public RouteDestination getDestination() { + return destination; + } + + public void setDestination(@javax.annotation.Nonnull RouteDestination destination) { + this.destination = destination; + } + + public AnyRouteService type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of the route. Possible values: `STATIC`, `DYNAMIC`, + * `SYSTEM`, `SERVICE`. + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + public AnyRouteService source(@javax.annotation.Nullable AnyRouteSource source) { + this.source = source; + return this; + } + + /** + * Get source + * + * @return source + */ + @javax.annotation.Nullable public AnyRouteSource getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable AnyRouteSource source) { + this.source = source; + } + + /** + * 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 AnyRouteService instance itself + */ + public AnyRouteService 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; + } + AnyRouteService anyRouteService = (AnyRouteService) o; + return Objects.equals(this.destination, anyRouteService.destination) + && Objects.equals(this.type, anyRouteService.type) + && Objects.equals(this.source, anyRouteService.source) + && Objects.equals(this.additionalProperties, anyRouteService.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(destination, type, source, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnyRouteService {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).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("destination", "type", "source")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("destination", "type")); + } + + /** + * 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 AnyRouteService + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnyRouteService.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 AnyRouteService is not found in the empty JSON string", + AnyRouteService.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnyRouteService.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 `destination` + RouteDestination.validateJsonElement(jsonObj.get("destination")); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `type` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("type").toString())); + } + // validate the optional field `source` + if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { + AnyRouteSource.validateJsonElement(jsonObj.get("source")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnyRouteService.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnyRouteService' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AnyRouteService.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AnyRouteService 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 AnyRouteService read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnyRouteService 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 AnyRouteService given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnyRouteService + * @throws IOException if the JSON string is invalid with respect to AnyRouteService + */ + public static AnyRouteService fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnyRouteService.class); + } + + /** + * Convert an instance of AnyRouteService to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSource.java new file mode 100644 index 00000000..17d2edc0 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSource.java @@ -0,0 +1,333 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.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; + +/** Object that represents the source information for any route. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class AnyRouteSource { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private AnyRouteSourceId id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public AnyRouteSource() {} + + public AnyRouteSource id(@javax.annotation.Nullable AnyRouteSourceId id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable public AnyRouteSourceId getId() { + return id; + } + + public void setId(@javax.annotation.Nullable AnyRouteSourceId id) { + this.id = id; + } + + public AnyRouteSource type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The origin of the route. + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + /** + * 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 AnyRouteSource instance itself + */ + public AnyRouteSource 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; + } + AnyRouteSource anyRouteSource = (AnyRouteSource) o; + return Objects.equals(this.id, anyRouteSource.id) + && Objects.equals(this.type, anyRouteSource.type) + && Objects.equals(this.additionalProperties, anyRouteSource.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnyRouteSource {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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("id", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type")); + } + + /** + * 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 AnyRouteSource + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnyRouteSource.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 AnyRouteSource is not found in the empty JSON string", + AnyRouteSource.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnyRouteSource.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 optional field `id` + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) { + AnyRouteSourceId.validateJsonElement(jsonObj.get("id")); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `type` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnyRouteSource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnyRouteSource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AnyRouteSource.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AnyRouteSource 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 AnyRouteSource read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnyRouteSource 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 AnyRouteSource given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnyRouteSource + * @throws IOException if the JSON string is invalid with respect to AnyRouteSource + */ + public static AnyRouteSource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnyRouteSource.class); + } + + /** + * Convert an instance of AnyRouteSource to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSourceId.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSourceId.java new file mode 100644 index 00000000..1e784314 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSourceId.java @@ -0,0 +1,284 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonPrimitive; +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.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; + +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class AnyRouteSourceId extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AnyRouteSourceId.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnyRouteSourceId.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnyRouteSourceId' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterUUID = + gson.getDelegateAdapter(this, TypeToken.get(UUID.class)); + final TypeAdapter adapterString = + gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AnyRouteSourceId value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `UUID` + if (value.getActualInstance() instanceof UUID) { + JsonElement element = + adapterUUID.toJsonTree((UUID) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = + adapterString + .toJsonTree((String) value.getActualInstance()) + .getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemas: String, UUID"); + } + + @Override + public AnyRouteSourceId read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize UUID + try { + // validate the JSON object to see if any exception is thrown + UUID.fromString(jsonElement.getAsString()); + actualAdapter = adapterUUID; + AnyRouteSourceId ret = new AnyRouteSourceId(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for UUID failed with `%s`.", + e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UUID'", e); + } + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected json element to be of type String in the JSON string but got `%s`", + jsonElement.toString())); + } + actualAdapter = adapterString; + AnyRouteSourceId ret = new AnyRouteSourceId(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for String failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'String'", + e); + } + + throw new IOException( + String.format( + java.util.Locale.ROOT, + "Failed deserialization for AnyRouteSourceId: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", + errorMessages, + jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public AnyRouteSourceId() { + super("anyOf", Boolean.FALSE); + } + + public AnyRouteSourceId(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("UUID", UUID.class); + schemas.put("String", String.class); + } + + @Override + public Map> getSchemas() { + return AnyRouteSourceId.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: String, UUID + * + *

It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof UUID) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be String, UUID"); + } + + /** + * Get the actual instance, which can be the following: String, UUID + * + * @return The actual instance (String, UUID) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `UUID`. If the actual instance is not `UUID`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `UUID` + * @throws ClassCastException if the instance is not `UUID` + */ + public UUID getUUID() throws ClassCastException { + return (UUID) super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String) super.getActualInstance(); + } + + /** + * 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 AnyRouteSourceId + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with UUID + try { + UUID.fromString(jsonElement.getAsString()); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for UUID failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected json element to be of type String in the JSON string but got `%s`", + jsonElement.toString())); + } + return; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for String failed with `%s`.", + e.getMessage())); + // continue to the next one + } + throw new IOException( + String.format( + java.util.Locale.ROOT, + "The JSON string is invalid for AnyRouteSourceId with anyOf schemas: String, UUID. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", + errorMessages, + jsonElement.toString())); + } + + /** + * Create an instance of AnyRouteSourceId given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnyRouteSourceId + * @throws IOException if the JSON string is invalid with respect to AnyRouteSourceId + */ + public static AnyRouteSourceId fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnyRouteSourceId.class); + } + + /** + * Convert an instance of AnyRouteSourceId to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteStatic.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteStatic.java new file mode 100644 index 00000000..dfdfd62e --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteStatic.java @@ -0,0 +1,534 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Object that represents route of type static. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class AnyRouteStatic { + public static final String SERIALIZED_NAME_DESTINATION = "destination"; + + @SerializedName(SERIALIZED_NAME_DESTINATION) + @javax.annotation.Nonnull + private RouteDestination destination; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_ERROR = "error"; + + @SerializedName(SERIALIZED_NAME_ERROR) + @javax.annotation.Nullable private String error; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private UUID id; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_NEXTHOP = "nexthop"; + + @SerializedName(SERIALIZED_NAME_NEXTHOP) + @javax.annotation.Nonnull + private RouteNexthop nexthop; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public AnyRouteStatic() {} + + public AnyRouteStatic(OffsetDateTime createdAt, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public AnyRouteStatic destination(@javax.annotation.Nonnull RouteDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination + */ + @javax.annotation.Nonnull + public RouteDestination getDestination() { + return destination; + } + + public void setDestination(@javax.annotation.Nonnull RouteDestination destination) { + this.destination = destination; + } + + public AnyRouteStatic type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of the route. Possible values: `STATIC`, `DYNAMIC`, + * `SYSTEM`, `SERVICE`. + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public AnyRouteStatic error(@javax.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Displays an error message with the reason why the route is invalid. Invalid routes are not + * applied and therefore not considered in the routing. A route can become invalid on creation + * and during its life-cycle. + * + * @return error + */ + @javax.annotation.Nullable public String getError() { + return error; + } + + public void setError(@javax.annotation.Nullable String error) { + this.error = error; + } + + public AnyRouteStatic id(@javax.annotation.Nonnull UUID id) { + this.id = id; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nonnull + public UUID getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull UUID id) { + this.id = id; + } + + public AnyRouteStatic labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public AnyRouteStatic nexthop(@javax.annotation.Nonnull RouteNexthop nexthop) { + this.nexthop = nexthop; + return this; + } + + /** + * Get nexthop + * + * @return nexthop + */ + @javax.annotation.Nonnull + public RouteNexthop getNexthop() { + return nexthop; + } + + public void setNexthop(@javax.annotation.Nonnull RouteNexthop nexthop) { + this.nexthop = nexthop; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * 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 AnyRouteStatic instance itself + */ + public AnyRouteStatic 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; + } + AnyRouteStatic anyRouteStatic = (AnyRouteStatic) o; + return Objects.equals(this.destination, anyRouteStatic.destination) + && Objects.equals(this.type, anyRouteStatic.type) + && Objects.equals(this.createdAt, anyRouteStatic.createdAt) + && Objects.equals(this.error, anyRouteStatic.error) + && Objects.equals(this.id, anyRouteStatic.id) + && Objects.equals(this.labels, anyRouteStatic.labels) + && Objects.equals(this.nexthop, anyRouteStatic.nexthop) + && Objects.equals(this.updatedAt, anyRouteStatic.updatedAt) + && Objects.equals(this.additionalProperties, anyRouteStatic.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + destination, + type, + createdAt, + error, + id, + labels, + nexthop, + updatedAt, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnyRouteStatic {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" nexthop: ").append(toIndentedString(nexthop)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( + "destination", + "type", + "createdAt", + "error", + "id", + "labels", + "nexthop", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = + new HashSet( + Arrays.asList("destination", "type", "createdAt", "id", "nexthop")); + } + + /** + * 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 AnyRouteStatic + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnyRouteStatic.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 AnyRouteStatic is not found in the empty JSON string", + AnyRouteStatic.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnyRouteStatic.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 `destination` + RouteDestination.validateJsonElement(jsonObj.get("destination")); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `type` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) + && !jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `error` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("error").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + // validate the required field `nexthop` + RouteNexthop.validateJsonElement(jsonObj.get("nexthop")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnyRouteStatic.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnyRouteStatic' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AnyRouteStatic.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AnyRouteStatic 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 AnyRouteStatic read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnyRouteStatic 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 AnyRouteStatic given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnyRouteStatic + * @throws IOException if the JSON string is invalid with respect to AnyRouteStatic + */ + public static AnyRouteStatic fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnyRouteStatic.class); + } + + /** + * Convert an instance of AnyRouteStatic to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSystem.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSystem.java new file mode 100644 index 00000000..6811671d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/AnyRouteSystem.java @@ -0,0 +1,334 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.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; + +/** Object representing route of type system. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class AnyRouteSystem { + public static final String SERIALIZED_NAME_DESTINATION = "destination"; + + @SerializedName(SERIALIZED_NAME_DESTINATION) + @javax.annotation.Nonnull + private RouteDestination destination; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public AnyRouteSystem() {} + + public AnyRouteSystem destination(@javax.annotation.Nonnull RouteDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination + */ + @javax.annotation.Nonnull + public RouteDestination getDestination() { + return destination; + } + + public void setDestination(@javax.annotation.Nonnull RouteDestination destination) { + this.destination = destination; + } + + public AnyRouteSystem type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of the route. Possible values: `STATIC`, `DYNAMIC`, + * `SYSTEM`, `SERVICE`. + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + /** + * 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 AnyRouteSystem instance itself + */ + public AnyRouteSystem 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; + } + AnyRouteSystem anyRouteSystem = (AnyRouteSystem) o; + return Objects.equals(this.destination, anyRouteSystem.destination) + && Objects.equals(this.type, anyRouteSystem.type) + && Objects.equals(this.additionalProperties, anyRouteSystem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(destination, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnyRouteSystem {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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("destination", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("destination", "type")); + } + + /** + * 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 AnyRouteSystem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AnyRouteSystem.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 AnyRouteSystem is not found in the empty JSON string", + AnyRouteSystem.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AnyRouteSystem.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 `destination` + RouteDestination.validateJsonElement(jsonObj.get("destination")); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `type` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AnyRouteSystem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AnyRouteSystem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AnyRouteSystem.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AnyRouteSystem 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 AnyRouteSystem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AnyRouteSystem 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 AnyRouteSystem given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnyRouteSystem + * @throws IOException if the JSON string is invalid with respect to AnyRouteSystem + */ + public static AnyRouteSystem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AnyRouteSystem.class); + } + + /** + * Convert an instance of AnyRouteSystem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/BaseRoute.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/BaseRoute.java new file mode 100644 index 00000000..8ed5bcfd --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/BaseRoute.java @@ -0,0 +1,334 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.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; + +/** Object that represents common route properties. Filterable Fields: `type`. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class BaseRoute { + public static final String SERIALIZED_NAME_DESTINATION = "destination"; + + @SerializedName(SERIALIZED_NAME_DESTINATION) + @javax.annotation.Nonnull + private RouteDestination destination; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public BaseRoute() {} + + public BaseRoute destination(@javax.annotation.Nonnull RouteDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination + */ + @javax.annotation.Nonnull + public RouteDestination getDestination() { + return destination; + } + + public void setDestination(@javax.annotation.Nonnull RouteDestination destination) { + this.destination = destination; + } + + public BaseRoute type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of the route. Possible values: `STATIC`, `DYNAMIC`, + * `SYSTEM`, `SERVICE`. + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + /** + * 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 BaseRoute instance itself + */ + public BaseRoute 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; + } + BaseRoute baseRoute = (BaseRoute) o; + return Objects.equals(this.destination, baseRoute.destination) + && Objects.equals(this.type, baseRoute.type) + && Objects.equals(this.additionalProperties, baseRoute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(destination, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseRoute {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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("destination", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("destination", "type")); + } + + /** + * 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 BaseRoute + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BaseRoute.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 BaseRoute is not found in the empty JSON string", + BaseRoute.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BaseRoute.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 `destination` + RouteDestination.validateJsonElement(jsonObj.get("destination")); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `type` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BaseRoute.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BaseRoute' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BaseRoute.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BaseRoute 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 BaseRoute read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BaseRoute 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 BaseRoute given an JSON string + * + * @param jsonString JSON string + * @return An instance of BaseRoute + * @throws IOException if the JSON string is invalid with respect to BaseRoute + */ + public static BaseRoute fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BaseRoute.class); + } + + /** + * Convert an instance of BaseRoute to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkPayload.java index 097badc5..f8f35ead 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateNetworkPayload.java @@ -34,6 +34,11 @@ /** Object that represents the request body for a network create. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class CreateNetworkPayload { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -77,6 +82,24 @@ public class CreateNetworkPayload { public CreateNetworkPayload() {} + public CreateNetworkPayload description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public CreateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -137,11 +160,21 @@ public CreateNetworkPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -279,7 +312,8 @@ public boolean equals(Object o) { return false; } CreateNetworkPayload createNetworkPayload = (CreateNetworkPayload) o; - return Objects.equals(this.dhcp, createNetworkPayload.dhcp) + return Objects.equals(this.description, createNetworkPayload.description) + && Objects.equals(this.dhcp, createNetworkPayload.dhcp) && Objects.equals(this.ipv4, createNetworkPayload.ipv4) && Objects.equals(this.ipv6, createNetworkPayload.ipv6) && Objects.equals(this.labels, createNetworkPayload.labels) @@ -294,6 +328,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + description, dhcp, ipv4, ipv6, @@ -309,6 +344,7 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNetworkPayload {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); @@ -343,6 +379,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet( Arrays.asList( + "description", "dhcp", "ipv4", "ipv6", @@ -386,6 +423,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } // validate the optional field `ipv4` if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { CreateNetworkIPv4.validateJsonElement(jsonObj.get("ipv4")); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCPayload.java index 6c37e965..a893738b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/CreateVPCPayload.java @@ -75,11 +75,21 @@ public CreateVPCPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv4.java index b01c7a9e..083a5a02 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv4.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** IPv4 Classless Inter-Domain Routing (CIDR) Object. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv4 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV4("cidrv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class DestinationCIDRv4 { public DestinationCIDRv4() {} - public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -229,6 +281,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `cidrv4` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv6.java index 83804253..ba6d9eff 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/DestinationCIDRv6.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** IPv6 Classless Inter-Domain Routing (CIDR) Object. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv6 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV6("cidrv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class DestinationCIDRv6 { public DestinationCIDRv6() {} - public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -229,6 +281,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `cidrv6` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Network.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Network.java index b4c09a72..f2fbfb2b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Network.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Network.java @@ -43,6 +43,11 @@ public class Network { @SerializedName(SERIALIZED_NAME_CREATED_AT) @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -118,6 +123,24 @@ public Network(OffsetDateTime createdAt, OffsetDateTime updatedAt) { return createdAt; } + public Network description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public Network dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -197,11 +220,21 @@ public Network labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -370,6 +403,7 @@ public boolean equals(Object o) { } Network network = (Network) o; return Objects.equals(this.createdAt, network.createdAt) + && Objects.equals(this.description, network.description) && Objects.equals(this.dhcp, network.dhcp) && Objects.equals(this.id, network.id) && Objects.equals(this.ipv4, network.ipv4) @@ -388,6 +422,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( createdAt, + description, dhcp, id, ipv4, @@ -407,6 +442,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Network {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); @@ -445,6 +481,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "createdAt", + "description", "dhcp", "id", "ipv4", @@ -491,6 +528,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkRangeIPv4Request.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkRangeIPv4Request.java index e224d3e4..e7619c9c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkRangeIPv4Request.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NetworkRangeIPv4Request.java @@ -196,11 +196,21 @@ public NetworkRangeIPv4Request labels(@javax.annotation.Nullable Object labels) } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopBlackhole.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopBlackhole.java index 1ba58b4c..c2a893e3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopBlackhole.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopBlackhole.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,15 +34,66 @@ /** Object that represents a blackhole route. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopBlackhole { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BLACKHOLE("blackhole"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopBlackhole() {} - public NexthopBlackhole type(@javax.annotation.Nonnull String type) { + public NexthopBlackhole type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -52,11 +104,11 @@ public NexthopBlackhole type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -201,6 +253,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `blackhole` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv4.java index ed3028c4..fafecfae 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv4.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** Object that represents an IPv4 address. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv4 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV4("ipv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class NexthopIPv4 { public NexthopIPv4() {} - public NexthopIPv4 type(@javax.annotation.Nonnull String type) { + public NexthopIPv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public NexthopIPv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -228,6 +280,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `ipv4` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv6.java index 5c60da2b..bff04dc9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopIPv6.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** Object that represents an IPv6 address. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv6 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV6("ipv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class NexthopIPv6 { public NexthopIPv6() {} - public NexthopIPv6 type(@javax.annotation.Nonnull String type) { + public NexthopIPv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public NexthopIPv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -228,6 +280,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `ipv6` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopInternet.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopInternet.java index 21c566e1..e45e2d52 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopInternet.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/NexthopInternet.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,15 +34,66 @@ /** Object that represents a route to the internet. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopInternet { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + INTERNET("internet"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopInternet() {} - public NexthopInternet type(@javax.annotation.Nonnull String type) { + public NexthopInternet type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -52,11 +104,11 @@ public NexthopInternet type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -201,6 +253,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `internet` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateNetworkPayload.java index b61d5287..3ad5ab20 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateNetworkPayload.java @@ -34,6 +34,11 @@ /** Object that represents the request body for a network update. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class PartialUpdateNetworkPayload { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -71,6 +76,24 @@ public class PartialUpdateNetworkPayload { public PartialUpdateNetworkPayload() {} + public PartialUpdateNetworkPayload description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public PartialUpdateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -131,11 +154,21 @@ public PartialUpdateNetworkPayload labels(@javax.annotation.Nullable Object labe } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -255,7 +288,8 @@ public boolean equals(Object o) { return false; } PartialUpdateNetworkPayload partialUpdateNetworkPayload = (PartialUpdateNetworkPayload) o; - return Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) + return Objects.equals(this.description, partialUpdateNetworkPayload.description) + && Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) && Objects.equals(this.ipv4, partialUpdateNetworkPayload.ipv4) && Objects.equals(this.ipv6, partialUpdateNetworkPayload.ipv6) && Objects.equals(this.labels, partialUpdateNetworkPayload.labels) @@ -270,13 +304,22 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - dhcp, ipv4, ipv6, labels, name, routed, routingTableId, additionalProperties); + description, + dhcp, + ipv4, + ipv6, + labels, + name, + routed, + routingTableId, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PartialUpdateNetworkPayload {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); @@ -310,6 +353,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet( Arrays.asList( + "description", "dhcp", "ipv4", "ipv6", @@ -341,6 +385,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } // validate the optional field `ipv4` if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { UpdateNetworkIPv4Body.validateJsonElement(jsonObj.get("ipv4")); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateVPCPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateVPCPayload.java index e8475f39..79379a6b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateVPCPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PartialUpdateVPCPayload.java @@ -74,11 +74,21 @@ public PartialUpdateVPCPayload labels(@javax.annotation.Nullable Object labels) } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixEntries.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixEntries.java new file mode 100644 index 00000000..339809ed --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixEntries.java @@ -0,0 +1,317 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.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.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Object containing all CIDR entries of a prefix list. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class PrefixEntries { + public static final String SERIALIZED_NAME_ENTRIES = "entries"; + + @SerializedName(SERIALIZED_NAME_ENTRIES) + @javax.annotation.Nonnull + private List entries = new ArrayList<>(); + + public PrefixEntries() {} + + public PrefixEntries entries(@javax.annotation.Nonnull List entries) { + this.entries = entries; + return this; + } + + public PrefixEntries addEntriesItem(String entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + return this; + } + + /** + * List of CIDR blocks in the prefix list. + * + * @return entries + */ + @javax.annotation.Nonnull + public List getEntries() { + return entries; + } + + public void setEntries(@javax.annotation.Nonnull List entries) { + this.entries = entries; + } + + /** + * 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 PrefixEntries instance itself + */ + public PrefixEntries 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; + } + PrefixEntries prefixEntries = (PrefixEntries) o; + return Objects.equals(this.entries, prefixEntries.entries) + && Objects.equals(this.additionalProperties, prefixEntries.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(entries, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrefixEntries {\n"); + sb.append(" entries: ").append(toIndentedString(entries)).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("entries")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("entries")); + } + + /** + * 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 PrefixEntries + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PrefixEntries.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 PrefixEntries is not found in the empty JSON string", + PrefixEntries.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PrefixEntries.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(); + // ensure the required json array is present + if (jsonObj.get("entries") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("entries").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `entries` to be an array in the JSON string but got `%s`", + jsonObj.get("entries").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PrefixEntries.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PrefixEntries' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PrefixEntries.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PrefixEntries 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 PrefixEntries read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PrefixEntries 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 PrefixEntries given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrefixEntries + * @throws IOException if the JSON string is invalid with respect to PrefixEntries + */ + public static PrefixEntries fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PrefixEntries.class); + } + + /** + * Convert an instance of PrefixEntries to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixList.java new file mode 100644 index 00000000..b62b30a5 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixList.java @@ -0,0 +1,597 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Object that represents a prefix list. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class PrefixList { + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + + public static final String SERIALIZED_NAME_ENTRIES = "entries"; + + @SerializedName(SERIALIZED_NAME_ENTRIES) + @javax.annotation.Nullable private List entries = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ETHERTYPE = "ethertype"; + + @SerializedName(SERIALIZED_NAME_ETHERTYPE) + @javax.annotation.Nonnull + private String ethertype; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_MAX_ENTRIES = "maxEntries"; + + @SerializedName(SERIALIZED_NAME_MAX_ENTRIES) + @javax.annotation.Nonnull + private Long maxEntries; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable private String type = "custom"; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public PrefixList() {} + + public PrefixList(OffsetDateTime createdAt, UUID id, String type, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.id = id; + this.type = type; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public PrefixList description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + public PrefixList entries(@javax.annotation.Nullable List entries) { + this.entries = entries; + return this; + } + + public PrefixList addEntriesItem(String entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + return this; + } + + /** + * The list of CIDR blocks contained in this prefix list. + * + * @return entries + */ + @javax.annotation.Nullable public List getEntries() { + return entries; + } + + public void setEntries(@javax.annotation.Nullable List entries) { + this.entries = entries; + } + + public PrefixList ethertype(@javax.annotation.Nonnull String ethertype) { + this.ethertype = ethertype; + return this; + } + + /** + * The IP version of this prefix list. Possible values: `ipv4`, `ipv6`. + * + * @return ethertype + */ + @javax.annotation.Nonnull + public String getEthertype() { + return ethertype; + } + + public void setEthertype(@javax.annotation.Nonnull String ethertype) { + this.ethertype = ethertype; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public PrefixList labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public PrefixList maxEntries(@javax.annotation.Nonnull Long maxEntries) { + this.maxEntries = maxEntries; + return this; + } + + /** + * Maximum number of entries this prefix list can hold. minimum: 1 maximum: 65535 + * + * @return maxEntries + */ + @javax.annotation.Nonnull + public Long getMaxEntries() { + return maxEntries; + } + + public void setMaxEntries(@javax.annotation.Nonnull Long maxEntries) { + this.maxEntries = maxEntries; + } + + public PrefixList name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name for a General Object. Matches Names and also UUIDs. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + /** + * Indicates the type of prefix list. Managed prefix lists are created by the provider and + * cannot be modified or deleted by users. Possible values: `custom`, + * `managed`. + * + * @return type + */ + @javax.annotation.Nullable public String getType() { + return type; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * 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 PrefixList instance itself + */ + public PrefixList 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; + } + PrefixList prefixList = (PrefixList) o; + return Objects.equals(this.createdAt, prefixList.createdAt) + && Objects.equals(this.description, prefixList.description) + && Objects.equals(this.entries, prefixList.entries) + && Objects.equals(this.ethertype, prefixList.ethertype) + && Objects.equals(this.id, prefixList.id) + && Objects.equals(this.labels, prefixList.labels) + && Objects.equals(this.maxEntries, prefixList.maxEntries) + && Objects.equals(this.name, prefixList.name) + && Objects.equals(this.type, prefixList.type) + && Objects.equals(this.updatedAt, prefixList.updatedAt) + && Objects.equals(this.additionalProperties, prefixList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + description, + entries, + ethertype, + id, + labels, + maxEntries, + name, + type, + updatedAt, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrefixList {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + sb.append(" ethertype: ").append(toIndentedString(ethertype)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" maxEntries: ").append(toIndentedString(maxEntries)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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( + "createdAt", + "description", + "entries", + "ethertype", + "id", + "labels", + "maxEntries", + "name", + "type", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = + new HashSet(Arrays.asList("ethertype", "maxEntries", "name")); + } + + /** + * 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 PrefixList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PrefixList.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 PrefixList is not found in the empty JSON string", + PrefixList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PrefixList.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("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("entries") != null + && !jsonObj.get("entries").isJsonNull() + && !jsonObj.get("entries").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `entries` to be an array in the JSON string but got `%s`", + jsonObj.get("entries").toString())); + } + if (!jsonObj.get("ethertype").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `ethertype` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ethertype").toString())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `type` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PrefixList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PrefixList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PrefixList.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PrefixList 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 PrefixList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PrefixList 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 PrefixList given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrefixList + * @throws IOException if the JSON string is invalid with respect to PrefixList + */ + public static PrefixList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PrefixList.class); + } + + /** + * Convert an instance of PrefixList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixListListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixListListResponse.java new file mode 100644 index 00000000..44649669 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/PrefixListListResponse.java @@ -0,0 +1,324 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +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.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Prefix list response. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class PrefixListListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public PrefixListListResponse() {} + + public PrefixListListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public PrefixListListResponse addItemsItem(PrefixList itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of prefix lists. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + /** + * 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 PrefixListListResponse instance itself + */ + public PrefixListListResponse 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; + } + PrefixListListResponse prefixListListResponse = (PrefixListListResponse) o; + return Objects.equals(this.items, prefixListListResponse.items) + && Objects.equals( + this.additionalProperties, prefixListListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(items, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrefixListListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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("items")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("items")); + } + + /** + * 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 PrefixListListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PrefixListListResponse.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 PrefixListListResponse is not found in the empty JSON string", + PrefixListListResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PrefixListListResponse.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(); + // ensure the json data is an array + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + PrefixList.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PrefixListListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PrefixListListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PrefixListListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PrefixListListResponse 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 PrefixListListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PrefixListListResponse 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 PrefixListListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrefixListListResponse + * @throws IOException if the JSON string is invalid with respect to PrefixListListResponse + */ + public static PrefixListListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PrefixListListResponse.class); + } + + /** + * Convert an instance of PrefixListListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RetypeVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RetypeVolumePayload.java new file mode 100644 index 00000000..d23ef47d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RetypeVolumePayload.java @@ -0,0 +1,306 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2alpha1 + * Contact: stackit-iaas@mail.schwarz + * + * 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.iaas.v2alpha1api.model; + +import cloud.stackit.sdk.iaas.v2alpha1api.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; + +/** RetypeVolumePayload */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +public class RetypeVolumePayload { + public static final String SERIALIZED_NAME_PERFORMANCE_CLASS = "performanceClass"; + + @SerializedName(SERIALIZED_NAME_PERFORMANCE_CLASS) + @javax.annotation.Nonnull + private String performanceClass; + + public RetypeVolumePayload() {} + + public RetypeVolumePayload performanceClass(@javax.annotation.Nonnull String performanceClass) { + this.performanceClass = performanceClass; + return this; + } + + /** + * The name for a General Object. Matches Names and also UUIDs. + * + * @return performanceClass + */ + @javax.annotation.Nonnull + public String getPerformanceClass() { + return performanceClass; + } + + public void setPerformanceClass(@javax.annotation.Nonnull String performanceClass) { + this.performanceClass = performanceClass; + } + + /** + * 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 RetypeVolumePayload instance itself + */ + public RetypeVolumePayload 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; + } + RetypeVolumePayload retypeVolumePayload = (RetypeVolumePayload) o; + return Objects.equals(this.performanceClass, retypeVolumePayload.performanceClass) + && Objects.equals( + this.additionalProperties, retypeVolumePayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(performanceClass, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RetypeVolumePayload {\n"); + sb.append(" performanceClass: ").append(toIndentedString(performanceClass)).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("performanceClass")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("performanceClass")); + } + + /** + * 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 RetypeVolumePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RetypeVolumePayload.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 RetypeVolumePayload is not found in the empty JSON string", + RetypeVolumePayload.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RetypeVolumePayload.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("performanceClass").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `performanceClass` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("performanceClass").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RetypeVolumePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RetypeVolumePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RetypeVolumePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RetypeVolumePayload 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 RetypeVolumePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RetypeVolumePayload 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 RetypeVolumePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of RetypeVolumePayload + * @throws IOException if the JSON string is invalid with respect to RetypeVolumePayload + */ + public static RetypeVolumePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RetypeVolumePayload.class); + } + + /** + * Convert an instance of RetypeVolumePayload to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Route.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Route.java index ed61a80a..47da17c9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Route.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/Route.java @@ -119,11 +119,21 @@ public Route labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RoutingTable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RoutingTable.java index 5802ac62..7162dfc2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RoutingTable.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/RoutingTable.java @@ -166,11 +166,21 @@ public RoutingTable labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRouteOfRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRouteOfRoutingTablePayload.java index 1d97d9a5..f849e8df 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRouteOfRoutingTablePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRouteOfRoutingTablePayload.java @@ -46,11 +46,21 @@ public UpdateRouteOfRoutingTablePayload labels(@javax.annotation.Nullable Object } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRoutingTableOfAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRoutingTableOfAreaPayload.java index 3d98c970..dda58532 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRoutingTableOfAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateRoutingTableOfAreaPayload.java @@ -105,11 +105,21 @@ public UpdateRoutingTableOfAreaPayload labels(@javax.annotation.Nullable Object } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCRoutingTablePayload.java index 9aa05a0c..6271b162 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCRoutingTablePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCRoutingTablePayload.java @@ -104,11 +104,21 @@ public UpdateVPCRoutingTablePayload labels(@javax.annotation.Nullable Object lab } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCStaticRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCStaticRoutePayload.java index 9a4cd6b2..347fd0e6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCStaticRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/UpdateVPCStaticRoutePayload.java @@ -46,11 +46,21 @@ public UpdateVPCStaticRoutePayload labels(@javax.annotation.Nullable Object labe } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/V1UpdateVPCNetworkRangeIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/V1UpdateVPCNetworkRangeIPv4.java index 1b7d1686..ac0c6613 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/V1UpdateVPCNetworkRangeIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/V1UpdateVPCNetworkRangeIPv4.java @@ -187,11 +187,21 @@ public V1UpdateVPCNetworkRangeIPv4 labels(@javax.annotation.Nullable Object labe } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPC.java index 557fc432..eae14495 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPC.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPC.java @@ -142,11 +142,21 @@ public VPC labels(@javax.annotation.Nonnull Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCBaseNetworkRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCBaseNetworkRange.java index bde3ab34..fc64e6d1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCBaseNetworkRange.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCBaseNetworkRange.java @@ -116,11 +116,21 @@ public VPCBaseNetworkRange labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv4.java index 6e2666b7..3fcd1991 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv4.java @@ -201,11 +201,21 @@ public VPCNetworkRangeIPv4 labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv6.java index 8d0cd2a2..fa2cd3c1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCNetworkRangeIPv6.java @@ -201,11 +201,21 @@ public VPCNetworkRangeIPv6 labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCRoutingTable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCRoutingTable.java index d4f96279..1efffd14 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCRoutingTable.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2alpha1api/model/VPCRoutingTable.java @@ -149,11 +149,21 @@ public VPCRoutingTable labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutingTableToAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutingTableToAreaPayload.java index 2d46ae70..a2834584 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutingTableToAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutingTableToAreaPayload.java @@ -167,11 +167,21 @@ public AddRoutingTableToAreaPayload labels(@javax.annotation.Nullable Object lab } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Backup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Backup.java index 40c9cbc9..975e326c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Backup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Backup.java @@ -179,11 +179,21 @@ public Backup labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateBackupPayload.java index 196f9a86..b8a979d0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateBackupPayload.java @@ -80,11 +80,21 @@ public CreateBackupPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateImagePayload.java index 6af36ef5..8d4c7871 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateImagePayload.java @@ -246,11 +246,21 @@ public CreateImagePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateIsolatedNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateIsolatedNetworkPayload.java index f932a8a4..c879b4e0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateIsolatedNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateIsolatedNetworkPayload.java @@ -98,11 +98,21 @@ public CreateIsolatedNetworkPayload labels(@javax.annotation.Nullable Object lab } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateKeyPairPayload.java index 7d2cec22..1d014271 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateKeyPairPayload.java @@ -99,11 +99,21 @@ public CreateKeyPairPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaPayload.java index 92f4dada..c346cc80 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaPayload.java @@ -52,11 +52,21 @@ public CreateNetworkAreaPayload labels(@javax.annotation.Nullable Object labels) } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkPayload.java index d2c6fdca..95d1eb06 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkPayload.java @@ -34,6 +34,11 @@ /** Object that represents the request body for a network create. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class CreateNetworkPayload { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -77,6 +82,24 @@ public class CreateNetworkPayload { public CreateNetworkPayload() {} + public CreateNetworkPayload description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public CreateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -137,11 +160,21 @@ public CreateNetworkPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -279,7 +312,8 @@ public boolean equals(Object o) { return false; } CreateNetworkPayload createNetworkPayload = (CreateNetworkPayload) o; - return Objects.equals(this.dhcp, createNetworkPayload.dhcp) + return Objects.equals(this.description, createNetworkPayload.description) + && Objects.equals(this.dhcp, createNetworkPayload.dhcp) && Objects.equals(this.ipv4, createNetworkPayload.ipv4) && Objects.equals(this.ipv6, createNetworkPayload.ipv6) && Objects.equals(this.labels, createNetworkPayload.labels) @@ -294,6 +328,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + description, dhcp, ipv4, ipv6, @@ -309,6 +344,7 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNetworkPayload {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); @@ -343,6 +379,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet( Arrays.asList( + "description", "dhcp", "ipv4", "ipv6", @@ -386,6 +423,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } // validate the optional field `ipv4` if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { CreateNetworkIPv4.validateJsonElement(jsonObj.get("ipv4")); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java index 996cae38..8c9ab8d5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java @@ -225,11 +225,21 @@ public CreateNicPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java index eb93df4d..867752c5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java @@ -87,11 +87,21 @@ public CreatePublicIPPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupPayload.java index 6bbf56d5..63aa6299 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupPayload.java @@ -133,11 +133,21 @@ public CreateSecurityGroupPayload labels(@javax.annotation.Nullable Object label } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayload.java index ea6b1dba..5d2020d1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayload.java @@ -352,11 +352,21 @@ public CreateServerPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSnapshotPayload.java index af335857..ef45d7bd 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSnapshotPayload.java @@ -155,11 +155,21 @@ public CreateSnapshotPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateVolumePayload.java index 0c2b030a..0dea56e0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateVolumePayload.java @@ -255,11 +255,21 @@ public CreateVolumePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv4.java index 84568316..20ca4c74 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv4.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** IPv4 Classless Inter-Domain Routing (CIDR) Object. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv4 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV4("cidrv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class DestinationCIDRv4 { public DestinationCIDRv4() {} - public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -229,6 +281,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `cidrv4` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv6.java index 6fbd2ad2..7e691eab 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv6.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** IPv6 Classless Inter-Domain Routing (CIDR) Object. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv6 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV6("cidrv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class DestinationCIDRv6 { public DestinationCIDRv6() {} - public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -229,6 +281,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `cidrv6` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Image.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Image.java index 02a521bb..125a571e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Image.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Image.java @@ -246,11 +246,21 @@ public Image labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageFromVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageFromVolumePayload.java index 0d3968ae..ddbf6557 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageFromVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageFromVolumePayload.java @@ -42,6 +42,11 @@ public class ImageFromVolumePayload { @javax.annotation.Nonnull private String diskFormat; + public static final String SERIALIZED_NAME_FORCE = "force"; + + @SerializedName(SERIALIZED_NAME_FORCE) + @javax.annotation.Nullable private Boolean force = false; + public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -75,6 +80,24 @@ public void setDiskFormat(@javax.annotation.Nonnull String diskFormat) { this.diskFormat = diskFormat; } + public ImageFromVolumePayload force(@javax.annotation.Nullable Boolean force) { + this.force = force; + return this; + } + + /** + * When true the image is force created from a volume is currently being used. + * + * @return force + */ + @javax.annotation.Nullable public Boolean getForce() { + return force; + } + + public void setForce(@javax.annotation.Nullable Boolean force) { + this.force = force; + } + public ImageFromVolumePayload name(@javax.annotation.Nonnull String name) { this.name = name; return this; @@ -166,6 +189,7 @@ public boolean equals(Object o) { } ImageFromVolumePayload imageFromVolumePayload = (ImageFromVolumePayload) o; return Objects.equals(this.diskFormat, imageFromVolumePayload.diskFormat) + && Objects.equals(this.force, imageFromVolumePayload.force) && Objects.equals(this.name, imageFromVolumePayload.name) && Objects.equals(this._protected, imageFromVolumePayload._protected) && Objects.equals( @@ -174,7 +198,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(diskFormat, name, _protected, additionalProperties); + return Objects.hash(diskFormat, force, name, _protected, additionalProperties); } @Override @@ -182,6 +206,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ImageFromVolumePayload {\n"); sb.append(" diskFormat: ").append(toIndentedString(diskFormat)).append("\n"); + sb.append(" force: ").append(toIndentedString(force)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" _protected: ").append(toIndentedString(_protected)).append("\n"); sb.append(" additionalProperties: ") @@ -207,7 +232,8 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("diskFormat", "name", "protected")); + openapiFields = + new HashSet(Arrays.asList("diskFormat", "force", "name", "protected")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("diskFormat", "name")); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Keypair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Keypair.java index 492c86df..eb8c2ba0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Keypair.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Keypair.java @@ -98,11 +98,21 @@ public Keypair labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java index 31972623..e10738e7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java @@ -224,11 +224,21 @@ public NIC labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Network.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Network.java index c0e4e147..d6858a3a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Network.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Network.java @@ -43,6 +43,11 @@ public class Network { @SerializedName(SERIALIZED_NAME_CREATED_AT) @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -118,6 +123,24 @@ public Network(OffsetDateTime createdAt, OffsetDateTime updatedAt) { return createdAt; } + public Network description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public Network dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -197,11 +220,21 @@ public Network labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -370,6 +403,7 @@ public boolean equals(Object o) { } Network network = (Network) o; return Objects.equals(this.createdAt, network.createdAt) + && Objects.equals(this.description, network.description) && Objects.equals(this.dhcp, network.dhcp) && Objects.equals(this.id, network.id) && Objects.equals(this.ipv4, network.ipv4) @@ -388,6 +422,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( createdAt, + description, dhcp, id, ipv4, @@ -407,6 +442,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Network {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); @@ -445,6 +481,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "createdAt", + "description", "dhcp", "id", "ipv4", @@ -491,6 +528,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkArea.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkArea.java index 3ce10865..8d1d0c11 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkArea.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkArea.java @@ -101,11 +101,21 @@ public NetworkArea labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopBlackhole.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopBlackhole.java index 583668d7..2c50b704 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopBlackhole.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopBlackhole.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,15 +34,66 @@ /** Object that represents a blackhole route. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopBlackhole { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BLACKHOLE("blackhole"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopBlackhole() {} - public NexthopBlackhole type(@javax.annotation.Nonnull String type) { + public NexthopBlackhole type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -52,11 +104,11 @@ public NexthopBlackhole type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -201,6 +253,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `blackhole` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv4.java index 0eecf284..0d66cd3e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv4.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** Object that represents an IPv4 address. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv4 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV4("ipv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class NexthopIPv4 { public NexthopIPv4() {} - public NexthopIPv4 type(@javax.annotation.Nonnull String type) { + public NexthopIPv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public NexthopIPv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -228,6 +280,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `ipv4` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv6.java index b70a6325..3aa87dd8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv6.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** Object that represents an IPv6 address. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv6 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV6("ipv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class NexthopIPv6 { public NexthopIPv6() {} - public NexthopIPv6 type(@javax.annotation.Nonnull String type) { + public NexthopIPv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public NexthopIPv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -228,6 +280,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `ipv6` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopInternet.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopInternet.java index ae2e8f27..2ea53c9c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopInternet.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopInternet.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,15 +34,66 @@ /** Object that represents a route to the internet. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopInternet { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + INTERNET("internet"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopInternet() {} - public NexthopInternet type(@javax.annotation.Nonnull String type) { + public NexthopInternet type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -52,11 +104,11 @@ public NexthopInternet type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -201,6 +253,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `internet` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkAreaPayload.java index affb0c2b..827939c3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkAreaPayload.java @@ -51,11 +51,21 @@ public PartialUpdateNetworkAreaPayload labels(@javax.annotation.Nullable Object } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkPayload.java index b0713bf2..58a43238 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkPayload.java @@ -34,6 +34,11 @@ /** Object that represents the request body for a network update. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class PartialUpdateNetworkPayload { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -71,6 +76,24 @@ public class PartialUpdateNetworkPayload { public PartialUpdateNetworkPayload() {} + public PartialUpdateNetworkPayload description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public PartialUpdateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -131,11 +154,21 @@ public PartialUpdateNetworkPayload labels(@javax.annotation.Nullable Object labe } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -255,7 +288,8 @@ public boolean equals(Object o) { return false; } PartialUpdateNetworkPayload partialUpdateNetworkPayload = (PartialUpdateNetworkPayload) o; - return Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) + return Objects.equals(this.description, partialUpdateNetworkPayload.description) + && Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) && Objects.equals(this.ipv4, partialUpdateNetworkPayload.ipv4) && Objects.equals(this.ipv6, partialUpdateNetworkPayload.ipv6) && Objects.equals(this.labels, partialUpdateNetworkPayload.labels) @@ -270,13 +304,22 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - dhcp, ipv4, ipv6, labels, name, routed, routingTableId, additionalProperties); + description, + dhcp, + ipv4, + ipv6, + labels, + name, + routed, + routingTableId, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PartialUpdateNetworkPayload {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); @@ -310,6 +353,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet( Arrays.asList( + "description", "dhcp", "ipv4", "ipv6", @@ -341,6 +385,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } // validate the optional field `ipv4` if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { UpdateNetworkIPv4Body.validateJsonElement(jsonObj.get("ipv4")); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Project.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Project.java index 1db2a929..94c3a950 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Project.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Project.java @@ -57,6 +57,11 @@ public class Project { @SerializedName(SERIALIZED_NAME_INTERNET_ACCESS) @javax.annotation.Nullable private Boolean internetAccess; + public static final String SERIALIZED_NAME_PROJECT_TYPE = "projectType"; + + @SerializedName(SERIALIZED_NAME_PROJECT_TYPE) + @javax.annotation.Nullable private String projectType; + public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) @@ -68,6 +73,11 @@ public class Project { @SerializedName(SERIALIZED_NAME_UPDATED_AT) @javax.annotation.Nullable private OffsetDateTime updatedAt; + public static final String SERIALIZED_NAME_VPC_ID = "vpcId"; + + @SerializedName(SERIALIZED_NAME_VPC_ID) + @javax.annotation.Nullable private UUID vpcId; + public Project() {} public Project(OffsetDateTime createdAt, OffsetDateTime updatedAt) { @@ -141,6 +151,24 @@ public void setInternetAccess(@javax.annotation.Nullable Boolean internetAccess) this.internetAccess = internetAccess; } + public Project projectType(@javax.annotation.Nullable String projectType) { + this.projectType = projectType; + return this; + } + + /** + * Possible values: `Schwarz`, `Public`, `SNA`, `VPC`. + * + * @return projectType + */ + @javax.annotation.Nullable public String getProjectType() { + return projectType; + } + + public void setProjectType(@javax.annotation.Nullable String projectType) { + this.projectType = projectType; + } + public Project status(@javax.annotation.Nonnull String status) { this.status = status; return this; @@ -171,6 +199,24 @@ public void setStatus(@javax.annotation.Nonnull String status) { return updatedAt; } + public Project vpcId(@javax.annotation.Nullable UUID vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return vpcId + */ + @javax.annotation.Nullable public UUID getVpcId() { + return vpcId; + } + + public void setVpcId(@javax.annotation.Nullable UUID vpcId) { + this.vpcId = vpcId; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -228,15 +274,25 @@ public boolean equals(Object o) { && Objects.equals(this.createdAt, project.createdAt) && Objects.equals(this.id, project.id) && Objects.equals(this.internetAccess, project.internetAccess) + && Objects.equals(this.projectType, project.projectType) && Objects.equals(this.status, project.status) && Objects.equals(this.updatedAt, project.updatedAt) + && Objects.equals(this.vpcId, project.vpcId) && Objects.equals(this.additionalProperties, project.additionalProperties); } @Override public int hashCode() { return Objects.hash( - areaId, createdAt, id, internetAccess, status, updatedAt, additionalProperties); + areaId, + createdAt, + id, + internetAccess, + projectType, + status, + updatedAt, + vpcId, + additionalProperties); } @Override @@ -247,8 +303,10 @@ public String toString() { sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" internetAccess: ").append(toIndentedString(internetAccess)).append("\n"); + sb.append(" projectType: ").append(toIndentedString(projectType)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" vpcId: ").append(toIndentedString(vpcId)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -279,8 +337,10 @@ private String toIndentedString(Object o) { "createdAt", "id", "internetAccess", + "projectType", "status", - "updatedAt")); + "updatedAt", + "vpcId")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("areaId", "id", "status")); @@ -325,6 +385,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } + if ((jsonObj.get("projectType") != null && !jsonObj.get("projectType").isJsonNull()) + && !jsonObj.get("projectType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `projectType` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("projectType").toString())); + } if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -332,6 +400,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } + if ((jsonObj.get("vpcId") != null && !jsonObj.get("vpcId").isJsonNull()) + && !jsonObj.get("vpcId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `vpcId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("vpcId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java index b7be5546..6cdeb4ef 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java @@ -87,11 +87,21 @@ public PublicIp labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Route.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Route.java index 99813786..590d2c0c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Route.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Route.java @@ -119,11 +119,21 @@ public Route labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTable.java index f5e13bba..fe47a0da 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTable.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTable.java @@ -166,11 +166,21 @@ public RoutingTable labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroup.java index 289d0ef9..341e1be0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroup.java @@ -133,11 +133,21 @@ public SecurityGroup labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Server.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Server.java index a09bf7f8..739974f3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Server.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Server.java @@ -350,11 +350,21 @@ public Server labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Snapshot.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Snapshot.java index 58edb5b9..087133d6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Snapshot.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Snapshot.java @@ -155,11 +155,21 @@ public Snapshot labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateBackupPayload.java index 91d9b2f0..ab514e70 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateBackupPayload.java @@ -179,11 +179,21 @@ public UpdateBackupPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImagePayload.java index d8825cb5..c8ce74a7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImagePayload.java @@ -136,11 +136,21 @@ public UpdateImagePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateKeyPairPayload.java index c8c82765..45d9c546 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateKeyPairPayload.java @@ -46,11 +46,21 @@ public UpdateKeyPairPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRoutePayload.java index 8d39b7d6..ee0b44ab 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRoutePayload.java @@ -46,11 +46,21 @@ public UpdateNetworkAreaRoutePayload labels(@javax.annotation.Nullable Object la } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNicPayload.java index c29b24e6..60d6fa19 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNicPayload.java @@ -120,11 +120,21 @@ public UpdateNicPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java index 96d41147..9b9c73f9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java @@ -87,11 +87,21 @@ public UpdatePublicIPPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRouteOfRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRouteOfRoutingTablePayload.java index 1c6784af..ed71d0a6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRouteOfRoutingTablePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRouteOfRoutingTablePayload.java @@ -46,11 +46,21 @@ public UpdateRouteOfRoutingTablePayload labels(@javax.annotation.Nullable Object } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRoutingTableOfAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRoutingTableOfAreaPayload.java index afe7ef1b..954ace36 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRoutingTableOfAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRoutingTableOfAreaPayload.java @@ -105,11 +105,21 @@ public UpdateRoutingTableOfAreaPayload labels(@javax.annotation.Nullable Object } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSecurityGroupPayload.java index e840dfc3..72ebffc5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSecurityGroupPayload.java @@ -74,11 +74,21 @@ public UpdateSecurityGroupPayload labels(@javax.annotation.Nullable Object label } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateServerPayload.java index b7de622b..c13c1e87 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateServerPayload.java @@ -56,11 +56,21 @@ public UpdateServerPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSnapshotPayload.java index 52cf13a4..56864c0b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSnapshotPayload.java @@ -74,11 +74,21 @@ public UpdateSnapshotPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateVolumePayload.java index 0eecfba9..867b8324 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateVolumePayload.java @@ -120,11 +120,21 @@ public UpdateVolumePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Volume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Volume.java index d925a12c..0c63d3dd 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Volume.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Volume.java @@ -255,11 +255,21 @@ public Volume labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClass.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClass.java index 352c97fc..104e7c76 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClass.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClass.java @@ -103,11 +103,21 @@ public VolumePerformanceClass labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutingTableToAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutingTableToAreaPayload.java index fcea50f6..b8ba78c7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutingTableToAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutingTableToAreaPayload.java @@ -167,11 +167,21 @@ public AddRoutingTableToAreaPayload labels(@javax.annotation.Nullable Object lab } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Backup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Backup.java index 9ec52730..35f9ca7c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Backup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Backup.java @@ -179,11 +179,21 @@ public Backup labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateBackupPayload.java index 2f7253e2..d9264843 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateBackupPayload.java @@ -80,11 +80,21 @@ public CreateBackupPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateImagePayload.java index 8d9f1ee2..e905f9f4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateImagePayload.java @@ -246,11 +246,21 @@ public CreateImagePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateIsolatedNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateIsolatedNetworkPayload.java index 5bf176b7..2b45dbe7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateIsolatedNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateIsolatedNetworkPayload.java @@ -98,11 +98,21 @@ public CreateIsolatedNetworkPayload labels(@javax.annotation.Nullable Object lab } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateKeyPairPayload.java index bcff42e9..ab7e7f15 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateKeyPairPayload.java @@ -99,11 +99,21 @@ public CreateKeyPairPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaPayload.java index 3f9277a9..936e3f4d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaPayload.java @@ -52,11 +52,21 @@ public CreateNetworkAreaPayload labels(@javax.annotation.Nullable Object labels) } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkPayload.java index 4ce311cf..8633f8de 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkPayload.java @@ -34,6 +34,11 @@ /** Object that represents the request body for a network create. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class CreateNetworkPayload { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -77,6 +82,24 @@ public class CreateNetworkPayload { public CreateNetworkPayload() {} + public CreateNetworkPayload description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public CreateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -137,11 +160,21 @@ public CreateNetworkPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -279,7 +312,8 @@ public boolean equals(Object o) { return false; } CreateNetworkPayload createNetworkPayload = (CreateNetworkPayload) o; - return Objects.equals(this.dhcp, createNetworkPayload.dhcp) + return Objects.equals(this.description, createNetworkPayload.description) + && Objects.equals(this.dhcp, createNetworkPayload.dhcp) && Objects.equals(this.ipv4, createNetworkPayload.ipv4) && Objects.equals(this.ipv6, createNetworkPayload.ipv6) && Objects.equals(this.labels, createNetworkPayload.labels) @@ -294,6 +328,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + description, dhcp, ipv4, ipv6, @@ -309,6 +344,7 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNetworkPayload {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); @@ -343,6 +379,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet( Arrays.asList( + "description", "dhcp", "ipv4", "ipv6", @@ -386,6 +423,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } // validate the optional field `ipv4` if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { CreateNetworkIPv4.validateJsonElement(jsonObj.get("ipv4")); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java index c8cd01cf..510d3693 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java @@ -225,11 +225,21 @@ public CreateNicPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java index b83f05e0..52050a4e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java @@ -87,11 +87,21 @@ public CreatePublicIPPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupPayload.java index 4e60219b..8874ce9b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupPayload.java @@ -133,11 +133,21 @@ public CreateSecurityGroupPayload labels(@javax.annotation.Nullable Object label } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayload.java index 14ecb06b..0f7f2386 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayload.java @@ -352,11 +352,21 @@ public CreateServerPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateVolumePayload.java index cd779e36..eb2515a9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateVolumePayload.java @@ -255,11 +255,21 @@ public CreateVolumePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv4.java index 5ec20033..786c669a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv4.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** IPv4 Classless Inter-Domain Routing (CIDR) Object. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv4 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV4("cidrv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class DestinationCIDRv4 { public DestinationCIDRv4() {} - public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -229,6 +281,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `cidrv4` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv6.java index 1dbbcb71..ae32c063 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv6.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** IPv6 Classless Inter-Domain Routing (CIDR) Object. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class DestinationCIDRv6 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CIDRV6("cidrv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class DestinationCIDRv6 { public DestinationCIDRv6() {} - public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { + public DestinationCIDRv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -229,6 +281,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `cidrv6` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Image.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Image.java index ebc167db..728030bc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Image.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Image.java @@ -246,11 +246,21 @@ public Image labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Keypair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Keypair.java index 3d9a8408..55b25152 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Keypair.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Keypair.java @@ -98,11 +98,21 @@ public Keypair labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java index 624b91db..41578843 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java @@ -224,11 +224,21 @@ public NIC labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Network.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Network.java index c79d8346..4bcdf878 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Network.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Network.java @@ -43,6 +43,11 @@ public class Network { @SerializedName(SERIALIZED_NAME_CREATED_AT) @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -118,6 +123,24 @@ public Network(OffsetDateTime createdAt, OffsetDateTime updatedAt) { return createdAt; } + public Network description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public Network dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -197,11 +220,21 @@ public Network labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -370,6 +403,7 @@ public boolean equals(Object o) { } Network network = (Network) o; return Objects.equals(this.createdAt, network.createdAt) + && Objects.equals(this.description, network.description) && Objects.equals(this.dhcp, network.dhcp) && Objects.equals(this.id, network.id) && Objects.equals(this.ipv4, network.ipv4) @@ -388,6 +422,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( createdAt, + description, dhcp, id, ipv4, @@ -407,6 +442,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Network {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); @@ -445,6 +481,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "createdAt", + "description", "dhcp", "id", "ipv4", @@ -491,6 +528,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkArea.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkArea.java index c3805c3c..1874dd34 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkArea.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkArea.java @@ -101,11 +101,21 @@ public NetworkArea labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopBlackhole.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopBlackhole.java index f700d767..e82b3729 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopBlackhole.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopBlackhole.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,15 +34,66 @@ /** Object that represents a blackhole route. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopBlackhole { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BLACKHOLE("blackhole"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopBlackhole() {} - public NexthopBlackhole type(@javax.annotation.Nonnull String type) { + public NexthopBlackhole type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -52,11 +104,11 @@ public NexthopBlackhole type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -201,6 +253,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `blackhole` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv4.java index 6c3a30bb..c5c43f29 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv4.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** Object that represents an IPv4 address. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv4 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV4("ipv4"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class NexthopIPv4 { public NexthopIPv4() {} - public NexthopIPv4 type(@javax.annotation.Nonnull String type) { + public NexthopIPv4 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public NexthopIPv4 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -228,6 +280,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `ipv4` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv6.java index 0efe878b..99da3a1c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv6.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,11 +34,62 @@ /** Object that represents an IPv6 address. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopIPv6 { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IPV6("ipv6"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public static final String SERIALIZED_NAME_VALUE = "value"; @@ -47,7 +99,7 @@ public class NexthopIPv6 { public NexthopIPv6() {} - public NexthopIPv6 type(@javax.annotation.Nonnull String type) { + public NexthopIPv6 type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -58,11 +110,11 @@ public NexthopIPv6 type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -228,6 +280,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `ipv6` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopInternet.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopInternet.java index 7eb1c2ed..7e54a337 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopInternet.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopInternet.java @@ -18,6 +18,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -33,15 +34,66 @@ /** Object that represents a route to the internet. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class NexthopInternet { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + INTERNET("internet"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nonnull - private String type; + private TypeEnum type; public NexthopInternet() {} - public NexthopInternet type(@javax.annotation.Nonnull String type) { + public NexthopInternet type(@javax.annotation.Nonnull TypeEnum type) { this.type = type; return this; } @@ -52,11 +104,11 @@ public NexthopInternet type(@javax.annotation.Nonnull String type) { * @return type */ @javax.annotation.Nonnull - public String getType() { + public TypeEnum getType() { return type; } - public void setType(@javax.annotation.Nonnull String type) { + public void setType(@javax.annotation.Nonnull TypeEnum type) { this.type = type; } @@ -201,6 +253,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expectd the field `type` to have value `internet` but got `%s`", jsonObj.get("type"))); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkAreaPayload.java index 5cd13416..81399222 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkAreaPayload.java @@ -51,11 +51,21 @@ public PartialUpdateNetworkAreaPayload labels(@javax.annotation.Nullable Object } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkPayload.java index 2ef4ad80..a8133d4d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkPayload.java @@ -34,6 +34,11 @@ /** Object that represents the request body for a network update. */ @javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") public class PartialUpdateNetworkPayload { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -71,6 +76,24 @@ public class PartialUpdateNetworkPayload { public PartialUpdateNetworkPayload() {} + public PartialUpdateNetworkPayload description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public PartialUpdateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -131,11 +154,21 @@ public PartialUpdateNetworkPayload labels(@javax.annotation.Nullable Object labe } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -255,7 +288,8 @@ public boolean equals(Object o) { return false; } PartialUpdateNetworkPayload partialUpdateNetworkPayload = (PartialUpdateNetworkPayload) o; - return Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) + return Objects.equals(this.description, partialUpdateNetworkPayload.description) + && Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) && Objects.equals(this.ipv4, partialUpdateNetworkPayload.ipv4) && Objects.equals(this.ipv6, partialUpdateNetworkPayload.ipv6) && Objects.equals(this.labels, partialUpdateNetworkPayload.labels) @@ -270,13 +304,22 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - dhcp, ipv4, ipv6, labels, name, routed, routingTableId, additionalProperties); + description, + dhcp, + ipv4, + ipv6, + labels, + name, + routed, + routingTableId, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PartialUpdateNetworkPayload {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); @@ -310,6 +353,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet( Arrays.asList( + "description", "dhcp", "ipv4", "ipv6", @@ -341,6 +385,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } // validate the optional field `ipv4` if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { UpdateNetworkIPv4Body.validateJsonElement(jsonObj.get("ipv4")); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Project.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Project.java index bfd765a6..360503ba 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Project.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Project.java @@ -57,6 +57,11 @@ public class Project { @SerializedName(SERIALIZED_NAME_INTERNET_ACCESS) @javax.annotation.Nullable private Boolean internetAccess; + public static final String SERIALIZED_NAME_PROJECT_TYPE = "projectType"; + + @SerializedName(SERIALIZED_NAME_PROJECT_TYPE) + @javax.annotation.Nullable private String projectType; + public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) @@ -68,6 +73,11 @@ public class Project { @SerializedName(SERIALIZED_NAME_UPDATED_AT) @javax.annotation.Nullable private OffsetDateTime updatedAt; + public static final String SERIALIZED_NAME_VPC_ID = "vpcId"; + + @SerializedName(SERIALIZED_NAME_VPC_ID) + @javax.annotation.Nullable private UUID vpcId; + public Project() {} public Project(OffsetDateTime createdAt, OffsetDateTime updatedAt) { @@ -141,6 +151,24 @@ public void setInternetAccess(@javax.annotation.Nullable Boolean internetAccess) this.internetAccess = internetAccess; } + public Project projectType(@javax.annotation.Nullable String projectType) { + this.projectType = projectType; + return this; + } + + /** + * Possible values: `Schwarz`, `Public`, `SNA`, `VPC`. + * + * @return projectType + */ + @javax.annotation.Nullable public String getProjectType() { + return projectType; + } + + public void setProjectType(@javax.annotation.Nullable String projectType) { + this.projectType = projectType; + } + public Project status(@javax.annotation.Nonnull String status) { this.status = status; return this; @@ -171,6 +199,24 @@ public void setStatus(@javax.annotation.Nonnull String status) { return updatedAt; } + public Project vpcId(@javax.annotation.Nullable UUID vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return vpcId + */ + @javax.annotation.Nullable public UUID getVpcId() { + return vpcId; + } + + public void setVpcId(@javax.annotation.Nullable UUID vpcId) { + this.vpcId = vpcId; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -228,15 +274,25 @@ public boolean equals(Object o) { && Objects.equals(this.createdAt, project.createdAt) && Objects.equals(this.id, project.id) && Objects.equals(this.internetAccess, project.internetAccess) + && Objects.equals(this.projectType, project.projectType) && Objects.equals(this.status, project.status) && Objects.equals(this.updatedAt, project.updatedAt) + && Objects.equals(this.vpcId, project.vpcId) && Objects.equals(this.additionalProperties, project.additionalProperties); } @Override public int hashCode() { return Objects.hash( - areaId, createdAt, id, internetAccess, status, updatedAt, additionalProperties); + areaId, + createdAt, + id, + internetAccess, + projectType, + status, + updatedAt, + vpcId, + additionalProperties); } @Override @@ -247,8 +303,10 @@ public String toString() { sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" internetAccess: ").append(toIndentedString(internetAccess)).append("\n"); + sb.append(" projectType: ").append(toIndentedString(projectType)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" vpcId: ").append(toIndentedString(vpcId)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -279,8 +337,10 @@ private String toIndentedString(Object o) { "createdAt", "id", "internetAccess", + "projectType", "status", - "updatedAt")); + "updatedAt", + "vpcId")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("areaId", "id", "status")); @@ -325,6 +385,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } + if ((jsonObj.get("projectType") != null && !jsonObj.get("projectType").isJsonNull()) + && !jsonObj.get("projectType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `projectType` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("projectType").toString())); + } if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -332,6 +400,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } + if ((jsonObj.get("vpcId") != null && !jsonObj.get("vpcId").isJsonNull()) + && !jsonObj.get("vpcId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `vpcId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("vpcId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java index c726e9f1..b0511655 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java @@ -87,11 +87,21 @@ public PublicIp labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Route.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Route.java index cb11ad67..0ec8d173 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Route.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Route.java @@ -119,11 +119,21 @@ public Route labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTable.java index de2e097d..fdc59c17 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTable.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTable.java @@ -166,11 +166,21 @@ public RoutingTable labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroup.java index 3d7fbddc..09ccaa84 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroup.java @@ -133,11 +133,21 @@ public SecurityGroup labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Server.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Server.java index fde65946..3dc1edcc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Server.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Server.java @@ -350,11 +350,21 @@ public Server labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Snapshot.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Snapshot.java index 348e73dd..a160c4bc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Snapshot.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Snapshot.java @@ -155,11 +155,21 @@ public Snapshot labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImagePayload.java index 8301015a..ffb0dc7f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImagePayload.java @@ -136,11 +136,21 @@ public UpdateImagePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateKeyPairPayload.java index 5edfb7bb..5d42b311 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateKeyPairPayload.java @@ -46,11 +46,21 @@ public UpdateKeyPairPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNicPayload.java index 5982a6cc..46cb04bc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNicPayload.java @@ -120,11 +120,21 @@ public UpdateNicPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java index 3ad8f9b8..b4b23169 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java @@ -87,11 +87,21 @@ public UpdatePublicIPPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRouteOfRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRouteOfRoutingTablePayload.java index e5a1fc2f..0c33ea8d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRouteOfRoutingTablePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRouteOfRoutingTablePayload.java @@ -46,11 +46,21 @@ public UpdateRouteOfRoutingTablePayload labels(@javax.annotation.Nullable Object } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRoutingTableOfAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRoutingTableOfAreaPayload.java index 7c688bd8..e9bb58f8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRoutingTableOfAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRoutingTableOfAreaPayload.java @@ -105,11 +105,21 @@ public UpdateRoutingTableOfAreaPayload labels(@javax.annotation.Nullable Object } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateServerPayload.java index 859ac873..c28a96fc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateServerPayload.java @@ -56,11 +56,21 @@ public UpdateServerPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateVolumePayload.java index f3dbdc6c..11a136b8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateVolumePayload.java @@ -120,11 +120,21 @@ public UpdateVolumePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateSnapshotPayload.java index 3c4a6ea7..553e3de1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateSnapshotPayload.java @@ -155,11 +155,21 @@ public V2beta1CreateSnapshotPayload labels(@javax.annotation.Nullable Object lab } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateBackupPayload.java index 1b66db6c..336cd5cc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateBackupPayload.java @@ -179,11 +179,21 @@ public V2beta1UpdateBackupPayload labels(@javax.annotation.Nullable Object label } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRoutePayload.java index 4ba57dd9..328b44ba 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRoutePayload.java @@ -46,11 +46,21 @@ public V2beta1UpdateNetworkAreaRoutePayload labels(@javax.annotation.Nullable Ob } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSecurityGroupPayload.java index 1760a840..f82d8699 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSecurityGroupPayload.java @@ -75,11 +75,21 @@ public V2beta1UpdateSecurityGroupPayload labels(@javax.annotation.Nullable Objec } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSnapshotPayload.java index 41391bfc..453579b3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSnapshotPayload.java @@ -74,11 +74,21 @@ public V2beta1UpdateSnapshotPayload labels(@javax.annotation.Nullable Object lab } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Volume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Volume.java index b6cd80b5..fee2566d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Volume.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Volume.java @@ -255,11 +255,21 @@ public Volume labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClass.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClass.java index ee83fcf6..43d7a75f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClass.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClass.java @@ -103,11 +103,21 @@ public VolumePerformanceClass labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */