From 469a4c04f5c328d27cb1c7ad8a829de2bc157eba Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Wed, 11 Mar 2026 15:00:46 +0100 Subject: [PATCH 1/4] generate iaas v2 --- services/iaas/README.md | 4 +- services/iaas/build.gradle | 4 +- .../cloud/stackit/sdk/iaas/ApiCallback.java | 4 +- .../cloud/stackit/sdk/iaas/ApiClient.java | 81 +- .../cloud/stackit/sdk/iaas/ApiResponse.java | 4 +- .../sdk/iaas/GzipRequestInterceptor.java | 4 +- .../java/cloud/stackit/sdk/iaas/JSON.java | 166 +- .../java/cloud/stackit/sdk/iaas/Pair.java | 6 +- .../stackit/sdk/iaas/ProgressRequestBody.java | 4 +- .../sdk/iaas/ProgressResponseBody.java | 4 +- .../stackit/sdk/iaas/ServerConfiguration.java | 6 +- .../stackit/sdk/iaas/ServerVariable.java | 6 +- .../cloud/stackit/sdk/iaas/StringUtil.java | 6 +- .../stackit/sdk/iaas/api/DefaultApi.java | 17821 ++++++++++------ .../cloud/stackit/sdk/iaas/api/IaasApi.java | 4 +- .../sdk/iaas/model/AbstractOpenApiSchema.java | 6 +- .../model/AddRoutesToRoutingTablePayload.java | 334 + .../model/AddRoutingTableToAreaPayload.java | 536 + .../iaas/model/AddVolumeToServerPayload.java | 136 +- .../stackit/sdk/iaas/model/AffinityGroup.java | 140 +- .../iaas/model/AffinityGroupListResponse.java | 138 +- .../sdk/iaas/model/AllowedAddressesInner.java | 24 +- .../cloud/stackit/sdk/iaas/model/Area.java | 350 - .../stackit/sdk/iaas/model/AreaConfig.java | 361 - .../cloud/stackit/sdk/iaas/model/AreaId.java | 27 +- .../sdk/iaas/model/AreaPrefixConfigIPv4.java | 242 - .../model/AvailabilityZoneListResponse.java | 140 +- .../cloud/stackit/sdk/iaas/model/Backup.java | 198 +- .../sdk/iaas/model/BackupListResponse.java | 138 +- .../stackit/sdk/iaas/model/BackupSource.java | 139 +- .../sdk/iaas/model/BaseSecurityGroupRule.java | 146 +- .../stackit/sdk/iaas/model/BootVolume.java | 136 +- .../sdk/iaas/model/BootVolumeSource.java | 139 +- .../model/CreateAffinityGroupPayload.java | 141 +- .../iaas/model/CreateAreaAddressFamily.java | 194 - .../sdk/iaas/model/CreateBackupPayload.java | 180 +- .../sdk/iaas/model/CreateImagePayload.java | 168 +- .../model/CreateIsolatedNetworkPayload.java | 398 + .../sdk/iaas/model/CreateKeyPairPayload.java | 145 +- .../model/CreateNetworkAddressFamily.java | 223 - .../iaas/model/CreateNetworkAreaPayload.java | 182 +- .../model/CreateNetworkAreaRangePayload.java | 136 +- .../model/CreateNetworkAreaRegionPayload.java | 330 + .../model/CreateNetworkAreaRoutePayload.java | 206 +- .../sdk/iaas/model/CreateNetworkIPv4.java | 300 + .../sdk/iaas/model/CreateNetworkIPv4Body.java | 317 - .../model/CreateNetworkIPv4WithPrefix.java | 408 + .../CreateNetworkIPv4WithPrefixLength.java | 356 + .../sdk/iaas/model/CreateNetworkIPv6.java | 300 + .../sdk/iaas/model/CreateNetworkIPv6Body.java | 317 - .../model/CreateNetworkIPv6WithPrefix.java | 408 + .../CreateNetworkIPv6WithPrefixLength.java | 356 + .../sdk/iaas/model/CreateNetworkPayload.java | 271 +- .../sdk/iaas/model/CreateNicPayload.java | 148 +- .../sdk/iaas/model/CreateProtocol.java | 32 +- .../sdk/iaas/model/CreatePublicIPPayload.java | 142 +- .../model/CreateSecurityGroupPayload.java | 153 +- .../model/CreateSecurityGroupRulePayload.java | 148 +- .../CreateSecurityGroupRuleProtocol.java | 136 +- .../iaas/model/CreateServerNetworking.java | 12 +- .../model/CreateServerNetworkingWithNics.java | 12 +- .../sdk/iaas/model/CreateServerPayload.java | 177 +- .../CreateServerPayloadAllOfNetworking.java | 304 + .../sdk/iaas/model/CreateSnapshotPayload.java | 189 +- .../sdk/iaas/model/CreateVolumePayload.java | 149 +- .../sdk/iaas/model/DestinationCIDRv4.java | 342 + .../sdk/iaas/model/DestinationCIDRv6.java | 342 + .../cloud/stackit/sdk/iaas/model/Error.java | 139 +- .../iaas/model/GetServerLog200Response.java | 135 +- .../sdk/iaas/model/ICMPParameters.java | 137 +- .../cloud/stackit/sdk/iaas/model/Image.java | 167 +- .../stackit/sdk/iaas/model/ImageAgent.java | 133 +- .../stackit/sdk/iaas/model/ImageChecksum.java | 139 +- .../stackit/sdk/iaas/model/ImageConfig.java | 144 +- .../sdk/iaas/model/ImageCreateResponse.java | 140 +- .../iaas/model/ImageFromVolumePayload.java | 371 + .../sdk/iaas/model/ImageListResponse.java | 138 +- .../stackit/sdk/iaas/model/ImageShare.java | 133 +- .../sdk/iaas/model/ImageShareConsumer.java | 136 +- .../sdk/iaas/model/KeyPairListResponse.java | 138 +- .../cloud/stackit/sdk/iaas/model/Keypair.java | 144 +- .../stackit/sdk/iaas/model/MachineType.java | 139 +- .../iaas/model/MachineTypeListResponse.java | 138 +- .../cloud/stackit/sdk/iaas/model/NIC.java | 148 +- .../sdk/iaas/model/NICListResponse.java | 137 +- .../cloud/stackit/sdk/iaas/model/Network.java | 559 +- .../stackit/sdk/iaas/model/NetworkArea.java | 265 +- .../sdk/iaas/model/NetworkAreaIPv4.java | 438 - .../iaas/model/NetworkAreaListResponse.java | 138 +- .../stackit/sdk/iaas/model/NetworkIPv4.java | 444 + .../stackit/sdk/iaas/model/NetworkIPv6.java | 413 + .../sdk/iaas/model/NetworkListResponse.java | 138 +- .../stackit/sdk/iaas/model/NetworkRange.java | 170 +- .../iaas/model/NetworkRangeListResponse.java | 138 +- .../sdk/iaas/model/NexthopBlackhole.java | 307 + .../stackit/sdk/iaas/model/NexthopIPv4.java | 340 + .../stackit/sdk/iaas/model/NexthopIPv6.java | 340 + .../sdk/iaas/model/NexthopInternet.java | 307 + .../PartialUpdateNetworkAreaPayload.java | 178 +- .../model/PartialUpdateNetworkPayload.java | 270 +- .../stackit/sdk/iaas/model/PortRange.java | 138 +- .../cloud/stackit/sdk/iaas/model/Project.java | 259 +- .../sdk/iaas/model/ProjectListResponse.java | 138 +- .../stackit/sdk/iaas/model/Protocol.java | 134 +- .../stackit/sdk/iaas/model/PublicIp.java | 141 +- .../sdk/iaas/model/PublicIpListResponse.java | 138 +- .../stackit/sdk/iaas/model/PublicNetwork.java | 176 +- .../iaas/model/PublicNetworkListResponse.java | 138 +- .../cloud/stackit/sdk/iaas/model/Quota.java | 138 +- .../stackit/sdk/iaas/model/QuotaList.java | 138 +- .../sdk/iaas/model/QuotaListResponse.java | 138 +- .../stackit/sdk/iaas/model/RegionalArea.java | 320 + ...ateAreaIPv4.java => RegionalAreaIPv4.java} | 390 +- .../iaas/model/RegionalAreaListResponse.java | 311 + .../cloud/stackit/sdk/iaas/model/Request.java | 149 +- .../sdk/iaas/model/RequestResource.java | 140 +- .../sdk/iaas/model/RescueServerPayload.java | 139 +- .../sdk/iaas/model/ResizeServerPayload.java | 139 +- .../sdk/iaas/model/ResizeVolumePayload.java | 138 +- .../cloud/stackit/sdk/iaas/model/Route.java | 256 +- .../sdk/iaas/model/RouteDestination.java | 290 + .../sdk/iaas/model/RouteListResponse.java | 138 +- .../stackit/sdk/iaas/model/RouteNexthop.java | 404 + .../stackit/sdk/iaas/model/RoutingTable.java | 525 + .../iaas/model/RoutingTableListResponse.java | 327 + .../stackit/sdk/iaas/model/SecurityGroup.java | 152 +- .../iaas/model/SecurityGroupListResponse.java | 138 +- .../sdk/iaas/model/SecurityGroupRule.java | 146 +- .../model/SecurityGroupRuleListResponse.java | 140 +- .../iaas/model/SecurityGroupRuleProtocol.java | 134 +- .../cloud/stackit/sdk/iaas/model/Server.java | 164 +- .../stackit/sdk/iaas/model/ServerAgent.java | 133 +- .../sdk/iaas/model/ServerConsoleUrl.java | 138 +- .../sdk/iaas/model/ServerListResponse.java | 138 +- .../sdk/iaas/model/ServerMaintenance.java | 140 +- .../stackit/sdk/iaas/model/ServerNetwork.java | 146 +- ...dNetworking.java => ServerNetworking.java} | 66 +- .../model/ServiceAccountMailListResponse.java | 140 +- .../sdk/iaas/model/SetImageSharePayload.java | 134 +- .../stackit/sdk/iaas/model/Snapshot.java | 188 +- .../sdk/iaas/model/SnapshotListResponse.java | 138 +- .../stackit/sdk/iaas/model/StaticAreaID.java | 4 +- .../iaas/model/UpdateAreaAddressFamily.java | 194 - .../sdk/iaas/model/UpdateAreaIPv4.java | 291 - .../model/UpdateAttachedVolumePayload.java | 138 +- .../sdk/iaas/model/UpdateBackupPayload.java | 199 +- .../sdk/iaas/model/UpdateImagePayload.java | 147 +- .../iaas/model/UpdateImageSharePayload.java | 134 +- .../sdk/iaas/model/UpdateKeyPairPayload.java | 137 +- .../model/UpdateNetworkAddressFamily.java | 223 - .../model/UpdateNetworkAreaRegionPayload.java | 300 + .../model/UpdateNetworkAreaRoutePayload.java | 139 +- .../sdk/iaas/model/UpdateNetworkIPv4Body.java | 139 +- .../sdk/iaas/model/UpdateNetworkIPv6Body.java | 139 +- .../sdk/iaas/model/UpdateNicPayload.java | 145 +- .../sdk/iaas/model/UpdatePublicIPPayload.java | 142 +- .../iaas/model/UpdateRegionalAreaIPv4.java | 398 + .../UpdateRouteOfRoutingTablePayload.java | 299 + .../UpdateRoutingTableOfAreaPayload.java | 424 + .../model/UpdateSecurityGroupPayload.java | 139 +- .../sdk/iaas/model/UpdateServerPayload.java | 138 +- .../sdk/iaas/model/UpdateSnapshotPayload.java | 175 +- .../sdk/iaas/model/UpdateVolumePayload.java | 139 +- .../cloud/stackit/sdk/iaas/model/Volume.java | 148 +- .../sdk/iaas/model/VolumeAttachment.java | 135 +- .../model/VolumeAttachmentListResponse.java | 140 +- .../iaas/model/VolumeEncryptionParameter.java | 143 +- .../sdk/iaas/model/VolumeListResponse.java | 138 +- .../iaas/model/VolumePerformanceClass.java | 143 +- .../VolumePerformanceClassListResponse.java | 140 +- .../stackit/sdk/iaas/model/VolumeSource.java | 139 +- .../stackit/sdk/iaas/api/DefaultApiTest.java | 7 +- .../stackit/sdk/iaas/api/IaasApiTest.java | 4 +- 173 files changed, 36969 insertions(+), 12205 deletions(-) create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddRoutesToRoutingTablePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddRoutingTableToAreaPayload.java delete mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Area.java delete mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaConfig.java delete mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaPrefixConfigIPv4.java delete mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAreaAddressFamily.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateIsolatedNetworkPayload.java delete mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAddressFamily.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRegionPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4.java delete mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4Body.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4WithPrefix.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4WithPrefixLength.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6.java delete mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6Body.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6WithPrefix.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6WithPrefixLength.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayloadAllOfNetworking.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/DestinationCIDRv4.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/DestinationCIDRv6.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageFromVolumePayload.java delete mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkAreaIPv4.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkIPv4.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkIPv6.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopBlackhole.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopIPv4.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopIPv6.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopInternet.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RegionalArea.java rename services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/{CreateAreaIPv4.java => RegionalAreaIPv4.java} (53%) create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RegionalAreaListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteDestination.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteNexthop.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RoutingTable.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RoutingTableListResponse.java rename services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/{CreateServerPayloadNetworking.java => ServerNetworking.java} (81%) delete mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAreaAddressFamily.java delete mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAreaIPv4.java delete mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAddressFamily.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAreaRegionPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateRegionalAreaIPv4.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateRouteOfRoutingTablePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateRoutingTableOfAreaPayload.java diff --git a/services/iaas/README.md b/services/iaas/README.md index 2c1410ba..2ff59cdb 100644 --- a/services/iaas/README.md +++ b/services/iaas/README.md @@ -1,6 +1,6 @@ -# STACKIT Java SDK for IaaS-API +# STACKIT Java SDK for STACKIT IaaS API -- API version: 1 +- API version: 2 This API allows you to create and modify IaaS resources. diff --git a/services/iaas/build.gradle b/services/iaas/build.gradle index 10cd648e..314067c8 100644 --- a/services/iaas/build.gradle +++ b/services/iaas/build.gradle @@ -10,8 +10,8 @@ dependencies { implementation 'com.google.code.gson:gson:2.9.1' implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' - implementation 'org.openapitools:jackson-databind-nullable:0.2.6' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' + implementation 'org.openapitools:jackson-databind-nullable:0.2.8' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiCallback.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiCallback.java index 8d6639f9..1e6f143f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiCallback.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiCallback.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiClient.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiClient.java index a724f2ba..fbcadb72 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiClient.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiClient.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,12 +52,12 @@ /** ApiClient class. */ public class ApiClient { - protected String basePath = "https://iaas.api.eu01.stackit.cloud"; + protected String basePath = "https://iaas.api.stackit.cloud"; protected List servers = new ArrayList( Arrays.asList( new ServerConfiguration( - "https://iaas.api.{region}stackit.cloud", + "https://iaas.api.stackit.cloud", "No description provided", new HashMap() { { @@ -65,9 +65,8 @@ public class ApiClient { "region", new ServerVariable( "No description provided", - "eu01.", - new HashSet( - Arrays.asList("eu01.")))); + "global", + new HashSet())); } }))); protected Integer serverIndex = 0; @@ -85,6 +84,7 @@ public class ApiClient { protected InputStream sslCaCert; protected boolean verifyingSsl; protected KeyManager[] keyManagers; + protected String tlsServerName; protected OkHttpClient httpClient; protected JSON json; @@ -190,8 +190,8 @@ public String getBasePath() { /** * Set base path * - * @param basePath Base path of the URL (e.g https://iaas.api.eu01.stackit.cloud - * @return An instance of OkHttpClient + * @param basePath Base path of the URL (e.g https://iaas.api.stackit.cloud) + * @return An instance of ApiClient */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -322,6 +322,28 @@ public ApiClient setKeyManagers(KeyManager[] managers) { return this; } + /** + * Get TLS server name for SNI (Server Name Indication). + * + * @return The TLS server name + */ + public String getTlsServerName() { + return tlsServerName; + } + + /** + * Set TLS server name for SNI (Server Name Indication). This is used to verify the server + * certificate against a specific hostname instead of the hostname in the URL. + * + * @param tlsServerName The TLS server name to use for certificate verification + * @return ApiClient + */ + public ApiClient setTlsServerName(String tlsServerName) { + this.tlsServerName = tlsServerName; + applySslSettings(); + return this; + } + /** * Getter for the field dateFormat. * @@ -606,7 +628,7 @@ public List parameterToPair(String name, Object value) { * @param value The value of the parameter. * @return A list of {@code Pair} objects. */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { + public List parameterToPairs(String collectionFormat, String name, Collection value) { List params = new ArrayList(); // preconditions @@ -828,7 +850,17 @@ public T deserialize(Response response, Type returnType) throws ApiException } try { if (isJsonMime(contentType)) { - return JSON.deserialize(respBody.byteStream(), returnType); + if (returnType.equals(String.class)) { + String respBodyString = respBody.string(); + if (respBodyString.isEmpty()) { + return null; + } + // Use String-based deserialize for String return type with fallback + return JSON.deserialize(respBodyString, returnType); + } else { + // Use InputStream-based deserialize which supports responses > 2GB + return JSON.deserialize(respBody.byteStream(), returnType); + } } else if (returnType.equals(String.class)) { String respBodyString = respBody.string(); if (respBodyString.isEmpty()) { @@ -1228,8 +1260,10 @@ public String buildUrl( if (serverIndex < 0 || serverIndex >= servers.size()) { throw new ArrayIndexOutOfBoundsException( String.format( + java.util.Locale.ROOT, "Invalid index %d when selecting the host settings. Must be less than %d", - serverIndex, servers.size())); + serverIndex, + servers.size())); } baseURL = servers.get(serverIndex).URL(serverVariables); } else { @@ -1303,12 +1337,16 @@ public void processHeaderParams(Map headerParams, Request.Builde public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { for (Entry param : cookieParams.entrySet()) { reqBuilder.addHeader( - "Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + "Cookie", + String.format( + java.util.Locale.ROOT, "%s=%s", param.getKey(), param.getValue())); } for (Entry param : defaultCookieMap.entrySet()) { if (!cookieParams.containsKey(param.getKey())) { reqBuilder.addHeader( - "Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + "Cookie", + String.format( + java.util.Locale.ROOT, "%s=%s", param.getKey(), param.getValue())); } } } @@ -1496,7 +1534,20 @@ public boolean verify(String hostname, SSLSession session) { trustManagerFactory.init(caKeyStore); } trustManagers = trustManagerFactory.getTrustManagers(); - hostnameVerifier = OkHostnameVerifier.INSTANCE; + if (tlsServerName != null && !tlsServerName.isEmpty()) { + hostnameVerifier = + new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + // Verify the certificate against tlsServerName instead of the + // actual hostname + return OkHostnameVerifier.INSTANCE.verify( + tlsServerName, session); + } + }; + } else { + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } } SSLContext sslContext = SSLContext.getInstance("TLS"); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiResponse.java index 9da9eeba..4c2f518f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/GzipRequestInterceptor.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/GzipRequestInterceptor.java index cb124625..1dcf7655 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/GzipRequestInterceptor.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/GzipRequestInterceptor.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/JSON.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/JSON.java index 5d780a53..3f9df25d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/JSON.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/JSON.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -34,6 +35,7 @@ import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; +import java.util.HashMap; import java.util.Map; import okio.ByteString; @@ -55,7 +57,68 @@ public class JSON { @SuppressWarnings("unchecked") public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder(); + GsonFireBuilder fireBuilder = + new GsonFireBuilder() + .registerTypeSelector( + cloud.stackit.sdk.iaas.model.RouteDestination.class, + new TypeSelector() { + @Override + public Class< + ? extends + cloud.stackit.sdk.iaas.model + .RouteDestination> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "cidrv4", + cloud.stackit.sdk.iaas.model.DestinationCIDRv4 + .class); + classByDiscriminatorValue.put( + "cidrv6", + cloud.stackit.sdk.iaas.model.DestinationCIDRv6 + .class); + classByDiscriminatorValue.put( + "Route_destination", + cloud.stackit.sdk.iaas.model.RouteDestination + .class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + .registerTypeSelector( + cloud.stackit.sdk.iaas.model.RouteNexthop.class, + new TypeSelector() { + @Override + public Class< + ? extends + cloud.stackit.sdk.iaas.model + .RouteNexthop> + getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = + new HashMap(); + classByDiscriminatorValue.put( + "blackhole", + cloud.stackit.sdk.iaas.model.NexthopBlackhole + .class); + classByDiscriminatorValue.put( + "internet", + cloud.stackit.sdk.iaas.model.NexthopInternet.class); + classByDiscriminatorValue.put( + "ipv4", + cloud.stackit.sdk.iaas.model.NexthopIPv4.class); + classByDiscriminatorValue.put( + "ipv6", + cloud.stackit.sdk.iaas.model.NexthopIPv6.class); + classByDiscriminatorValue.put( + "Route_nexthop", + cloud.stackit.sdk.iaas.model.RouteNexthop.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }); GsonBuilder builder = fireBuilder.createGsonBuilder(); return builder; } @@ -95,6 +158,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.AddRoutesToRoutingTablePayload + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.AddRoutingTableToAreaPayload + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.AddVolumeToServerPayload .CustomTypeAdapterFactory()); @@ -105,14 +174,8 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.AllowedAddressesInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.Area.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.AreaConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.AreaId.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.AreaPrefixConfigIPv4.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.AvailabilityZoneListResponse .CustomTypeAdapterFactory()); @@ -131,33 +194,43 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.CreateAffinityGroupPayload .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.CreateAreaAddressFamily - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.CreateAreaIPv4.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.CreateBackupPayload.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.CreateImagePayload.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.CreateKeyPairPayload.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.CreateNetworkAddressFamily + new cloud.stackit.sdk.iaas.model.CreateIsolatedNetworkPayload .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateKeyPairPayload.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.CreateNetworkAreaPayload .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.CreateNetworkAreaRangePayload .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateNetworkAreaRegionPayload + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.CreateNetworkAreaRoutePayload .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.CreateNetworkIPv4Body.CustomTypeAdapterFactory()); + new cloud.stackit.sdk.iaas.model.CreateNetworkIPv4.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateNetworkIPv4WithPrefix + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateNetworkIPv4WithPrefixLength + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.CreateNetworkIPv6Body.CustomTypeAdapterFactory()); + new cloud.stackit.sdk.iaas.model.CreateNetworkIPv6.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateNetworkIPv6WithPrefix + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateNetworkIPv6WithPrefixLength + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.CreateNetworkPayload.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -183,12 +256,16 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.CreateServerPayload.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.CreateServerPayloadNetworking + new cloud.stackit.sdk.iaas.model.CreateServerPayloadAllOfNetworking .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.CreateSnapshotPayload.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.CreateVolumePayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.DestinationCIDRv4.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.DestinationCIDRv6.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.Error.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -206,6 +283,8 @@ private static Class getClassByDiscriminator( new cloud.stackit.sdk.iaas.model.ImageConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.ImageCreateResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.ImageFromVolumePayload.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.ImageListResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -229,11 +308,13 @@ private static Class getClassByDiscriminator( new cloud.stackit.sdk.iaas.model.Network.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.NetworkArea.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.NetworkAreaIPv4.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.NetworkAreaListResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.NetworkIPv4.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.NetworkIPv6.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.NetworkListResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -241,6 +322,14 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.NetworkRangeListResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.NexthopBlackhole.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.NexthopIPv4.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.NexthopIPv6.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.NexthopInternet.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.PartialUpdateNetworkAreaPayload .CustomTypeAdapterFactory()); @@ -270,6 +359,13 @@ private static Class getClassByDiscriminator( new cloud.stackit.sdk.iaas.model.QuotaList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.QuotaListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.RegionalArea.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.RegionalAreaIPv4.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.RegionalAreaListResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.Request.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -282,8 +378,17 @@ private static Class getClassByDiscriminator( new cloud.stackit.sdk.iaas.model.ResizeVolumePayload.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.Route.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.RouteDestination.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.RouteListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.RouteNexthop.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.RoutingTable.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.RoutingTableListResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.SecurityGroup.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -309,6 +414,8 @@ private static Class getClassByDiscriminator( new cloud.stackit.sdk.iaas.model.ServerMaintenance.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.ServerNetwork.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.ServerNetworking.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.ServiceAccountMailListResponse .CustomTypeAdapterFactory()); @@ -318,11 +425,6 @@ private static Class getClassByDiscriminator( new cloud.stackit.sdk.iaas.model.Snapshot.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.SnapshotListResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.UpdateAreaAddressFamily - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.UpdateAreaIPv4.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.UpdateAttachedVolumePayload .CustomTypeAdapterFactory()); @@ -336,7 +438,7 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.UpdateKeyPairPayload.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new cloud.stackit.sdk.iaas.model.UpdateNetworkAddressFamily + new cloud.stackit.sdk.iaas.model.UpdateNetworkAreaRegionPayload .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.UpdateNetworkAreaRoutePayload @@ -349,6 +451,14 @@ private static Class getClassByDiscriminator( new cloud.stackit.sdk.iaas.model.UpdateNicPayload.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.UpdatePublicIPPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateRegionalAreaIPv4.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateRouteOfRoutingTablePayload + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateRoutingTableOfAreaPayload + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.model.UpdateSecurityGroupPayload .CustomTypeAdapterFactory()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/Pair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/Pair.java index 25a73fde..dc57930d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/Pair.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/Pair.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,7 +14,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Pair { private final String name; private final String value; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressRequestBody.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressRequestBody.java index 0817b862..08d131df 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressRequestBody.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressRequestBody.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressResponseBody.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressResponseBody.java index 5a41d02c..9eab5aa7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressResponseBody.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressResponseBody.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerConfiguration.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerConfiguration.java index 37083c1d..7ac9ed5c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerConfiguration.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerConfiguration.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -17,7 +17,7 @@ /** Representing a Server configuration. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ServerConfiguration { public String URL; public String description; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerVariable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerVariable.java index b3e35f0a..d2925be9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerVariable.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerVariable.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -17,7 +17,7 @@ /** Representing a Server Variable for server URL template substitution. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/StringUtil.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/StringUtil.java index 85090511..ff3e6083 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/StringUtil.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/StringUtil.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -17,7 +17,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/DefaultApi.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/DefaultApi.java index 44de9262..5a6a8d89 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/DefaultApi.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/DefaultApi.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,6 +18,8 @@ import cloud.stackit.sdk.iaas.ApiClient; import cloud.stackit.sdk.iaas.ApiResponse; import cloud.stackit.sdk.iaas.Pair; +import cloud.stackit.sdk.iaas.model.AddRoutesToRoutingTablePayload; +import cloud.stackit.sdk.iaas.model.AddRoutingTableToAreaPayload; import cloud.stackit.sdk.iaas.model.AddVolumeToServerPayload; import cloud.stackit.sdk.iaas.model.AffinityGroup; import cloud.stackit.sdk.iaas.model.AffinityGroupListResponse; @@ -27,9 +29,11 @@ import cloud.stackit.sdk.iaas.model.CreateAffinityGroupPayload; import cloud.stackit.sdk.iaas.model.CreateBackupPayload; import cloud.stackit.sdk.iaas.model.CreateImagePayload; +import cloud.stackit.sdk.iaas.model.CreateIsolatedNetworkPayload; import cloud.stackit.sdk.iaas.model.CreateKeyPairPayload; import cloud.stackit.sdk.iaas.model.CreateNetworkAreaPayload; import cloud.stackit.sdk.iaas.model.CreateNetworkAreaRangePayload; +import cloud.stackit.sdk.iaas.model.CreateNetworkAreaRegionPayload; import cloud.stackit.sdk.iaas.model.CreateNetworkAreaRoutePayload; import cloud.stackit.sdk.iaas.model.CreateNetworkPayload; import cloud.stackit.sdk.iaas.model.CreateNicPayload; @@ -42,6 +46,7 @@ import cloud.stackit.sdk.iaas.model.GetServerLog200Response; import cloud.stackit.sdk.iaas.model.Image; import cloud.stackit.sdk.iaas.model.ImageCreateResponse; +import cloud.stackit.sdk.iaas.model.ImageFromVolumePayload; import cloud.stackit.sdk.iaas.model.ImageListResponse; import cloud.stackit.sdk.iaas.model.ImageShare; import cloud.stackit.sdk.iaas.model.ImageShareConsumer; @@ -65,12 +70,16 @@ import cloud.stackit.sdk.iaas.model.PublicIpListResponse; import cloud.stackit.sdk.iaas.model.PublicNetworkListResponse; import cloud.stackit.sdk.iaas.model.QuotaListResponse; +import cloud.stackit.sdk.iaas.model.RegionalArea; +import cloud.stackit.sdk.iaas.model.RegionalAreaListResponse; import cloud.stackit.sdk.iaas.model.Request; import cloud.stackit.sdk.iaas.model.RescueServerPayload; import cloud.stackit.sdk.iaas.model.ResizeServerPayload; import cloud.stackit.sdk.iaas.model.ResizeVolumePayload; import cloud.stackit.sdk.iaas.model.Route; import cloud.stackit.sdk.iaas.model.RouteListResponse; +import cloud.stackit.sdk.iaas.model.RoutingTable; +import cloud.stackit.sdk.iaas.model.RoutingTableListResponse; import cloud.stackit.sdk.iaas.model.SecurityGroup; import cloud.stackit.sdk.iaas.model.SecurityGroupListResponse; import cloud.stackit.sdk.iaas.model.SecurityGroupRule; @@ -87,9 +96,12 @@ import cloud.stackit.sdk.iaas.model.UpdateImagePayload; import cloud.stackit.sdk.iaas.model.UpdateImageSharePayload; import cloud.stackit.sdk.iaas.model.UpdateKeyPairPayload; +import cloud.stackit.sdk.iaas.model.UpdateNetworkAreaRegionPayload; import cloud.stackit.sdk.iaas.model.UpdateNetworkAreaRoutePayload; import cloud.stackit.sdk.iaas.model.UpdateNicPayload; import cloud.stackit.sdk.iaas.model.UpdatePublicIPPayload; +import cloud.stackit.sdk.iaas.model.UpdateRouteOfRoutingTablePayload; +import cloud.stackit.sdk.iaas.model.UpdateRoutingTableOfAreaPayload; import cloud.stackit.sdk.iaas.model.UpdateSecurityGroupPayload; import cloud.stackit.sdk.iaas.model.UpdateServerPayload; import cloud.stackit.sdk.iaas.model.UpdateSnapshotPayload; @@ -191,6 +203,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * Build call for addNetworkToServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param networkId The identifier (ID) of a STACKIT Network. (required) * @param _callback Callback for upload/download progress @@ -210,6 +223,7 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call addNetworkToServerCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID networkId, final ApiCallback _callback) @@ -231,10 +245,13 @@ public okhttp3.Call addNetworkToServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/networks/{networkId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "serverId" + "}", localVarApiClient.escapeString(serverId.toString())) @@ -279,6 +296,7 @@ public okhttp3.Call addNetworkToServerCall( @SuppressWarnings("rawtypes") private okhttp3.Call addNetworkToServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID networkId, final ApiCallback _callback) @@ -289,6 +307,12 @@ private okhttp3.Call addNetworkToServerValidateBeforeCall( "Missing the required parameter 'projectId' when calling addNetworkToServer(Async)"); } + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling addNetworkToServer(Async)"); + } + // verify the required parameter 'serverId' is set if (serverId == null) { throw new ApiException( @@ -301,7 +325,7 @@ private okhttp3.Call addNetworkToServerValidateBeforeCall( "Missing the required parameter 'networkId' when calling addNetworkToServer(Async)"); } - return addNetworkToServerCall(projectId, serverId, networkId, _callback); + return addNetworkToServerCall(projectId, region, serverId, networkId, _callback); } /** @@ -309,6 +333,7 @@ private okhttp3.Call addNetworkToServerValidateBeforeCall( * interface from the specified network to the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param networkId The identifier (ID) of a STACKIT Network. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -327,10 +352,11 @@ private okhttp3.Call addNetworkToServerValidateBeforeCall( */ public void addNetworkToServer( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID networkId) throws ApiException { - addNetworkToServerWithHttpInfo(projectId, serverId, networkId); + addNetworkToServerWithHttpInfo(projectId, region, serverId, networkId); } /** @@ -338,6 +364,7 @@ public void addNetworkToServer( * interface from the specified network to the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param networkId The identifier (ID) of a STACKIT Network. (required) * @return ApiResponse<Void> @@ -357,11 +384,12 @@ public void addNetworkToServer( */ public ApiResponse addNetworkToServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID networkId) throws ApiException { okhttp3.Call localVarCall = - addNetworkToServerValidateBeforeCall(projectId, serverId, networkId, null); + addNetworkToServerValidateBeforeCall(projectId, region, serverId, networkId, null); return localVarApiClient.execute(localVarCall); } @@ -370,6 +398,7 @@ public ApiResponse addNetworkToServerWithHttpInfo( * attach a network interface from the specified network to the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param networkId The identifier (ID) of a STACKIT Network. (required) * @param _callback The callback to be executed when the API call finishes @@ -390,13 +419,15 @@ public ApiResponse addNetworkToServerWithHttpInfo( */ public okhttp3.Call addNetworkToServerAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID networkId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - addNetworkToServerValidateBeforeCall(projectId, serverId, networkId, _callback); + addNetworkToServerValidateBeforeCall( + projectId, region, serverId, networkId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } @@ -405,6 +436,7 @@ public okhttp3.Call addNetworkToServerAsync( * Build call for addNicToServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param nicId The identifier (ID) of a network interface. (required) * @param _callback Callback for upload/download progress @@ -425,6 +457,7 @@ public okhttp3.Call addNetworkToServerAsync( */ public okhttp3.Call addNicToServerCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID nicId, final ApiCallback _callback) @@ -446,10 +479,13 @@ public okhttp3.Call addNicToServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics/{nicId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "serverId" + "}", localVarApiClient.escapeString(serverId.toString())) @@ -494,6 +530,7 @@ public okhttp3.Call addNicToServerCall( @SuppressWarnings("rawtypes") private okhttp3.Call addNicToServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID nicId, final ApiCallback _callback) @@ -504,6 +541,12 @@ private okhttp3.Call addNicToServerValidateBeforeCall( "Missing the required parameter 'projectId' when calling addNicToServer(Async)"); } + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling addNicToServer(Async)"); + } + // verify the required parameter 'serverId' is set if (serverId == null) { throw new ApiException( @@ -516,13 +559,14 @@ private okhttp3.Call addNicToServerValidateBeforeCall( "Missing the required parameter 'nicId' when calling addNicToServer(Async)"); } - return addNicToServerCall(projectId, serverId, nicId, _callback); + return addNicToServerCall(projectId, region, serverId, nicId, _callback); } /** * Attach an existing network interface. Attach an existing network interface to a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param nicId The identifier (ID) of a network interface. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -542,16 +586,18 @@ private okhttp3.Call addNicToServerValidateBeforeCall( */ public void addNicToServer( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID nicId) throws ApiException { - addNicToServerWithHttpInfo(projectId, serverId, nicId); + addNicToServerWithHttpInfo(projectId, region, serverId, nicId); } /** * Attach an existing network interface. Attach an existing network interface to a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param nicId The identifier (ID) of a network interface. (required) * @return ApiResponse<Void> @@ -572,11 +618,12 @@ public void addNicToServer( */ public ApiResponse addNicToServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID nicId) throws ApiException { okhttp3.Call localVarCall = - addNicToServerValidateBeforeCall(projectId, serverId, nicId, null); + addNicToServerValidateBeforeCall(projectId, region, serverId, nicId, null); return localVarApiClient.execute(localVarCall); } @@ -585,6 +632,7 @@ public ApiResponse addNicToServerWithHttpInfo( * to a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param nicId The identifier (ID) of a network interface. (required) * @param _callback The callback to be executed when the API call finishes @@ -606,13 +654,14 @@ public ApiResponse addNicToServerWithHttpInfo( */ public okhttp3.Call addNicToServerAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID nicId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - addNicToServerValidateBeforeCall(projectId, serverId, nicId, _callback); + addNicToServerValidateBeforeCall(projectId, region, serverId, nicId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } @@ -621,6 +670,7 @@ public okhttp3.Call addNicToServerAsync( * Build call for addPublicIpToServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param publicIpId The identifier (ID) of a Public IP. (required) * @param _callback Callback for upload/download progress @@ -641,6 +691,7 @@ public okhttp3.Call addNicToServerAsync( */ public okhttp3.Call addPublicIpToServerCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID publicIpId, final ApiCallback _callback) @@ -662,10 +713,13 @@ public okhttp3.Call addPublicIpToServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/public-ips/{publicIpId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "serverId" + "}", localVarApiClient.escapeString(serverId.toString())) @@ -710,6 +764,7 @@ public okhttp3.Call addPublicIpToServerCall( @SuppressWarnings("rawtypes") private okhttp3.Call addPublicIpToServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID publicIpId, final ApiCallback _callback) @@ -720,6 +775,12 @@ private okhttp3.Call addPublicIpToServerValidateBeforeCall( "Missing the required parameter 'projectId' when calling addPublicIpToServer(Async)"); } + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling addPublicIpToServer(Async)"); + } + // verify the required parameter 'serverId' is set if (serverId == null) { throw new ApiException( @@ -732,13 +793,14 @@ private okhttp3.Call addPublicIpToServerValidateBeforeCall( "Missing the required parameter 'publicIpId' when calling addPublicIpToServer(Async)"); } - return addPublicIpToServerCall(projectId, serverId, publicIpId, _callback); + return addPublicIpToServerCall(projectId, region, serverId, publicIpId, _callback); } /** * Associate a public IP to the server. Associate a public IP to a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param publicIpId The identifier (ID) of a Public IP. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -758,16 +820,18 @@ private okhttp3.Call addPublicIpToServerValidateBeforeCall( */ public void addPublicIpToServer( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID publicIpId) throws ApiException { - addPublicIpToServerWithHttpInfo(projectId, serverId, publicIpId); + addPublicIpToServerWithHttpInfo(projectId, region, serverId, publicIpId); } /** * Associate a public IP to the server. Associate a public IP to a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param publicIpId The identifier (ID) of a Public IP. (required) * @return ApiResponse<Void> @@ -788,11 +852,13 @@ public void addPublicIpToServer( */ public ApiResponse addPublicIpToServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID publicIpId) throws ApiException { okhttp3.Call localVarCall = - addPublicIpToServerValidateBeforeCall(projectId, serverId, publicIpId, null); + addPublicIpToServerValidateBeforeCall( + projectId, region, serverId, publicIpId, null); return localVarApiClient.execute(localVarCall); } @@ -800,6 +866,7 @@ public ApiResponse addPublicIpToServerWithHttpInfo( * Associate a public IP to the server. (asynchronously) Associate a public IP to a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param publicIpId The identifier (ID) of a Public IP. (required) * @param _callback The callback to be executed when the API call finishes @@ -821,23 +888,28 @@ public ApiResponse addPublicIpToServerWithHttpInfo( */ public okhttp3.Call addPublicIpToServerAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UUID publicIpId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - addPublicIpToServerValidateBeforeCall(projectId, serverId, publicIpId, _callback); + addPublicIpToServerValidateBeforeCall( + projectId, region, serverId, publicIpId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for addSecurityGroupToServer + * Build call for addRoutesToRoutingTable * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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 addRoutesToRoutingTablePayload Request an addition of routes to a routing table. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -845,7 +917,7 @@ public okhttp3.Call addPublicIpToServerAsync( * * * - * + * * * * @@ -854,10 +926,12 @@ public okhttp3.Call addPublicIpToServerAsync( * *
Response Details
Status Code Description Response Headers
202 Security group attachment request was accepted. -
201 Adding routes to routing table was successful. -
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 addSecurityGroupToServerCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID securityGroupId, + public okhttp3.Call addRoutesToRoutingTableCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -873,20 +947,23 @@ public okhttp3.Call addSecurityGroupToServerCall( basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = addRoutesToRoutingTablePayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())) + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) .replace( - "{" + "securityGroupId" + "}", - localVarApiClient.escapeString(securityGroupId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "routingTableId" + "}", + localVarApiClient.escapeString(routingTableId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -900,7 +977,7 @@ public okhttp3.Call addSecurityGroupToServerCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -911,7 +988,7 @@ public okhttp3.Call addSecurityGroupToServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PUT", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -923,46 +1000,70 @@ public okhttp3.Call addSecurityGroupToServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call addSecurityGroupToServerValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID securityGroupId, + private okhttp3.Call addRoutesToRoutingTableValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling addSecurityGroupToServer(Async)"); + "Missing the required parameter 'organizationId' when calling addRoutesToRoutingTable(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling addSecurityGroupToServer(Async)"); + "Missing the required parameter 'areaId' when calling addRoutesToRoutingTable(Async)"); } - // verify the required parameter 'securityGroupId' is set - if (securityGroupId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'securityGroupId' when calling addSecurityGroupToServer(Async)"); + "Missing the required parameter 'region' when calling addRoutesToRoutingTable(Async)"); + } + + // verify the required parameter 'routingTableId' is set + if (routingTableId == null) { + throw new ApiException( + "Missing the required parameter 'routingTableId' when calling addRoutesToRoutingTable(Async)"); } - return addSecurityGroupToServerCall(projectId, serverId, securityGroupId, _callback); + // verify the required parameter 'addRoutesToRoutingTablePayload' is set + if (addRoutesToRoutingTablePayload == null) { + throw new ApiException( + "Missing the required parameter 'addRoutesToRoutingTablePayload' when calling addRoutesToRoutingTable(Async)"); + } + + return addRoutesToRoutingTableCall( + organizationId, + areaId, + region, + routingTableId, + addRoutesToRoutingTablePayload, + _callback); } /** - * Add a server to a security group. Add an existing server to an existing security group. + * Create new routes in a routing table. Create new routes in an existing routing table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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 addRoutesToRoutingTablePayload Request an addition of routes to a routing table. + * (required) + * @return RouteListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -971,28 +1072,40 @@ private okhttp3.Call addSecurityGroupToServerValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
202 Security group attachment request was accepted. -
201 Adding routes to routing table was successful. -
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 void addSecurityGroupToServer( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID securityGroupId) + public RouteListResponse addRoutesToRoutingTable( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload) throws ApiException { - addSecurityGroupToServerWithHttpInfo(projectId, serverId, securityGroupId); + ApiResponse localVarResp = + addRoutesToRoutingTableWithHttpInfo( + organizationId, + areaId, + region, + routingTableId, + addRoutesToRoutingTablePayload); + return localVarResp.getData(); } /** - * Add a server to a security group. Add an existing server to an existing security group. + * Create new routes in a routing table. Create new routes in an existing routing table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @return ApiResponse<Void> + * @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 addRoutesToRoutingTablePayload Request an addition of routes to a routing table. + * (required) + * @return ApiResponse<RouteListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -1001,24 +1114,35 @@ public void addSecurityGroupToServer( * *
Response Details
Status Code Description Response Headers
202 Security group attachment request was accepted. -
201 Adding routes to routing table was successful. -
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 addSecurityGroupToServerWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID securityGroupId) + public ApiResponse addRoutesToRoutingTableWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload) throws ApiException { okhttp3.Call localVarCall = - addSecurityGroupToServerValidateBeforeCall( - projectId, serverId, securityGroupId, null); - return localVarApiClient.execute(localVarCall); + addRoutesToRoutingTableValidateBeforeCall( + organizationId, + areaId, + region, + routingTableId, + addRoutesToRoutingTablePayload, + null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Add a server to a security group. (asynchronously) Add an existing server to an existing - * security group. + * Create new routes in a routing table. (asynchronously) Create new routes in an existing + * routing table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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 addRoutesToRoutingTablePayload Request an addition of routes to a 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 @@ -1027,7 +1151,7 @@ public ApiResponse addSecurityGroupToServerWithHttpInfo( * * * - * + * * * * @@ -1036,26 +1160,36 @@ public ApiResponse addSecurityGroupToServerWithHttpInfo( * *
Response Details
Status Code Description Response Headers
202 Security group attachment request was accepted. -
201 Adding routes to routing table was successful. -
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 addSecurityGroupToServerAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID securityGroupId, - final ApiCallback _callback) + public okhttp3.Call addRoutesToRoutingTableAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - addSecurityGroupToServerValidateBeforeCall( - projectId, serverId, securityGroupId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + addRoutesToRoutingTableValidateBeforeCall( + organizationId, + areaId, + region, + routingTableId, + addRoutesToRoutingTablePayload, + _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for addServiceAccountToServer + * Build call for addRoutingTableToArea * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param serviceAccountMail The e-mail address of a service account. (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 addRoutingTableToAreaPayload Request an addition of a routing table to an area. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1063,7 +1197,7 @@ public okhttp3.Call addSecurityGroupToServerAsync( * * * - * + * * * * @@ -1072,10 +1206,11 @@ public okhttp3.Call addSecurityGroupToServerAsync( * *
Response Details
Status Code Description Response Headers
201 Service account attached to the server. -
201 Adding routing table was successful. -
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 addServiceAccountToServerCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull String serviceAccountMail, + public okhttp3.Call addRoutingTableToAreaCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull AddRoutingTableToAreaPayload addRoutingTableToAreaPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1091,20 +1226,20 @@ public okhttp3.Call addServiceAccountToServerCall( basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = addRoutingTableToAreaPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())) + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) .replace( - "{" + "serviceAccountMail" + "}", - localVarApiClient.escapeString(serviceAccountMail.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1118,7 +1253,7 @@ public okhttp3.Call addServiceAccountToServerCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1129,7 +1264,7 @@ public okhttp3.Call addServiceAccountToServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PUT", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1141,47 +1276,58 @@ public okhttp3.Call addServiceAccountToServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call addServiceAccountToServerValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull String serviceAccountMail, + private okhttp3.Call addRoutingTableToAreaValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull AddRoutingTableToAreaPayload addRoutingTableToAreaPayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling addServiceAccountToServer(Async)"); + "Missing the required parameter 'organizationId' when calling addRoutingTableToArea(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling addServiceAccountToServer(Async)"); + "Missing the required parameter 'areaId' when calling addRoutingTableToArea(Async)"); } - // verify the required parameter 'serviceAccountMail' is set - if (serviceAccountMail == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'serviceAccountMail' when calling addServiceAccountToServer(Async)"); + "Missing the required parameter 'region' when calling addRoutingTableToArea(Async)"); + } + + // verify the required parameter 'addRoutingTableToAreaPayload' is set + if (addRoutingTableToAreaPayload == null) { + throw new ApiException( + "Missing the required parameter 'addRoutingTableToAreaPayload' when calling addRoutingTableToArea(Async)"); } - return addServiceAccountToServerCall(projectId, serverId, serviceAccountMail, _callback); + return addRoutingTableToAreaCall( + organizationId, areaId, region, addRoutingTableToAreaPayload, _callback); } /** - * Attach service account to a server. Attach an additional service account to the server. + * Create new routing table in a network area. Create a new routing table in an existing network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param serviceAccountMail The e-mail address of a service account. (required) - * @return ServiceAccountMailListResponse + * @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 addRoutingTableToAreaPayload Request an addition of a routing table to an area. + * (required) + * @return RoutingTable * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -1190,30 +1336,35 @@ private okhttp3.Call addServiceAccountToServerValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
201 Service account attached to the server. -
201 Adding routing table was successful. -
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 ServiceAccountMailListResponse addServiceAccountToServer( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull String serviceAccountMail) + public RoutingTable addRoutingTableToArea( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull AddRoutingTableToAreaPayload addRoutingTableToAreaPayload) throws ApiException { - ApiResponse localVarResp = - addServiceAccountToServerWithHttpInfo(projectId, serverId, serviceAccountMail); + ApiResponse localVarResp = + addRoutingTableToAreaWithHttpInfo( + organizationId, areaId, region, addRoutingTableToAreaPayload); return localVarResp.getData(); } /** - * Attach service account to a server. Attach an additional service account to the server. + * Create new routing table in a network area. Create a new routing table in an existing network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param serviceAccountMail The e-mail address of a service account. (required) - * @return ApiResponse<ServiceAccountMailListResponse> + * @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 addRoutingTableToAreaPayload Request an addition of a routing table to an area. + * (required) + * @return ApiResponse<RoutingTable> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -1222,25 +1373,28 @@ public ServiceAccountMailListResponse addServiceAccountToServer( * *
Response Details
Status Code Description Response Headers
201 Service account attached to the server. -
201 Adding routing table was successful. -
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 addServiceAccountToServerWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull String serviceAccountMail) + public ApiResponse addRoutingTableToAreaWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull AddRoutingTableToAreaPayload addRoutingTableToAreaPayload) throws ApiException { okhttp3.Call localVarCall = - addServiceAccountToServerValidateBeforeCall( - projectId, serverId, serviceAccountMail, null); - Type localVarReturnType = new TypeToken() {}.getType(); + addRoutingTableToAreaValidateBeforeCall( + organizationId, areaId, region, addRoutingTableToAreaPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Attach service account to a server. (asynchronously) Attach an additional service account to - * the server. + * Create new routing table in a network area. (asynchronously) Create a new routing table in an + * existing network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param serviceAccountMail The e-mail address of a service account. (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 addRoutingTableToAreaPayload Request an addition of a routing table to an area. + * (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 @@ -1249,7 +1403,7 @@ public ApiResponse addServiceAccountToServerWith * * * - * + * * * * @@ -1258,28 +1412,29 @@ public ApiResponse addServiceAccountToServerWith * *
Response Details
Status Code Description Response Headers
201 Service account attached to the server. -
201 Adding routing table was successful. -
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 addServiceAccountToServerAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull String serviceAccountMail, - final ApiCallback _callback) + public okhttp3.Call addRoutingTableToAreaAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull AddRoutingTableToAreaPayload addRoutingTableToAreaPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - addServiceAccountToServerValidateBeforeCall( - projectId, serverId, serviceAccountMail, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + addRoutingTableToAreaValidateBeforeCall( + organizationId, areaId, region, addRoutingTableToAreaPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for addVolumeToServer + * Build call for addSecurityGroupToServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param addVolumeToServerPayload Request a volume attachment creation. (optional) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1287,7 +1442,7 @@ public okhttp3.Call addServiceAccountToServerAsync( * * * - * + * * * * @@ -1296,11 +1451,11 @@ public okhttp3.Call addServiceAccountToServerAsync( * *
Response Details
Status Code Description Response Headers
202 Volume attachment request was accepted. -
202 Security group attachment request was accepted. -
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 addVolumeToServerCall( + public okhttp3.Call addSecurityGroupToServerCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload, + @javax.annotation.Nonnull UUID securityGroupId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1316,20 +1471,23 @@ public okhttp3.Call addVolumeToServerCall( basePath = null; } - Object localVarPostBody = addVolumeToServerPayload; + Object localVarPostBody = null; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/security-groups/{securityGroupId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "serverId" + "}", localVarApiClient.escapeString(serverId.toString())) .replace( - "{" + "volumeId" + "}", - localVarApiClient.escapeString(volumeId.toString())); + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1343,7 +1501,7 @@ public okhttp3.Call addVolumeToServerCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1366,50 +1524,55 @@ public okhttp3.Call addVolumeToServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call addVolumeToServerValidateBeforeCall( + private okhttp3.Call addSecurityGroupToServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload, + @javax.annotation.Nonnull UUID securityGroupId, 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 addVolumeToServer(Async)"); + "Missing the required parameter 'projectId' when calling addSecurityGroupToServer(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling addSecurityGroupToServer(Async)"); } // verify the required parameter 'serverId' is set if (serverId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling addVolumeToServer(Async)"); + "Missing the required parameter 'serverId' when calling addSecurityGroupToServer(Async)"); } - // verify the required parameter 'volumeId' is set - if (volumeId == null) { + // verify the required parameter 'securityGroupId' is set + if (securityGroupId == null) { throw new ApiException( - "Missing the required parameter 'volumeId' when calling addVolumeToServer(Async)"); + "Missing the required parameter 'securityGroupId' when calling addSecurityGroupToServer(Async)"); } - return addVolumeToServerCall( - projectId, serverId, volumeId, addVolumeToServerPayload, _callback); + return addSecurityGroupToServerCall( + projectId, region, serverId, securityGroupId, _callback); } /** - * Attach a volume to a server. Attach an existing volume to an existing server. + * Add a server to a security group. Add an existing server to an existing security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param addVolumeToServerPayload Request a volume attachment creation. (optional) - * @return VolumeAttachment + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -1418,33 +1581,30 @@ private okhttp3.Call addVolumeToServerValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
202 Volume attachment request was accepted. -
202 Security group attachment request was accepted. -
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 VolumeAttachment addVolumeToServer( + public void addSecurityGroupToServer( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload) + @javax.annotation.Nonnull UUID securityGroupId) throws ApiException { - ApiResponse localVarResp = - addVolumeToServerWithHttpInfo( - projectId, serverId, volumeId, addVolumeToServerPayload); - return localVarResp.getData(); + addSecurityGroupToServerWithHttpInfo(projectId, region, serverId, securityGroupId); } /** - * Attach a volume to a server. Attach an existing volume to an existing server. + * Add a server to a security group. Add an existing server to an existing security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param addVolumeToServerPayload Request a volume attachment creation. (optional) - * @return ApiResponse<VolumeAttachment> + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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 * * * - * + * * * * @@ -1453,27 +1613,26 @@ public VolumeAttachment addVolumeToServer( * *
Response Details
Status Code Description Response Headers
202 Volume attachment request was accepted. -
202 Security group attachment request was accepted. -
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 addVolumeToServerWithHttpInfo( + public ApiResponse addSecurityGroupToServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload) + @javax.annotation.Nonnull UUID securityGroupId) throws ApiException { okhttp3.Call localVarCall = - addVolumeToServerValidateBeforeCall( - projectId, serverId, volumeId, addVolumeToServerPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + addSecurityGroupToServerValidateBeforeCall( + projectId, region, serverId, securityGroupId, null); + return localVarApiClient.execute(localVarCall); } /** - * Attach a volume to a server. (asynchronously) Attach an existing volume to an existing - * server. + * Add a server to a security group. (asynchronously) Add an existing server to an existing + * security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param addVolumeToServerPayload Request a volume attachment creation. (optional) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1482,7 +1641,7 @@ public ApiResponse addVolumeToServerWithHttpInfo( * * * - * + * * * * @@ -1491,27 +1650,28 @@ public ApiResponse addVolumeToServerWithHttpInfo( * *
Response Details
Status Code Description Response Headers
202 Volume attachment request was accepted. -
202 Security group attachment request was accepted. -
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 addVolumeToServerAsync( + public okhttp3.Call addSecurityGroupToServerAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload, - final ApiCallback _callback) + @javax.annotation.Nonnull UUID securityGroupId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - addVolumeToServerValidateBeforeCall( - projectId, serverId, volumeId, addVolumeToServerPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + addSecurityGroupToServerValidateBeforeCall( + projectId, region, serverId, securityGroupId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for createAffinityGroup + * Build call for addServiceAccountToServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createAffinityGroupPayload Request a affinity group creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param serviceAccountMail The e-mail address of a service account. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1519,17 +1679,20 @@ public okhttp3.Call addVolumeToServerAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Affinity group was created successfully. -
201 Service account attached to the server. -
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 createAffinityGroupCall( + public okhttp3.Call addServiceAccountToServerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1545,14 +1708,23 @@ public okhttp3.Call createAffinityGroupCall( basePath = null; } - Object localVarPostBody = createAffinityGroupPayload; + Object localVarPostBody = null; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/affinity-groups" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts/{serviceAccountMail}" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "serviceAccountMail" + "}", + localVarApiClient.escapeString(serviceAccountMail.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1566,7 +1738,7 @@ public okhttp3.Call createAffinityGroupCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1577,7 +1749,7 @@ public okhttp3.Call createAffinityGroupCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1589,93 +1761,120 @@ public okhttp3.Call createAffinityGroupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createAffinityGroupValidateBeforeCall( + private okhttp3.Call addServiceAccountToServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail, 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 createAffinityGroup(Async)"); + "Missing the required parameter 'projectId' when calling addServiceAccountToServer(Async)"); } - // verify the required parameter 'createAffinityGroupPayload' is set - if (createAffinityGroupPayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'createAffinityGroupPayload' when calling createAffinityGroup(Async)"); + "Missing the required parameter 'region' when calling addServiceAccountToServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling addServiceAccountToServer(Async)"); + } + + // verify the required parameter 'serviceAccountMail' is set + if (serviceAccountMail == null) { + throw new ApiException( + "Missing the required parameter 'serviceAccountMail' when calling addServiceAccountToServer(Async)"); } - return createAffinityGroupCall(projectId, createAffinityGroupPayload, _callback); + return addServiceAccountToServerCall( + projectId, region, serverId, serviceAccountMail, _callback); } /** - * Create a new affinity group in a project. Create a new server affinity group in the given - * project ID. + * Attach service account to a server. Attach an additional service account to the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createAffinityGroupPayload Request a affinity group creation. (required) - * @return AffinityGroup + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param serviceAccountMail The e-mail address of a service account. (required) + * @return ServiceAccountMailListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Affinity group was created successfully. -
201 Service account attached to the server. -
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 AffinityGroup createAffinityGroup( + public ServiceAccountMailListResponse addServiceAccountToServer( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail) throws ApiException { - ApiResponse localVarResp = - createAffinityGroupWithHttpInfo(projectId, createAffinityGroupPayload); + ApiResponse localVarResp = + addServiceAccountToServerWithHttpInfo( + projectId, region, serverId, serviceAccountMail); return localVarResp.getData(); } /** - * Create a new affinity group in a project. Create a new server affinity group in the given - * project ID. + * Attach service account to a server. Attach an additional service account to the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createAffinityGroupPayload Request a affinity group creation. (required) - * @return ApiResponse<AffinityGroup> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param serviceAccountMail The e-mail address of a service account. (required) + * @return ApiResponse<ServiceAccountMailListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Affinity group was created successfully. -
201 Service account attached to the server. -
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 createAffinityGroupWithHttpInfo( + public ApiResponse addServiceAccountToServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail) throws ApiException { okhttp3.Call localVarCall = - createAffinityGroupValidateBeforeCall(projectId, createAffinityGroupPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + addServiceAccountToServerValidateBeforeCall( + projectId, region, serverId, serviceAccountMail, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create a new affinity group in a project. (asynchronously) Create a new server affinity group - * in the given project ID. + * Attach service account to a server. (asynchronously) Attach an additional service account to + * the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createAffinityGroupPayload Request a affinity group creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param serviceAccountMail The e-mail address of a service account. (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 @@ -1684,33 +1883,39 @@ public ApiResponse createAffinityGroupWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Affinity group was created successfully. -
201 Service account attached to the server. -
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 createAffinityGroupAsync( + public okhttp3.Call addServiceAccountToServerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createAffinityGroupValidateBeforeCall( - projectId, createAffinityGroupPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + addServiceAccountToServerValidateBeforeCall( + projectId, region, serverId, serviceAccountMail, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createBackup + * Build call for addVolumeToServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createBackupPayload Request a backup creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param addVolumeToServerPayload Request a volume attachment creation. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1718,17 +1923,21 @@ public okhttp3.Call createAffinityGroupAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Create request for Backup accepted. -
202 Volume attachment request was 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 createBackupCall( + public okhttp3.Call addVolumeToServerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateBackupPayload createBackupPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1744,14 +1953,23 @@ public okhttp3.Call createBackupCall( basePath = null; } - Object localVarPostBody = createBackupPayload; + Object localVarPostBody = addVolumeToServerPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/backups" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "volumeId" + "}", + localVarApiClient.escapeString(volumeId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1776,7 +1994,7 @@ public okhttp3.Call createBackupCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1788,92 +2006,126 @@ public okhttp3.Call createBackupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createBackupValidateBeforeCall( + private okhttp3.Call addVolumeToServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateBackupPayload createBackupPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload, 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 createBackup(Async)"); + "Missing the required parameter 'projectId' when calling addVolumeToServer(Async)"); } - // verify the required parameter 'createBackupPayload' is set - if (createBackupPayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'createBackupPayload' when calling createBackup(Async)"); + "Missing the required parameter 'region' when calling addVolumeToServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling addVolumeToServer(Async)"); } - return createBackupCall(projectId, createBackupPayload, _callback); + // verify the required parameter 'volumeId' is set + if (volumeId == null) { + throw new ApiException( + "Missing the required parameter 'volumeId' when calling addVolumeToServer(Async)"); + } + + return addVolumeToServerCall( + projectId, region, serverId, volumeId, addVolumeToServerPayload, _callback); } /** - * Create new Backup. Create a new Backup in a project. If a snapshot ID is provided create the - * backup from the snapshot. + * Attach a volume to a server. Attach an existing volume to an existing server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createBackupPayload Request a backup creation. (required) - * @return Backup + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param addVolumeToServerPayload Request a volume attachment creation. (optional) + * @return VolumeAttachment * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Create request for Backup accepted. -
202 Volume attachment request was 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 Backup createBackup( + public VolumeAttachment addVolumeToServer( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateBackupPayload createBackupPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload) throws ApiException { - ApiResponse localVarResp = createBackupWithHttpInfo(projectId, createBackupPayload); + ApiResponse localVarResp = + addVolumeToServerWithHttpInfo( + projectId, region, serverId, volumeId, addVolumeToServerPayload); return localVarResp.getData(); } /** - * Create new Backup. Create a new Backup in a project. If a snapshot ID is provided create the - * backup from the snapshot. + * Attach a volume to a server. Attach an existing volume to an existing server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createBackupPayload Request a backup creation. (required) - * @return ApiResponse<Backup> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param addVolumeToServerPayload Request a volume attachment creation. (optional) + * @return ApiResponse<VolumeAttachment> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Create request for Backup accepted. -
202 Volume attachment request was 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 createBackupWithHttpInfo( + public ApiResponse addVolumeToServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateBackupPayload createBackupPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload) throws ApiException { okhttp3.Call localVarCall = - createBackupValidateBeforeCall(projectId, createBackupPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + addVolumeToServerValidateBeforeCall( + projectId, region, serverId, volumeId, addVolumeToServerPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new Backup. (asynchronously) Create a new Backup in a project. If a snapshot ID is - * provided create the backup from the snapshot. + * Attach a volume to a server. (asynchronously) Attach an existing volume to an existing + * server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createBackupPayload Request a backup creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param addVolumeToServerPayload Request a volume attachment creation. (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 @@ -1882,32 +2134,38 @@ public ApiResponse createBackupWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Create request for Backup accepted. -
202 Volume attachment request was 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 createBackupAsync( + public okhttp3.Call addVolumeToServerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateBackupPayload createBackupPayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createBackupValidateBeforeCall(projectId, createBackupPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + addVolumeToServerValidateBeforeCall( + projectId, region, serverId, volumeId, addVolumeToServerPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createImage + * Build call for createAffinityGroup * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createImagePayload Request an image creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createAffinityGroupPayload Request a affinity group creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1915,18 +2173,18 @@ public okhttp3.Call createBackupAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
201 Create request for an Image has been accepted. -
201 Affinity group was created successfully. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createImageCall( + public okhttp3.Call createAffinityGroupCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateImagePayload createImagePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1942,14 +2200,17 @@ public okhttp3.Call createImageCall( basePath = null; } - Object localVarPostBody = createImagePayload; + Object localVarPostBody = createAffinityGroupPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images" + "/v2/projects/{projectId}/regions/{region}/affinity-groups" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1986,95 +2247,106 @@ public okhttp3.Call createImageCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createImageValidateBeforeCall( + private okhttp3.Call createAffinityGroupValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateImagePayload createImagePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload, 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 createImage(Async)"); + "Missing the required parameter 'projectId' when calling createAffinityGroup(Async)"); } - // verify the required parameter 'createImagePayload' is set - if (createImagePayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'createImagePayload' when calling createImage(Async)"); + "Missing the required parameter 'region' when calling createAffinityGroup(Async)"); + } + + // verify the required parameter 'createAffinityGroupPayload' is set + if (createAffinityGroupPayload == null) { + throw new ApiException( + "Missing the required parameter 'createAffinityGroupPayload' when calling createAffinityGroup(Async)"); } - return createImageCall(projectId, createImagePayload, _callback); + return createAffinityGroupCall(projectId, region, createAffinityGroupPayload, _callback); } /** - * Create new Image. Create a new Image in a project. This call, if successful, returns a - * pre-signed URL for the customer to upload the image. + * Create a new affinity group in a project. Create a new server affinity group in the given + * project ID. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createImagePayload Request an image creation. (required) - * @return ImageCreateResponse + * @param region The STACKIT Region of the resources. (required) + * @param createAffinityGroupPayload Request a affinity group creation. (required) + * @return AffinityGroup * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
201 Create request for an Image has been accepted. -
201 Affinity group was created successfully. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ImageCreateResponse createImage( + public AffinityGroup createAffinityGroup( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateImagePayload createImagePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload) throws ApiException { - ApiResponse localVarResp = - createImageWithHttpInfo(projectId, createImagePayload); + ApiResponse localVarResp = + createAffinityGroupWithHttpInfo(projectId, region, createAffinityGroupPayload); return localVarResp.getData(); } /** - * Create new Image. Create a new Image in a project. This call, if successful, returns a - * pre-signed URL for the customer to upload the image. + * Create a new affinity group in a project. Create a new server affinity group in the given + * project ID. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createImagePayload Request an image creation. (required) - * @return ApiResponse<ImageCreateResponse> + * @param region The STACKIT Region of the resources. (required) + * @param createAffinityGroupPayload Request a affinity group creation. (required) + * @return ApiResponse<AffinityGroup> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
201 Create request for an Image has been accepted. -
201 Affinity group was created successfully. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ApiResponse createImageWithHttpInfo( + public ApiResponse createAffinityGroupWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateImagePayload createImagePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload) throws ApiException { okhttp3.Call localVarCall = - createImageValidateBeforeCall(projectId, createImagePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + createAffinityGroupValidateBeforeCall( + projectId, region, createAffinityGroupPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new Image. (asynchronously) Create a new Image in a project. This call, if successful, - * returns a pre-signed URL for the customer to upload the image. + * Create a new affinity group in a project. (asynchronously) Create a new server affinity group + * in the given project ID. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createImagePayload Request an image creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createAffinityGroupPayload Request a affinity group creation. (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 @@ -2083,32 +2355,35 @@ public ApiResponse createImageWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
201 Create request for an Image has been accepted. -
201 Affinity group was created successfully. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createImageAsync( + public okhttp3.Call createAffinityGroupAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateImagePayload createImagePayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createImageValidateBeforeCall(projectId, createImagePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createAffinityGroupValidateBeforeCall( + projectId, region, createAffinityGroupPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createKeyPair + * Build call for createBackup * - * @param createKeyPairPayload Request a public key import. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createBackupPayload Request a backup creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2116,17 +2391,18 @@ public okhttp3.Call createImageAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
201 Import of the public key was successful. -
201 Create request for Backup 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 createKeyPairCall( - @javax.annotation.Nonnull CreateKeyPairPayload createKeyPairPayload, + public okhttp3.Call createBackupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateBackupPayload createBackupPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -2142,10 +2418,17 @@ public okhttp3.Call createKeyPairCall( basePath = null; } - Object localVarPostBody = createKeyPairPayload; + Object localVarPostBody = createBackupPayload; // create path and map variables - String localVarPath = "/v1/keypairs"; + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/backups" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2182,91 +2465,105 @@ public okhttp3.Call createKeyPairCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createKeyPairValidateBeforeCall( - @javax.annotation.Nonnull CreateKeyPairPayload createKeyPairPayload, + private okhttp3.Call createBackupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateBackupPayload createBackupPayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createKeyPairPayload' is set - if (createKeyPairPayload == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'createKeyPairPayload' when calling createKeyPair(Async)"); + "Missing the required parameter 'projectId' when calling createBackup(Async)"); } - return createKeyPairCall(createKeyPairPayload, _callback); + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling createBackup(Async)"); + } + + // verify the required parameter 'createBackupPayload' is set + if (createBackupPayload == null) { + throw new ApiException( + "Missing the required parameter 'createBackupPayload' when calling createBackup(Async)"); + } + + return createBackupCall(projectId, region, createBackupPayload, _callback); } /** - * Import a public key. Import a new public key for the requesting user based on provided public - * key material. The creation will fail if an SSH keypair with the same name already exists. If - * a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is - * also not present it will be the the MD5 fingerprint of the key. For autogenerated names - * invalid characters will be removed. Supported keypair types are ecdsa, ed25519 and rsa. + * Create new Backup. Create a new Backup in a project. If a snapshot ID is provided create the + * backup from the snapshot. * - * @param createKeyPairPayload Request a public key import. (required) - * @return Keypair + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createBackupPayload Request a backup creation. (required) + * @return Backup * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
201 Import of the public key was successful. -
201 Create request for Backup 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 Keypair createKeyPair( - @javax.annotation.Nonnull CreateKeyPairPayload createKeyPairPayload) + public Backup createBackup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateBackupPayload createBackupPayload) throws ApiException { - ApiResponse localVarResp = createKeyPairWithHttpInfo(createKeyPairPayload); + ApiResponse localVarResp = + createBackupWithHttpInfo(projectId, region, createBackupPayload); return localVarResp.getData(); } /** - * Import a public key. Import a new public key for the requesting user based on provided public - * key material. The creation will fail if an SSH keypair with the same name already exists. If - * a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is - * also not present it will be the the MD5 fingerprint of the key. For autogenerated names - * invalid characters will be removed. Supported keypair types are ecdsa, ed25519 and rsa. + * Create new Backup. Create a new Backup in a project. If a snapshot ID is provided create the + * backup from the snapshot. * - * @param createKeyPairPayload Request a public key import. (required) - * @return ApiResponse<Keypair> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createBackupPayload Request a backup creation. (required) + * @return ApiResponse<Backup> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
201 Import of the public key was successful. -
201 Create request for Backup 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 createKeyPairWithHttpInfo( - @javax.annotation.Nonnull CreateKeyPairPayload createKeyPairPayload) + public ApiResponse createBackupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateBackupPayload createBackupPayload) throws ApiException { - okhttp3.Call localVarCall = createKeyPairValidateBeforeCall(createKeyPairPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + createBackupValidateBeforeCall(projectId, region, createBackupPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Import a public key. (asynchronously) Import a new public key for the requesting user based - * on provided public key material. The creation will fail if an SSH keypair with the same name - * already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment - * section. If that is also not present it will be the the MD5 fingerprint of the key. For - * autogenerated names invalid characters will be removed. Supported keypair types are ecdsa, - * ed25519 and rsa. + * Create new Backup. (asynchronously) Create a new Backup in a project. If a snapshot ID is + * provided create the backup from the snapshot. * - * @param createKeyPairPayload Request a public key import. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createBackupPayload Request a backup creation. (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 @@ -2275,32 +2572,34 @@ public ApiResponse createKeyPairWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
201 Import of the public key was successful. -
201 Create request for Backup 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 createKeyPairAsync( - @javax.annotation.Nonnull CreateKeyPairPayload createKeyPairPayload, - final ApiCallback _callback) + public okhttp3.Call createBackupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateBackupPayload createBackupPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createKeyPairValidateBeforeCall(createKeyPairPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createBackupValidateBeforeCall(projectId, region, createBackupPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createNetwork + * Build call for createImage * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createNetworkPayload Request a network creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createImagePayload Request an image creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2308,18 +2607,19 @@ public okhttp3.Call createKeyPairAsync( * * * - * + * * * * * - * + * * *
Response Details
Status Code Description Response Headers
202 Network create has been accepted. -
201 Create request for an Image 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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createNetworkCall( + public okhttp3.Call createImageCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateImagePayload createImagePayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -2335,14 +2635,17 @@ public okhttp3.Call createNetworkCall( basePath = null; } - Object localVarPostBody = createNetworkPayload; + Object localVarPostBody = createImagePayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/networks" + "/v2/projects/{projectId}/regions/{region}/images" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2379,101 +2682,107 @@ public okhttp3.Call createNetworkCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createNetworkValidateBeforeCall( + private okhttp3.Call createImageValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateImagePayload createImagePayload, 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 createNetwork(Async)"); + "Missing the required parameter 'projectId' when calling createImage(Async)"); } - // verify the required parameter 'createNetworkPayload' is set - if (createNetworkPayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'createNetworkPayload' when calling createNetwork(Async)"); + "Missing the required parameter 'region' when calling createImage(Async)"); } - return createNetworkCall(projectId, createNetworkPayload, _callback); - } + // verify the required parameter 'createImagePayload' is set + if (createImagePayload == null) { + throw new ApiException( + "Missing the required parameter 'createImagePayload' when calling createImage(Async)"); + } + + return createImageCall(projectId, region, createImagePayload, _callback); + } /** - * Create new network. Create a new network in a project. `nameservers` will be filled - * from `defaultNameservers` of the respective area if not specified. If the project - * has `internetAccess` enabled and this is the first network in the project this - * might incur cost. + * Create new Image. Create a new Image in a project. This call, if successful, returns a + * pre-signed URL for the customer to upload the image. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createNetworkPayload Request a network creation. (required) - * @return Network + * @param region The STACKIT Region of the resources. (required) + * @param createImagePayload Request an image creation. (required) + * @return ImageCreateResponse * @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 Network create has been accepted. -
201 Create request for an Image 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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public Network createNetwork( + public ImageCreateResponse createImage( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateImagePayload createImagePayload) throws ApiException { - ApiResponse localVarResp = - createNetworkWithHttpInfo(projectId, createNetworkPayload); + ApiResponse localVarResp = + createImageWithHttpInfo(projectId, region, createImagePayload); return localVarResp.getData(); } /** - * Create new network. Create a new network in a project. `nameservers` will be filled - * from `defaultNameservers` of the respective area if not specified. If the project - * has `internetAccess` enabled and this is the first network in the project this - * might incur cost. + * Create new Image. Create a new Image in a project. This call, if successful, returns a + * pre-signed URL for the customer to upload the image. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createNetworkPayload Request a network creation. (required) - * @return ApiResponse<Network> + * @param region The STACKIT Region of the resources. (required) + * @param createImagePayload Request an image creation. (required) + * @return ApiResponse<ImageCreateResponse> * @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 Network create has been accepted. -
201 Create request for an Image 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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ApiResponse createNetworkWithHttpInfo( + public ApiResponse createImageWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateImagePayload createImagePayload) throws ApiException { okhttp3.Call localVarCall = - createNetworkValidateBeforeCall(projectId, createNetworkPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + createImageValidateBeforeCall(projectId, region, createImagePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new network. (asynchronously) Create a new network in a project. - * `nameservers` will be filled from `defaultNameservers` of the respective - * area if not specified. If the project has `internetAccess` enabled and this is the - * first network in the project this might incur cost. + * Create new Image. (asynchronously) Create a new Image in a project. This call, if successful, + * returns a pre-signed URL for the customer to upload the image. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createNetworkPayload Request a network creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createImagePayload Request an image creation. (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 @@ -2482,33 +2791,35 @@ public ApiResponse createNetworkWithHttpInfo( * * * - * + * * * * * - * + * * *
Response Details
Status Code Description Response Headers
202 Network create has been accepted. -
201 Create request for an Image 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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createNetworkAsync( + public okhttp3.Call createImageAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateImagePayload createImagePayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createNetworkValidateBeforeCall(projectId, createNetworkPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createImageValidateBeforeCall(projectId, region, createImagePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createNetworkArea + * Build call for createIsolatedNetwork * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param createNetworkAreaPayload Request an area creation. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createIsolatedNetworkPayload Request a single isolated network creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2516,17 +2827,19 @@ public okhttp3.Call createNetworkAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Area has been successfully created. -
202 Isolated Network create 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 createNetworkAreaCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull CreateNetworkAreaPayload createNetworkAreaPayload, + public okhttp3.Call createIsolatedNetworkCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateIsolatedNetworkPayload createIsolatedNetworkPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -2542,14 +2855,17 @@ public okhttp3.Call createNetworkAreaCall( basePath = null; } - Object localVarPostBody = createNetworkAreaPayload; + Object localVarPostBody = createIsolatedNetworkPayload; // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas" + "/v2/projects/{projectId}/regions/{region}/isolated-network" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())); + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2586,91 +2902,112 @@ public okhttp3.Call createNetworkAreaCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createNetworkAreaValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull CreateNetworkAreaPayload createNetworkAreaPayload, + private okhttp3.Call createIsolatedNetworkValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateIsolatedNetworkPayload createIsolatedNetworkPayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling createNetworkArea(Async)"); + "Missing the required parameter 'projectId' when calling createIsolatedNetwork(Async)"); } - // verify the required parameter 'createNetworkAreaPayload' is set - if (createNetworkAreaPayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'createNetworkAreaPayload' when calling createNetworkArea(Async)"); + "Missing the required parameter 'region' when calling createIsolatedNetwork(Async)"); } - return createNetworkAreaCall(organizationId, createNetworkAreaPayload, _callback); + // verify the required parameter 'createIsolatedNetworkPayload' is set + if (createIsolatedNetworkPayload == null) { + throw new ApiException( + "Missing the required parameter 'createIsolatedNetworkPayload' when calling createIsolatedNetwork(Async)"); + } + + return createIsolatedNetworkCall( + projectId, region, createIsolatedNetworkPayload, _callback); } /** - * Create new network area in an organization. Create a new network area in an organization. + * Create a single isolated network. Creates an isolated network which is not connected to other + * networks in this project. We recommend using this endpoint only if you are fully aware of its + * purpose and the consequences of its execution. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param createNetworkAreaPayload Request an area creation. (required) - * @return NetworkArea + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createIsolatedNetworkPayload Request a single isolated network creation. (required) + * @return Network * @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 Area has been successfully created. -
202 Isolated Network create 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 NetworkArea createNetworkArea( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull CreateNetworkAreaPayload createNetworkAreaPayload) + public Network createIsolatedNetwork( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateIsolatedNetworkPayload createIsolatedNetworkPayload) throws ApiException { - ApiResponse localVarResp = - createNetworkAreaWithHttpInfo(organizationId, createNetworkAreaPayload); + ApiResponse localVarResp = + createIsolatedNetworkWithHttpInfo(projectId, region, createIsolatedNetworkPayload); return localVarResp.getData(); } /** - * Create new network area in an organization. Create a new network area in an organization. + * Create a single isolated network. Creates an isolated network which is not connected to other + * networks in this project. We recommend using this endpoint only if you are fully aware of its + * purpose and the consequences of its execution. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param createNetworkAreaPayload Request an area creation. (required) - * @return ApiResponse<NetworkArea> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createIsolatedNetworkPayload Request a single isolated network creation. (required) + * @return ApiResponse<Network> * @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 Area has been successfully created. -
202 Isolated Network create 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 createNetworkAreaWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull CreateNetworkAreaPayload createNetworkAreaPayload) + public ApiResponse createIsolatedNetworkWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateIsolatedNetworkPayload createIsolatedNetworkPayload) throws ApiException { okhttp3.Call localVarCall = - createNetworkAreaValidateBeforeCall(organizationId, createNetworkAreaPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + createIsolatedNetworkValidateBeforeCall( + projectId, region, createIsolatedNetworkPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new network area in an organization. (asynchronously) Create a new network area in an - * organization. + * Create a single isolated network. (asynchronously) Creates an isolated network which is not + * connected to other networks in this project. We recommend using this endpoint only if you are + * fully aware of its purpose and the consequences of its execution. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param createNetworkAreaPayload Request an area creation. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createIsolatedNetworkPayload Request a single isolated network creation. (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 @@ -2679,35 +3016,34 @@ public ApiResponse createNetworkAreaWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Area has been successfully created. -
202 Isolated Network create 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 createNetworkAreaAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull CreateNetworkAreaPayload createNetworkAreaPayload, - final ApiCallback _callback) + public okhttp3.Call createIsolatedNetworkAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateIsolatedNetworkPayload createIsolatedNetworkPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createNetworkAreaValidateBeforeCall( - organizationId, createNetworkAreaPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createIsolatedNetworkValidateBeforeCall( + projectId, region, createIsolatedNetworkPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createNetworkAreaRange + * Build call for createKeyPair * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param createNetworkAreaRangePayload Request an addition of network ranges to an area. - * (required) + * @param createKeyPairPayload Request a public key import. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2715,7 +3051,7 @@ public okhttp3.Call createNetworkAreaAsync( * * * - * + * * * * @@ -2724,10 +3060,8 @@ public okhttp3.Call createNetworkAreaAsync( * *
Response Details
Status Code Description Response Headers
200 Adding network ranges was successful. -
201 Import of the public key was successful. -
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 createNetworkAreaRangeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull CreateNetworkAreaRangePayload createNetworkAreaRangePayload, + public okhttp3.Call createKeyPairCall( + @javax.annotation.Nonnull CreateKeyPairPayload createKeyPairPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -2743,17 +3077,10 @@ public okhttp3.Call createNetworkAreaRangeCall( basePath = null; } - Object localVarPostBody = createNetworkAreaRangePayload; + Object localVarPostBody = createKeyPairPayload; // create path and map variables - String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())); + String localVarPath = "/v2/keypairs"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2790,50 +3117,35 @@ public okhttp3.Call createNetworkAreaRangeCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createNetworkAreaRangeValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull CreateNetworkAreaRangePayload createNetworkAreaRangePayload, + private okhttp3.Call createKeyPairValidateBeforeCall( + @javax.annotation.Nonnull CreateKeyPairPayload createKeyPairPayload, 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 createNetworkAreaRange(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling createNetworkAreaRange(Async)"); - } - - // verify the required parameter 'createNetworkAreaRangePayload' is set - if (createNetworkAreaRangePayload == null) { + // verify the required parameter 'createKeyPairPayload' is set + if (createKeyPairPayload == null) { throw new ApiException( - "Missing the required parameter 'createNetworkAreaRangePayload' when calling createNetworkAreaRange(Async)"); + "Missing the required parameter 'createKeyPairPayload' when calling createKeyPair(Async)"); } - return createNetworkAreaRangeCall( - organizationId, areaId, createNetworkAreaRangePayload, _callback); + return createKeyPairCall(createKeyPairPayload, _callback); } /** - * Create new network range in a network area. Create a new network range in an existing network - * area. + * Import a public key. Import a new public key for the requesting user based on provided public + * key material. The creation will fail if an SSH keypair with the same name already exists. If + * a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is + * also not present it will be the the MD5 fingerprint of the key. For autogenerated names + * invalid characters will be removed. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param createNetworkAreaRangePayload Request an addition of network ranges to an area. - * (required) - * @return NetworkRangeListResponse + * @param createKeyPairPayload Request a public key import. (required) + * @return Keypair * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -2842,33 +3154,29 @@ private okhttp3.Call createNetworkAreaRangeValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Adding network ranges was successful. -
201 Import of the public key was successful. -
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 NetworkRangeListResponse createNetworkAreaRange( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull CreateNetworkAreaRangePayload createNetworkAreaRangePayload) + public Keypair createKeyPair( + @javax.annotation.Nonnull CreateKeyPairPayload createKeyPairPayload) throws ApiException { - ApiResponse localVarResp = - createNetworkAreaRangeWithHttpInfo( - organizationId, areaId, createNetworkAreaRangePayload); + ApiResponse localVarResp = createKeyPairWithHttpInfo(createKeyPairPayload); return localVarResp.getData(); } /** - * Create new network range in a network area. Create a new network range in an existing network - * area. + * Import a public key. Import a new public key for the requesting user based on provided public + * key material. The creation will fail if an SSH keypair with the same name already exists. If + * a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is + * also not present it will be the the MD5 fingerprint of the key. For autogenerated names + * invalid characters will be removed. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param createNetworkAreaRangePayload Request an addition of network ranges to an area. - * (required) - * @return ApiResponse<NetworkRangeListResponse> + * @param createKeyPairPayload Request a public key import. (required) + * @return ApiResponse<Keypair> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -2877,26 +3185,22 @@ public NetworkRangeListResponse createNetworkAreaRange( * *
Response Details
Status Code Description Response Headers
200 Adding network ranges was successful. -
201 Import of the public key was successful. -
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 createNetworkAreaRangeWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull CreateNetworkAreaRangePayload createNetworkAreaRangePayload) + public ApiResponse createKeyPairWithHttpInfo( + @javax.annotation.Nonnull CreateKeyPairPayload createKeyPairPayload) throws ApiException { - okhttp3.Call localVarCall = - createNetworkAreaRangeValidateBeforeCall( - organizationId, areaId, createNetworkAreaRangePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = createKeyPairValidateBeforeCall(createKeyPairPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new network range in a network area. (asynchronously) Create a new network range in an - * existing network area. + * Import a public key. (asynchronously) Import a new public key for the requesting user based + * on provided public key material. The creation will fail if an SSH keypair with the same name + * already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment + * section. If that is also not present it will be the the MD5 fingerprint of the key. For + * autogenerated names invalid characters will be removed. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param createNetworkAreaRangePayload Request an addition of network ranges to an area. - * (required) + * @param createKeyPairPayload Request a public key import. (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 @@ -2905,7 +3209,7 @@ public ApiResponse createNetworkAreaRangeWithHttpInfo( * * * - * + * * * * @@ -2914,27 +3218,24 @@ public ApiResponse createNetworkAreaRangeWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Adding network ranges was successful. -
201 Import of the public key was successful. -
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 createNetworkAreaRangeAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull CreateNetworkAreaRangePayload createNetworkAreaRangePayload, - final ApiCallback _callback) + public okhttp3.Call createKeyPairAsync( + @javax.annotation.Nonnull CreateKeyPairPayload createKeyPairPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createNetworkAreaRangeValidateBeforeCall( - organizationId, areaId, createNetworkAreaRangePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + createKeyPairValidateBeforeCall(createKeyPairPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createNetworkAreaRoute + * Build call for createNetwork * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param createNetworkAreaRoutePayload Request an addition of routes to an area. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createNetworkPayload Request a network creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2942,7 +3243,7 @@ public okhttp3.Call createNetworkAreaRangeAsync( * * * - * + * * * * @@ -2951,10 +3252,10 @@ public okhttp3.Call createNetworkAreaRangeAsync( * *
Response Details
Status Code Description Response Headers
202 Create request for network routes has been accepted. -
202 Network create has been accepted. -
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 createNetworkAreaRouteCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload, + public okhttp3.Call createNetworkCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -2970,17 +3271,17 @@ public okhttp3.Call createNetworkAreaRouteCall( basePath = null; } - Object localVarPostBody = createNetworkAreaRoutePayload; + Object localVarPostBody = createNetworkPayload; // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}/routes" + "/v2/projects/{projectId}/regions/{region}/networks" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3017,48 +3318,50 @@ public okhttp3.Call createNetworkAreaRouteCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createNetworkAreaRouteValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload, + private okhttp3.Call createNetworkValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling createNetworkAreaRoute(Async)"); + "Missing the required parameter 'projectId' when calling createNetwork(Async)"); } - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling createNetworkAreaRoute(Async)"); + "Missing the required parameter 'region' when calling createNetwork(Async)"); } - // verify the required parameter 'createNetworkAreaRoutePayload' is set - if (createNetworkAreaRoutePayload == null) { + // verify the required parameter 'createNetworkPayload' is set + if (createNetworkPayload == null) { throw new ApiException( - "Missing the required parameter 'createNetworkAreaRoutePayload' when calling createNetworkAreaRoute(Async)"); + "Missing the required parameter 'createNetworkPayload' when calling createNetwork(Async)"); } - return createNetworkAreaRouteCall( - organizationId, areaId, createNetworkAreaRoutePayload, _callback); + return createNetworkCall(projectId, region, createNetworkPayload, _callback); } /** - * Create new network routes. Create one or several new network routes in a network area. + * Create new network. Create a new network in a project. `nameservers` will be filled + * from `defaultNameservers` of the respective area if not specified. If the project + * has `internetAccess` enabled and this is the first network in the project this + * might incur cost. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param createNetworkAreaRoutePayload Request an addition of routes to an area. (required) - * @return RouteListResponse + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createNetworkPayload Request a network creation. (required) + * @return Network * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -3067,31 +3370,33 @@ private okhttp3.Call createNetworkAreaRouteValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
202 Create request for network routes has been accepted. -
202 Network create has been accepted. -
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 RouteListResponse createNetworkAreaRoute( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload) + public Network createNetwork( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload) throws ApiException { - ApiResponse localVarResp = - createNetworkAreaRouteWithHttpInfo( - organizationId, areaId, createNetworkAreaRoutePayload); + ApiResponse localVarResp = + createNetworkWithHttpInfo(projectId, region, createNetworkPayload); return localVarResp.getData(); } /** - * Create new network routes. Create one or several new network routes in a network area. + * Create new network. Create a new network in a project. `nameservers` will be filled + * from `defaultNameservers` of the respective area if not specified. If the project + * has `internetAccess` enabled and this is the first network in the project this + * might incur cost. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param createNetworkAreaRoutePayload Request an addition of routes to an area. (required) - * @return ApiResponse<RouteListResponse> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createNetworkPayload Request a network creation. (required) + * @return ApiResponse<Network> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -3100,25 +3405,26 @@ public RouteListResponse createNetworkAreaRoute( * *
Response Details
Status Code Description Response Headers
202 Create request for network routes has been accepted. -
202 Network create has been accepted. -
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 createNetworkAreaRouteWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload) + public ApiResponse createNetworkWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload) throws ApiException { okhttp3.Call localVarCall = - createNetworkAreaRouteValidateBeforeCall( - organizationId, areaId, createNetworkAreaRoutePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + createNetworkValidateBeforeCall(projectId, region, createNetworkPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new network routes. (asynchronously) Create one or several new network routes in a - * network area. + * Create new network. (asynchronously) Create a new network in a project. + * `nameservers` will be filled from `defaultNameservers` of the respective + * area if not specified. If the project has `internetAccess` enabled and this is the + * first network in the project this might incur cost. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param createNetworkAreaRoutePayload Request an addition of routes to an area. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createNetworkPayload Request a network creation. (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 @@ -3127,7 +3433,7 @@ public ApiResponse createNetworkAreaRouteWithHttpInfo( * * * - * + * * * * @@ -3136,27 +3442,25 @@ public ApiResponse createNetworkAreaRouteWithHttpInfo( * *
Response Details
Status Code Description Response Headers
202 Create request for network routes has been accepted. -
202 Network create has been accepted. -
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 createNetworkAreaRouteAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload, - final ApiCallback _callback) + public okhttp3.Call createNetworkAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createNetworkAreaRouteValidateBeforeCall( - organizationId, areaId, createNetworkAreaRoutePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createNetworkValidateBeforeCall(projectId, region, createNetworkPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createNic + * Build call for createNetworkArea * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param createNicPayload Request a network interface creation. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param createNetworkAreaPayload Request an Area creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3164,20 +3468,17 @@ public okhttp3.Call createNetworkAreaRouteAsync( * * * - * + * * * * * - * - * * *
Response Details
Status Code Description Response Headers
201 Network interface was created successfully. -
201 Area has been successfully created. -
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createNicCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull CreateNicPayload createNicPayload, + public okhttp3.Call createNetworkAreaCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull CreateNetworkAreaPayload createNetworkAreaPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -3193,17 +3494,14 @@ public okhttp3.Call createNicCall( basePath = null; } - Object localVarPostBody = createNicPayload; + Object localVarPostBody = createNetworkAreaPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/networks/{networkId}/nics" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "/v2/organizations/{organizationId}/network-areas" .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())); + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3240,106 +3538,99 @@ public okhttp3.Call createNicCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createNicValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull CreateNicPayload createNicPayload, + private okhttp3.Call createNetworkAreaValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull CreateNetworkAreaPayload createNetworkAreaPayload, 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 createNic(Async)"); - } - - // verify the required parameter 'networkId' is set - if (networkId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'networkId' when calling createNic(Async)"); + "Missing the required parameter 'organizationId' when calling createNetworkArea(Async)"); } - // verify the required parameter 'createNicPayload' is set - if (createNicPayload == null) { + // verify the required parameter 'createNetworkAreaPayload' is set + if (createNetworkAreaPayload == null) { throw new ApiException( - "Missing the required parameter 'createNicPayload' when calling createNic(Async)"); + "Missing the required parameter 'createNetworkAreaPayload' when calling createNetworkArea(Async)"); } - return createNicCall(projectId, networkId, createNicPayload, _callback); + return createNetworkAreaCall(organizationId, createNetworkAreaPayload, _callback); } /** - * Create new network interface. Create a new network interface in a project. + * Create new network area in an organization. Create a new network area in an organization. You + * can specify `\"preview/routingtables\"=\"true\"` as a + * label to enable the preview routing tables feature. This feature cannot be enabled or + * disabled afterwards. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param createNicPayload Request a network interface creation. (required) - * @return NIC + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param createNetworkAreaPayload Request an Area creation. (required) + * @return NetworkArea * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * - * - * * *
Response Details
Status Code Description Response Headers
201 Network interface was created successfully. -
201 Area has been successfully created. -
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public NIC createNic( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull CreateNicPayload createNicPayload) + public NetworkArea createNetworkArea( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull CreateNetworkAreaPayload createNetworkAreaPayload) throws ApiException { - ApiResponse localVarResp = - createNicWithHttpInfo(projectId, networkId, createNicPayload); + ApiResponse localVarResp = + createNetworkAreaWithHttpInfo(organizationId, createNetworkAreaPayload); return localVarResp.getData(); } /** - * Create new network interface. Create a new network interface in a project. + * Create new network area in an organization. Create a new network area in an organization. You + * can specify `\"preview/routingtables\"=\"true\"` as a + * label to enable the preview routing tables feature. This feature cannot be enabled or + * disabled afterwards. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param createNicPayload Request a network interface creation. (required) - * @return ApiResponse<NIC> + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param createNetworkAreaPayload Request an Area creation. (required) + * @return ApiResponse<NetworkArea> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * - * - * * *
Response Details
Status Code Description Response Headers
201 Network interface was created successfully. -
201 Area has been successfully created. -
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ApiResponse createNicWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull CreateNicPayload createNicPayload) + public ApiResponse createNetworkAreaWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull CreateNetworkAreaPayload createNetworkAreaPayload) throws ApiException { okhttp3.Call localVarCall = - createNicValidateBeforeCall(projectId, networkId, createNicPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + createNetworkAreaValidateBeforeCall(organizationId, createNetworkAreaPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new network interface. (asynchronously) Create a new network interface in a project. + * Create new network area in an organization. (asynchronously) Create a new network area in an + * organization. You can specify + * `\"preview/routingtables\"=\"true\"` as a label to enable + * the preview routing tables feature. This feature cannot be enabled or disabled afterwards. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param createNicPayload Request a network interface creation. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param createNetworkAreaPayload Request an Area creation. (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 @@ -3348,35 +3639,36 @@ public ApiResponse createNicWithHttpInfo( * * * - * + * * * * * - * - * * *
Response Details
Status Code Description Response Headers
201 Network interface was created successfully. -
201 Area has been successfully created. -
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createNicAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull CreateNicPayload createNicPayload, - final ApiCallback _callback) + public okhttp3.Call createNetworkAreaAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull CreateNetworkAreaPayload createNetworkAreaPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createNicValidateBeforeCall(projectId, networkId, createNicPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createNetworkAreaValidateBeforeCall( + organizationId, createNetworkAreaPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createPublicIP + * Build call for createNetworkAreaRange * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createPublicIPPayload Request a public IP creation. (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 createNetworkAreaRangePayload Request an addition of network ranges to an area. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3384,18 +3676,20 @@ public okhttp3.Call createNicAsync( * * * - * + * * * * * - * + * * *
Response Details
Status Code Description Response Headers
201 The public IP has been created. -
201 Adding network ranges 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. -
429 Too Many Requests. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createPublicIPCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload, + public okhttp3.Call createNetworkAreaRangeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRangePayload createNetworkAreaRangePayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -3411,16 +3705,22 @@ public okhttp3.Call createPublicIPCall( basePath = null; } - Object localVarPostBody = createPublicIPPayload; + Object localVarPostBody = createNetworkAreaRangePayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/public-ips" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); - - List localVarQueryParams = new ArrayList(); + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); + + List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); @@ -3455,92 +3755,125 @@ public okhttp3.Call createPublicIPCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createPublicIPValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload, + private okhttp3.Call createNetworkAreaRangeValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRangePayload createNetworkAreaRangePayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling createPublicIP(Async)"); + "Missing the required parameter 'organizationId' when calling createNetworkAreaRange(Async)"); } - // verify the required parameter 'createPublicIPPayload' is set - if (createPublicIPPayload == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'createPublicIPPayload' when calling createPublicIP(Async)"); + "Missing the required parameter 'areaId' when calling createNetworkAreaRange(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling createNetworkAreaRange(Async)"); + } + + // verify the required parameter 'createNetworkAreaRangePayload' is set + if (createNetworkAreaRangePayload == null) { + throw new ApiException( + "Missing the required parameter 'createNetworkAreaRangePayload' when calling createNetworkAreaRange(Async)"); } - return createPublicIPCall(projectId, createPublicIPPayload, _callback); + return createNetworkAreaRangeCall( + organizationId, areaId, region, createNetworkAreaRangePayload, _callback); } /** - * Create new public IP. Create a new public IP in a project. + * Create new network range in a network area. Create a new network range in an existing network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createPublicIPPayload Request a public IP creation. (required) - * @return PublicIp + * @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 createNetworkAreaRangePayload Request an addition of network ranges to an area. + * (required) + * @return NetworkRangeListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * - * + * * *
Response Details
Status Code Description Response Headers
201 The public IP has been created. -
201 Adding network ranges 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. -
429 Too Many Requests. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public PublicIp createPublicIP( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload) + public NetworkRangeListResponse createNetworkAreaRange( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRangePayload createNetworkAreaRangePayload) throws ApiException { - ApiResponse localVarResp = - createPublicIPWithHttpInfo(projectId, createPublicIPPayload); + ApiResponse localVarResp = + createNetworkAreaRangeWithHttpInfo( + organizationId, areaId, region, createNetworkAreaRangePayload); return localVarResp.getData(); } /** - * Create new public IP. Create a new public IP in a project. + * Create new network range in a network area. Create a new network range in an existing network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createPublicIPPayload Request a public IP creation. (required) - * @return ApiResponse<PublicIp> + * @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 createNetworkAreaRangePayload Request an addition of network ranges to an area. + * (required) + * @return ApiResponse<NetworkRangeListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * - * + * * *
Response Details
Status Code Description Response Headers
201 The public IP has been created. -
201 Adding network ranges 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. -
429 Too Many Requests. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ApiResponse createPublicIPWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload) + public ApiResponse createNetworkAreaRangeWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRangePayload createNetworkAreaRangePayload) throws ApiException { okhttp3.Call localVarCall = - createPublicIPValidateBeforeCall(projectId, createPublicIPPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + createNetworkAreaRangeValidateBeforeCall( + organizationId, areaId, region, createNetworkAreaRangePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new public IP. (asynchronously) Create a new public IP in a project. + * Create new network range in a network area. (asynchronously) Create a new network range in an + * existing network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createPublicIPPayload Request a public IP creation. (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 createNetworkAreaRangePayload Request an addition of network ranges to an area. + * (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 @@ -3549,33 +3882,39 @@ public ApiResponse createPublicIPWithHttpInfo( * * * - * + * * * * * - * + * * *
Response Details
Status Code Description Response Headers
201 The public IP has been created. -
201 Adding network ranges 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. -
429 Too Many Requests. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createPublicIPAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload, - final ApiCallback _callback) + public okhttp3.Call createNetworkAreaRangeAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRangePayload createNetworkAreaRangePayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createPublicIPValidateBeforeCall(projectId, createPublicIPPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createNetworkAreaRangeValidateBeforeCall( + organizationId, areaId, region, createNetworkAreaRangePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createSecurityGroup + * Build call for createNetworkAreaRegion * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createSecurityGroupPayload Request a security group creation. (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 createNetworkAreaRegionPayload Request to add a new regional network area + * configuration. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3583,17 +3922,20 @@ public okhttp3.Call createPublicIPAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Security group create has been accepted. -
202 Configure network area in a new region was 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 createSecurityGroupCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateSecurityGroupPayload createSecurityGroupPayload, + public okhttp3.Call createNetworkAreaRegionCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRegionPayload createNetworkAreaRegionPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -3609,14 +3951,20 @@ public okhttp3.Call createSecurityGroupCall( basePath = null; } - Object localVarPostBody = createSecurityGroupPayload; + Object localVarPostBody = createNetworkAreaRegionPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/security-groups" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3641,7 +3989,7 @@ public okhttp3.Call createSecurityGroupCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -3653,90 +4001,123 @@ public okhttp3.Call createSecurityGroupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createSecurityGroupValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateSecurityGroupPayload createSecurityGroupPayload, + private okhttp3.Call createNetworkAreaRegionValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRegionPayload createNetworkAreaRegionPayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling createSecurityGroup(Async)"); + "Missing the required parameter 'organizationId' when calling createNetworkAreaRegion(Async)"); } - // verify the required parameter 'createSecurityGroupPayload' is set - if (createSecurityGroupPayload == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'createSecurityGroupPayload' when calling createSecurityGroup(Async)"); + "Missing the required parameter 'areaId' when calling createNetworkAreaRegion(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling createNetworkAreaRegion(Async)"); + } + + // verify the required parameter 'createNetworkAreaRegionPayload' is set + if (createNetworkAreaRegionPayload == null) { + throw new ApiException( + "Missing the required parameter 'createNetworkAreaRegionPayload' when calling createNetworkAreaRegion(Async)"); } - return createSecurityGroupCall(projectId, createSecurityGroupPayload, _callback); + return createNetworkAreaRegionCall( + organizationId, areaId, region, createNetworkAreaRegionPayload, _callback); } /** - * Create new security group. Create a new security group in a project. + * Configure a region for a network area. Configure a new region for a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createSecurityGroupPayload Request a security group creation. (required) - * @return SecurityGroup + * @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 createNetworkAreaRegionPayload Request to add a new regional network area + * configuration. (required) + * @return RegionalArea * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Security group create has been accepted. -
202 Configure network area in a new region was 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 SecurityGroup createSecurityGroup( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateSecurityGroupPayload createSecurityGroupPayload) + public RegionalArea createNetworkAreaRegion( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRegionPayload createNetworkAreaRegionPayload) throws ApiException { - ApiResponse localVarResp = - createSecurityGroupWithHttpInfo(projectId, createSecurityGroupPayload); + ApiResponse localVarResp = + createNetworkAreaRegionWithHttpInfo( + organizationId, areaId, region, createNetworkAreaRegionPayload); return localVarResp.getData(); } /** - * Create new security group. Create a new security group in a project. + * Configure a region for a network area. Configure a new region for a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createSecurityGroupPayload Request a security group creation. (required) - * @return ApiResponse<SecurityGroup> + * @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 createNetworkAreaRegionPayload Request to add a new regional network area + * configuration. (required) + * @return ApiResponse<RegionalArea> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Security group create has been accepted. -
202 Configure network area in a new region was 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 createSecurityGroupWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateSecurityGroupPayload createSecurityGroupPayload) + public ApiResponse createNetworkAreaRegionWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRegionPayload createNetworkAreaRegionPayload) throws ApiException { okhttp3.Call localVarCall = - createSecurityGroupValidateBeforeCall(projectId, createSecurityGroupPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + createNetworkAreaRegionValidateBeforeCall( + organizationId, areaId, region, createNetworkAreaRegionPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new security group. (asynchronously) Create a new security group in a project. + * Configure a region for a network area. (asynchronously) Configure a new region for a network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createSecurityGroupPayload Request a security group creation. (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 createNetworkAreaRegionPayload Request to add a new regional network area + * configuration. (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 @@ -3745,34 +4126,38 @@ public ApiResponse createSecurityGroupWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Security group create has been accepted. -
202 Configure network area in a new region was 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 createSecurityGroupAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateSecurityGroupPayload createSecurityGroupPayload, - final ApiCallback _callback) + public okhttp3.Call createNetworkAreaRegionAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRegionPayload createNetworkAreaRegionPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createSecurityGroupValidateBeforeCall( - projectId, createSecurityGroupPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createNetworkAreaRegionValidateBeforeCall( + organizationId, areaId, region, createNetworkAreaRegionPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createSecurityGroupRule + * Build call for createNetworkAreaRoute * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param createSecurityGroupRulePayload Request for a security group rule creation. (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 createNetworkAreaRoutePayload Request an addition of routes to an area. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3780,18 +4165,20 @@ public okhttp3.Call createSecurityGroupAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Security group rule create has been accepted. -
202 Create request for network routes 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 createSecurityGroupRuleCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull CreateSecurityGroupRulePayload createSecurityGroupRulePayload, + public okhttp3.Call createNetworkAreaRouteCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -3807,17 +4194,20 @@ public okhttp3.Call createSecurityGroupRuleCall( basePath = null; } - Object localVarPostBody = createSecurityGroupRulePayload; + Object localVarPostBody = createNetworkAreaRoutePayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "securityGroupId" + "}", - localVarApiClient.escapeString(securityGroupId.toString())); + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -3854,106 +4244,120 @@ public okhttp3.Call createSecurityGroupRuleCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createSecurityGroupRuleValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull CreateSecurityGroupRulePayload createSecurityGroupRulePayload, + private okhttp3.Call createNetworkAreaRouteValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling createSecurityGroupRule(Async)"); + "Missing the required parameter 'organizationId' when calling createNetworkAreaRoute(Async)"); } - // verify the required parameter 'securityGroupId' is set - if (securityGroupId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'securityGroupId' when calling createSecurityGroupRule(Async)"); + "Missing the required parameter 'areaId' when calling createNetworkAreaRoute(Async)"); } - // verify the required parameter 'createSecurityGroupRulePayload' is set - if (createSecurityGroupRulePayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'createSecurityGroupRulePayload' when calling createSecurityGroupRule(Async)"); + "Missing the required parameter 'region' when calling createNetworkAreaRoute(Async)"); } - return createSecurityGroupRuleCall( - projectId, securityGroupId, createSecurityGroupRulePayload, _callback); - } + // verify the required parameter 'createNetworkAreaRoutePayload' is set + if (createNetworkAreaRoutePayload == null) { + throw new ApiException( + "Missing the required parameter 'createNetworkAreaRoutePayload' when calling createNetworkAreaRoute(Async)"); + } + + return createNetworkAreaRouteCall( + organizationId, areaId, region, createNetworkAreaRoutePayload, _callback); + } /** - * Create new security group rule. Create a new security group rule in a project. + * Create new network routes. Create one or several new network routes in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param createSecurityGroupRulePayload Request for a security group rule creation. (required) - * @return SecurityGroupRule + * @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 createNetworkAreaRoutePayload Request an addition of routes to an area. (required) + * @return RouteListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Security group rule create has been accepted. -
202 Create request for network routes 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 SecurityGroupRule createSecurityGroupRule( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull CreateSecurityGroupRulePayload createSecurityGroupRulePayload) + public RouteListResponse createNetworkAreaRoute( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload) throws ApiException { - ApiResponse localVarResp = - createSecurityGroupRuleWithHttpInfo( - projectId, securityGroupId, createSecurityGroupRulePayload); + ApiResponse localVarResp = + createNetworkAreaRouteWithHttpInfo( + organizationId, areaId, region, createNetworkAreaRoutePayload); return localVarResp.getData(); } /** - * Create new security group rule. Create a new security group rule in a project. + * Create new network routes. Create one or several new network routes in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param createSecurityGroupRulePayload Request for a security group rule creation. (required) - * @return ApiResponse<SecurityGroupRule> + * @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 createNetworkAreaRoutePayload Request an addition of routes to an area. (required) + * @return ApiResponse<RouteListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Security group rule create has been accepted. -
202 Create request for network routes 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 createSecurityGroupRuleWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull CreateSecurityGroupRulePayload createSecurityGroupRulePayload) + public ApiResponse createNetworkAreaRouteWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload) throws ApiException { okhttp3.Call localVarCall = - createSecurityGroupRuleValidateBeforeCall( - projectId, securityGroupId, createSecurityGroupRulePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + createNetworkAreaRouteValidateBeforeCall( + organizationId, areaId, region, createNetworkAreaRoutePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new security group rule. (asynchronously) Create a new security group rule in a - * project. + * Create new network routes. (asynchronously) Create one or several new network routes in a + * network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param createSecurityGroupRulePayload Request for a security group rule creation. (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 createNetworkAreaRoutePayload Request an addition of routes to an area. (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 @@ -3962,34 +4366,38 @@ public ApiResponse createSecurityGroupRuleWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Security group rule create has been accepted. -
202 Create request for network routes 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 createSecurityGroupRuleAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull CreateSecurityGroupRulePayload createSecurityGroupRulePayload, - final ApiCallback _callback) + public okhttp3.Call createNetworkAreaRouteAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createSecurityGroupRuleValidateBeforeCall( - projectId, securityGroupId, createSecurityGroupRulePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createNetworkAreaRouteValidateBeforeCall( + organizationId, areaId, region, createNetworkAreaRoutePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createServer + * Build call for createNic * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createServerPayload Request a server creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param createNicPayload Request a network interface creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3997,17 +4405,21 @@ public okhttp3.Call createSecurityGroupRuleAsync( * * * - * + * * * * * + * + * * *
Response Details
Status Code Description Response Headers
201 Create request for server accepted. -
201 Network interface was created successfully. -
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createServerCall( + public okhttp3.Call createNicCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateServerPayload createServerPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull CreateNicPayload createNicPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -4023,14 +4435,20 @@ public okhttp3.Call createServerCall( basePath = null; } - Object localVarPostBody = createServerPayload; + Object localVarPostBody = createNicPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers" + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4067,89 +4485,118 @@ public okhttp3.Call createServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createServerValidateBeforeCall( + private okhttp3.Call createNicValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateServerPayload createServerPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull CreateNicPayload createNicPayload, 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 createServer(Async)"); + "Missing the required parameter 'projectId' when calling createNic(Async)"); } - // verify the required parameter 'createServerPayload' is set - if (createServerPayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'createServerPayload' when calling createServer(Async)"); + "Missing the required parameter 'region' when calling createNic(Async)"); + } + + // verify the required parameter 'networkId' is set + if (networkId == null) { + throw new ApiException( + "Missing the required parameter 'networkId' when calling createNic(Async)"); + } + + // verify the required parameter 'createNicPayload' is set + if (createNicPayload == null) { + throw new ApiException( + "Missing the required parameter 'createNicPayload' when calling createNic(Async)"); } - return createServerCall(projectId, createServerPayload, _callback); + return createNicCall(projectId, region, networkId, createNicPayload, _callback); } /** - * Create new server. Create a new server in a project. + * Create new network interface. Create a new network interface in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createServerPayload Request a server creation. (required) - * @return Server + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param createNicPayload Request a network interface creation. (required) + * @return NIC * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * + * * *
Response Details
Status Code Description Response Headers
201 Create request for server accepted. -
201 Network interface was created successfully. -
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public Server createServer( + public NIC createNic( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateServerPayload createServerPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull CreateNicPayload createNicPayload) throws ApiException { - ApiResponse localVarResp = createServerWithHttpInfo(projectId, createServerPayload); + ApiResponse localVarResp = + createNicWithHttpInfo(projectId, region, networkId, createNicPayload); return localVarResp.getData(); } /** - * Create new server. Create a new server in a project. + * Create new network interface. Create a new network interface in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createServerPayload Request a server creation. (required) - * @return ApiResponse<Server> + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param createNicPayload Request a network interface creation. (required) + * @return ApiResponse<NIC> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * + * * *
Response Details
Status Code Description Response Headers
201 Create request for server accepted. -
201 Network interface was created successfully. -
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ApiResponse createServerWithHttpInfo( + public ApiResponse createNicWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateServerPayload createServerPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull CreateNicPayload createNicPayload) throws ApiException { okhttp3.Call localVarCall = - createServerValidateBeforeCall(projectId, createServerPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + createNicValidateBeforeCall(projectId, region, networkId, createNicPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new server. (asynchronously) Create a new server in a project. + * Create new network interface. (asynchronously) Create a new network interface in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createServerPayload Request a server creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param createNicPayload Request a network interface creation. (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 @@ -4158,32 +4605,38 @@ public ApiResponse createServerWithHttpInfo( * * * - * + * * * * * + * + * * *
Response Details
Status Code Description Response Headers
201 Create request for server accepted. -
201 Network interface was created successfully. -
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createServerAsync( + public okhttp3.Call createNicAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateServerPayload createServerPayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull CreateNicPayload createNicPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createServerValidateBeforeCall(projectId, createServerPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createNicValidateBeforeCall( + projectId, region, networkId, createNicPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createSnapshot + * Build call for createPublicIP * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createSnapshotPayload Request a snapshot creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createPublicIPPayload Request a public IP creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4191,17 +4644,19 @@ public okhttp3.Call createServerAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Create request for Snapshot accepted. -
201 The public IP has been created. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createSnapshotCall( + public okhttp3.Call createPublicIPCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -4217,14 +4672,17 @@ public okhttp3.Call createSnapshotCall( basePath = null; } - Object localVarPostBody = createSnapshotPayload; + Object localVarPostBody = createPublicIPPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/snapshots" + "/v2/projects/{projectId}/regions/{region}/public-ips" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4261,90 +4719,104 @@ public okhttp3.Call createSnapshotCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createSnapshotValidateBeforeCall( + private okhttp3.Call createPublicIPValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload, 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 createSnapshot(Async)"); + "Missing the required parameter 'projectId' when calling createPublicIP(Async)"); } - // verify the required parameter 'createSnapshotPayload' is set - if (createSnapshotPayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'createSnapshotPayload' when calling createSnapshot(Async)"); + "Missing the required parameter 'region' when calling createPublicIP(Async)"); + } + + // verify the required parameter 'createPublicIPPayload' is set + if (createPublicIPPayload == null) { + throw new ApiException( + "Missing the required parameter 'createPublicIPPayload' when calling createPublicIP(Async)"); } - return createSnapshotCall(projectId, createSnapshotPayload, _callback); + return createPublicIPCall(projectId, region, createPublicIPPayload, _callback); } /** - * Create new Snapshot. Create a new Snapshot from a Volume in a project. + * Create new public IP. Create a new public IP in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createSnapshotPayload Request a snapshot creation. (required) - * @return Snapshot + * @param region The STACKIT Region of the resources. (required) + * @param createPublicIPPayload Request a public IP creation. (required) + * @return PublicIp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Create request for Snapshot accepted. -
201 The public IP has been created. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public Snapshot createSnapshot( + public PublicIp createPublicIP( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload) throws ApiException { - ApiResponse localVarResp = - createSnapshotWithHttpInfo(projectId, createSnapshotPayload); + ApiResponse localVarResp = + createPublicIPWithHttpInfo(projectId, region, createPublicIPPayload); return localVarResp.getData(); } /** - * Create new Snapshot. Create a new Snapshot from a Volume in a project. + * Create new public IP. Create a new public IP in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createSnapshotPayload Request a snapshot creation. (required) - * @return ApiResponse<Snapshot> + * @param region The STACKIT Region of the resources. (required) + * @param createPublicIPPayload Request a public IP creation. (required) + * @return ApiResponse<PublicIp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Create request for Snapshot accepted. -
201 The public IP has been created. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ApiResponse createSnapshotWithHttpInfo( + public ApiResponse createPublicIPWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload) throws ApiException { okhttp3.Call localVarCall = - createSnapshotValidateBeforeCall(projectId, createSnapshotPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + createPublicIPValidateBeforeCall(projectId, region, createPublicIPPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new Snapshot. (asynchronously) Create a new Snapshot from a Volume in a project. + * Create new public IP. (asynchronously) Create a new public IP in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createSnapshotPayload Request a snapshot creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createPublicIPPayload Request a public IP creation. (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 @@ -4353,32 +4825,36 @@ public ApiResponse createSnapshotWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
201 Create request for Snapshot accepted. -
201 The public IP has been created. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call createSnapshotAsync( + public okhttp3.Call createPublicIPAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createSnapshotValidateBeforeCall(projectId, createSnapshotPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createPublicIPValidateBeforeCall( + projectId, region, createPublicIPPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for createVolume + * Build call for createSecurityGroup * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createVolumePayload Request a volume creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createSecurityGroupPayload Request a security group creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4386,7 +4862,7 @@ public okhttp3.Call createSnapshotAsync( * * * - * + * * * * @@ -4394,9 +4870,10 @@ public okhttp3.Call createSnapshotAsync( * *
Response Details
Status Code Description Response Headers
201 Create request for volume accepted. -
201 Security group create has been accepted. -
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 createVolumeCall( + public okhttp3.Call createSecurityGroupCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateVolumePayload createVolumePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateSecurityGroupPayload createSecurityGroupPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -4412,14 +4889,17 @@ public okhttp3.Call createVolumeCall( basePath = null; } - Object localVarPostBody = createVolumePayload; + Object localVarPostBody = createSecurityGroupPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/volumes" + "/v2/projects/{projectId}/regions/{region}/security-groups" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4456,41 +4936,47 @@ public okhttp3.Call createVolumeCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createVolumeValidateBeforeCall( + private okhttp3.Call createSecurityGroupValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateVolumePayload createVolumePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateSecurityGroupPayload createSecurityGroupPayload, 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 createVolume(Async)"); + "Missing the required parameter 'projectId' when calling createSecurityGroup(Async)"); } - // verify the required parameter 'createVolumePayload' is set - if (createVolumePayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'createVolumePayload' when calling createVolume(Async)"); + "Missing the required parameter 'region' when calling createSecurityGroup(Async)"); + } + + // verify the required parameter 'createSecurityGroupPayload' is set + if (createSecurityGroupPayload == null) { + throw new ApiException( + "Missing the required parameter 'createSecurityGroupPayload' when calling createSecurityGroup(Async)"); } - return createVolumeCall(projectId, createVolumePayload, _callback); + return createSecurityGroupCall(projectId, region, createSecurityGroupPayload, _callback); } /** - * Create new volume. Create a new volume in a project. If a volume source is not provided, an - * empty volume will be created. The size property is required if no source or an image source - * is provided. + * Create new security group. Create a new security group in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createVolumePayload Request a volume creation. (required) - * @return Volume + * @param region The STACKIT Region of the resources. (required) + * @param createSecurityGroupPayload Request a security group creation. (required) + * @return SecurityGroup * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -4498,29 +4984,30 @@ private okhttp3.Call createVolumeValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
201 Create request for volume accepted. -
201 Security group create has been accepted. -
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 Volume createVolume( + public SecurityGroup createSecurityGroup( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateVolumePayload createVolumePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateSecurityGroupPayload createSecurityGroupPayload) throws ApiException { - ApiResponse localVarResp = createVolumeWithHttpInfo(projectId, createVolumePayload); + ApiResponse localVarResp = + createSecurityGroupWithHttpInfo(projectId, region, createSecurityGroupPayload); return localVarResp.getData(); } /** - * Create new volume. Create a new volume in a project. If a volume source is not provided, an - * empty volume will be created. The size property is required if no source or an image source - * is provided. + * Create new security group. Create a new security group in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createVolumePayload Request a volume creation. (required) - * @return ApiResponse<Volume> + * @param region The STACKIT Region of the resources. (required) + * @param createSecurityGroupPayload Request a security group creation. (required) + * @return ApiResponse<SecurityGroup> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -4528,23 +5015,24 @@ public Volume createVolume( * *
Response Details
Status Code Description Response Headers
201 Create request for volume accepted. -
201 Security group create has been accepted. -
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 createVolumeWithHttpInfo( + public ApiResponse createSecurityGroupWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateVolumePayload createVolumePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateSecurityGroupPayload createSecurityGroupPayload) throws ApiException { okhttp3.Call localVarCall = - createVolumeValidateBeforeCall(projectId, createVolumePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + createSecurityGroupValidateBeforeCall( + projectId, region, createSecurityGroupPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create new volume. (asynchronously) Create a new volume in a project. If a volume source is - * not provided, an empty volume will be created. The size property is required if no source or - * an image source is provided. + * Create new security group. (asynchronously) Create a new security group in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param createVolumePayload Request a volume creation. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createSecurityGroupPayload Request a security group creation. (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 @@ -4553,7 +5041,7 @@ public ApiResponse createVolumeWithHttpInfo( * * * - * + * * * * @@ -4561,24 +5049,28 @@ public ApiResponse createVolumeWithHttpInfo( * *
Response Details
Status Code Description Response Headers
201 Create request for volume accepted. -
201 Security group create has been accepted. -
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 createVolumeAsync( + public okhttp3.Call createSecurityGroupAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull CreateVolumePayload createVolumePayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateSecurityGroupPayload createSecurityGroupPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createVolumeValidateBeforeCall(projectId, createVolumePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + createSecurityGroupValidateBeforeCall( + projectId, region, createSecurityGroupPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deallocateServer + * Build call for createSecurityGroupRule * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param createSecurityGroupRulePayload Request for a security group rule creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4586,18 +5078,19 @@ public okhttp3.Call createVolumeAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server deallocation request accepted. -
201 Security group rule create 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 deallocateServerCall( + public okhttp3.Call createSecurityGroupRuleCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull CreateSecurityGroupRulePayload createSecurityGroupRulePayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -4613,17 +5106,20 @@ public okhttp3.Call deallocateServerCall( basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = createSecurityGroupRulePayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/deallocate" + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4637,7 +5133,7 @@ public okhttp3.Call deallocateServerCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -4660,88 +5156,118 @@ public okhttp3.Call deallocateServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deallocateServerValidateBeforeCall( + private okhttp3.Call createSecurityGroupRuleValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull CreateSecurityGroupRulePayload createSecurityGroupRulePayload, 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 deallocateServer(Async)"); + "Missing the required parameter 'projectId' when calling createSecurityGroupRule(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling deallocateServer(Async)"); + "Missing the required parameter 'region' when calling createSecurityGroupRule(Async)"); + } + + // verify the required parameter 'securityGroupId' is set + if (securityGroupId == null) { + throw new ApiException( + "Missing the required parameter 'securityGroupId' when calling createSecurityGroupRule(Async)"); + } + + // verify the required parameter 'createSecurityGroupRulePayload' is set + if (createSecurityGroupRulePayload == null) { + throw new ApiException( + "Missing the required parameter 'createSecurityGroupRulePayload' when calling createSecurityGroupRule(Async)"); } - return deallocateServerCall(projectId, serverId, _callback); + return createSecurityGroupRuleCall( + projectId, region, securityGroupId, createSecurityGroupRulePayload, _callback); } /** - * Deallocate an existing server. Deallocate an existing server. The server will be removed from - * the hypervisor so only the volume will be billed. + * Create new security group rule. Create a new security group rule in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param createSecurityGroupRulePayload Request for a security group rule creation. (required) + * @return SecurityGroupRule * @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 Server deallocation request accepted. -
201 Security group rule create 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 deallocateServer( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public SecurityGroupRule createSecurityGroupRule( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull CreateSecurityGroupRulePayload createSecurityGroupRulePayload) throws ApiException { - deallocateServerWithHttpInfo(projectId, serverId); + ApiResponse localVarResp = + createSecurityGroupRuleWithHttpInfo( + projectId, region, securityGroupId, createSecurityGroupRulePayload); + return localVarResp.getData(); } /** - * Deallocate an existing server. Deallocate an existing server. The server will be removed from - * the hypervisor so only the volume will be billed. + * Create new security group rule. Create a new security group rule in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @return ApiResponse<Void> + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param createSecurityGroupRulePayload Request for a security group rule creation. (required) + * @return ApiResponse<SecurityGroupRule> * @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 Server deallocation request accepted. -
201 Security group rule create 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 deallocateServerWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public ApiResponse createSecurityGroupRuleWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull CreateSecurityGroupRulePayload createSecurityGroupRulePayload) throws ApiException { - okhttp3.Call localVarCall = deallocateServerValidateBeforeCall(projectId, serverId, null); - return localVarApiClient.execute(localVarCall); + okhttp3.Call localVarCall = + createSecurityGroupRuleValidateBeforeCall( + projectId, region, securityGroupId, createSecurityGroupRulePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Deallocate an existing server. (asynchronously) Deallocate an existing server. The server - * will be removed from the hypervisor so only the volume will be billed. + * Create new security group rule. (asynchronously) Create a new security group rule in a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param createSecurityGroupRulePayload Request for a security group rule creation. (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 @@ -4750,32 +5276,40 @@ public ApiResponse deallocateServerWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server deallocation request accepted. -
201 Security group rule create 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 deallocateServerAsync( + public okhttp3.Call createSecurityGroupRuleAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull CreateSecurityGroupRulePayload createSecurityGroupRulePayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deallocateServerValidateBeforeCall(projectId, serverId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + createSecurityGroupRuleValidateBeforeCall( + projectId, + region, + securityGroupId, + createSecurityGroupRulePayload, + _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteAffinityGroup + * Build call for createServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createServerPayload Request a server creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4783,7 +5317,7 @@ public okhttp3.Call deallocateServerAsync( * * * - * + * * * * @@ -4791,9 +5325,10 @@ public okhttp3.Call deallocateServerAsync( * *
Response Details
Status Code Description Response Headers
204 Delete request for an server group was accepted. -
201 Create request for server accepted. -
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 deleteAffinityGroupCall( + public okhttp3.Call createServerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID affinityGroupId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateServerPayload createServerPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -4809,17 +5344,17 @@ public okhttp3.Call deleteAffinityGroupCall( basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = createServerPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/affinity-groups/{affinityGroupId}" + "/v2/projects/{projectId}/regions/{region}/servers" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "affinityGroupId" + "}", - localVarApiClient.escapeString(affinityGroupId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4833,7 +5368,7 @@ public okhttp3.Call deleteAffinityGroupCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -4844,7 +5379,7 @@ public okhttp3.Call deleteAffinityGroupCall( return localVarApiClient.buildCall( basePath, localVarPath, - "DELETE", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -4856,38 +5391,47 @@ public okhttp3.Call deleteAffinityGroupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteAffinityGroupValidateBeforeCall( + private okhttp3.Call createServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID affinityGroupId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateServerPayload createServerPayload, 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 deleteAffinityGroup(Async)"); + "Missing the required parameter 'projectId' when calling createServer(Async)"); } - // verify the required parameter 'affinityGroupId' is set - if (affinityGroupId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'affinityGroupId' when calling deleteAffinityGroup(Async)"); + "Missing the required parameter 'region' when calling createServer(Async)"); + } + + // verify the required parameter 'createServerPayload' is set + if (createServerPayload == null) { + throw new ApiException( + "Missing the required parameter 'createServerPayload' when calling createServer(Async)"); } - return deleteAffinityGroupCall(projectId, affinityGroupId, _callback); + return createServerCall(projectId, region, createServerPayload, _callback); } /** - * Delete a affinity group in a project. Delete a affinity group in the given project. + * Create new server. Create a new server in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createServerPayload Request a server creation. (required) + * @return Server * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -4895,26 +5439,30 @@ private okhttp3.Call deleteAffinityGroupValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
204 Delete request for an server group was accepted. -
201 Create request for server accepted. -
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 void deleteAffinityGroup( + public Server createServer( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID affinityGroupId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateServerPayload createServerPayload) throws ApiException { - deleteAffinityGroupWithHttpInfo(projectId, affinityGroupId); + ApiResponse localVarResp = + createServerWithHttpInfo(projectId, region, createServerPayload); + return localVarResp.getData(); } /** - * Delete a affinity group in a project. Delete a affinity group in the given project. + * Create new server. Create a new server in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) - * @return ApiResponse<Void> + * @param region The STACKIT Region of the resources. (required) + * @param createServerPayload Request a server creation. (required) + * @return ApiResponse<Server> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -4922,21 +5470,23 @@ public void deleteAffinityGroup( * *
Response Details
Status Code Description Response Headers
204 Delete request for an server group was accepted. -
201 Create request for server accepted. -
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 deleteAffinityGroupWithHttpInfo( + public ApiResponse createServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID affinityGroupId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateServerPayload createServerPayload) throws ApiException { okhttp3.Call localVarCall = - deleteAffinityGroupValidateBeforeCall(projectId, affinityGroupId, null); - return localVarApiClient.execute(localVarCall); + createServerValidateBeforeCall(projectId, region, createServerPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete a affinity group in a project. (asynchronously) Delete a affinity group in the given - * project. + * Create new server. (asynchronously) Create a new server in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createServerPayload Request a server creation. (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 @@ -4945,7 +5495,7 @@ public ApiResponse deleteAffinityGroupWithHttpInfo( * * * - * + * * * * @@ -4953,24 +5503,26 @@ public ApiResponse deleteAffinityGroupWithHttpInfo( * *
Response Details
Status Code Description Response Headers
204 Delete request for an server group was accepted. -
201 Create request for server accepted. -
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 deleteAffinityGroupAsync( + public okhttp3.Call createServerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID affinityGroupId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateServerPayload createServerPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteAffinityGroupValidateBeforeCall(projectId, affinityGroupId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + createServerValidateBeforeCall(projectId, region, createServerPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteBackup + * Build call for createSnapshot * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) - * @param force Force action. (optional, default to false) + * @param region The STACKIT Region of the resources. (required) + * @param createSnapshotPayload Request a snapshot creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4978,7 +5530,7 @@ public okhttp3.Call deleteAffinityGroupAsync( * * * - * + * * * * @@ -4986,10 +5538,10 @@ public okhttp3.Call deleteAffinityGroupAsync( * *
Response Details
Status Code Description Response Headers
204 Backup delete request has been accepted. -
201 Create request for Snapshot accepted. -
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 deleteBackupCall( + public okhttp3.Call createSnapshotCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - @javax.annotation.Nullable Boolean force, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -5005,17 +5557,17 @@ public okhttp3.Call deleteBackupCall( basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = createSnapshotPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/backups/{backupId}" + "/v2/projects/{projectId}/regions/{region}/snapshots" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "backupId" + "}", - localVarApiClient.escapeString(backupId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5023,17 +5575,13 @@ public okhttp3.Call deleteBackupCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (force != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); - } - final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -5044,7 +5592,7 @@ public okhttp3.Call deleteBackupCall( return localVarApiClient.buildCall( basePath, localVarPath, - "DELETE", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -5056,40 +5604,47 @@ public okhttp3.Call deleteBackupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteBackupValidateBeforeCall( + private okhttp3.Call createSnapshotValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - @javax.annotation.Nullable Boolean force, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload, 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 deleteBackup(Async)"); + "Missing the required parameter 'projectId' when calling createSnapshot(Async)"); } - // verify the required parameter 'backupId' is set - if (backupId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'backupId' when calling deleteBackup(Async)"); + "Missing the required parameter 'region' when calling createSnapshot(Async)"); + } + + // verify the required parameter 'createSnapshotPayload' is set + if (createSnapshotPayload == null) { + throw new ApiException( + "Missing the required parameter 'createSnapshotPayload' when calling createSnapshot(Async)"); } - return deleteBackupCall(projectId, backupId, force, _callback); + return createSnapshotCall(projectId, region, createSnapshotPayload, _callback); } /** - * Delete a backup. Delete a backup that is part of the project. + * Create new Snapshot. Create a new Snapshot from a Volume in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) - * @param force Force action. (optional, default to false) + * @param region The STACKIT Region of the resources. (required) + * @param createSnapshotPayload Request a snapshot creation. (required) + * @return Snapshot * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -5097,28 +5652,30 @@ private okhttp3.Call deleteBackupValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
204 Backup delete request has been accepted. -
201 Create request for Snapshot accepted. -
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 void deleteBackup( + public Snapshot createSnapshot( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - @javax.annotation.Nullable Boolean force) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload) throws ApiException { - deleteBackupWithHttpInfo(projectId, backupId, force); + ApiResponse localVarResp = + createSnapshotWithHttpInfo(projectId, region, createSnapshotPayload); + return localVarResp.getData(); } /** - * Delete a backup. Delete a backup that is part of the project. + * Create new Snapshot. Create a new Snapshot from a Volume in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) - * @param force Force action. (optional, default to false) - * @return ApiResponse<Void> + * @param region The STACKIT Region of the resources. (required) + * @param createSnapshotPayload Request a snapshot creation. (required) + * @return ApiResponse<Snapshot> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -5126,22 +5683,23 @@ public void deleteBackup( * *
Response Details
Status Code Description Response Headers
204 Backup delete request has been accepted. -
201 Create request for Snapshot accepted. -
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 deleteBackupWithHttpInfo( + public ApiResponse createSnapshotWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - @javax.annotation.Nullable Boolean force) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload) throws ApiException { okhttp3.Call localVarCall = - deleteBackupValidateBeforeCall(projectId, backupId, force, null); - return localVarApiClient.execute(localVarCall); + createSnapshotValidateBeforeCall(projectId, region, createSnapshotPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete a backup. (asynchronously) Delete a backup that is part of the project. + * Create new Snapshot. (asynchronously) Create a new Snapshot from a Volume in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) - * @param force Force action. (optional, default to false) + * @param region The STACKIT Region of the resources. (required) + * @param createSnapshotPayload Request a snapshot creation. (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 @@ -5150,7 +5708,7 @@ public ApiResponse deleteBackupWithHttpInfo( * * * - * + * * * * @@ -5158,24 +5716,27 @@ public ApiResponse deleteBackupWithHttpInfo( * *
Response Details
Status Code Description Response Headers
204 Backup delete request has been accepted. -
201 Create request for Snapshot accepted. -
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 deleteBackupAsync( + public okhttp3.Call createSnapshotAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - @javax.annotation.Nullable Boolean force, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteBackupValidateBeforeCall(projectId, backupId, force, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + createSnapshotValidateBeforeCall( + projectId, region, createSnapshotPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteImage + * Build call for createVolume * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createVolumePayload Request a volume creation. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -5183,7 +5744,7 @@ public okhttp3.Call deleteBackupAsync( * * * - * + * * * * @@ -5191,9 +5752,10 @@ public okhttp3.Call deleteBackupAsync( * *
Response Details
Status Code Description Response Headers
204 Image delete request has been accepted. -
201 Create request for volume accepted. -
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 deleteImageCall( + public okhttp3.Call createVolumeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateVolumePayload createVolumePayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -5209,17 +5771,17 @@ public okhttp3.Call deleteImageCall( basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = createVolumePayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images/{imageId}" + "/v2/projects/{projectId}/regions/{region}/volumes" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "imageId" + "}", - localVarApiClient.escapeString(imageId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5233,7 +5795,7 @@ public okhttp3.Call deleteImageCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -5244,7 +5806,7 @@ public okhttp3.Call deleteImageCall( return localVarApiClient.buildCall( basePath, localVarPath, - "DELETE", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -5256,38 +5818,49 @@ public okhttp3.Call deleteImageCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteImageValidateBeforeCall( + private okhttp3.Call createVolumeValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateVolumePayload createVolumePayload, 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 deleteImage(Async)"); + "Missing the required parameter 'projectId' when calling createVolume(Async)"); } - // verify the required parameter 'imageId' is set - if (imageId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'imageId' when calling deleteImage(Async)"); + "Missing the required parameter 'region' when calling createVolume(Async)"); + } + + // verify the required parameter 'createVolumePayload' is set + if (createVolumePayload == null) { + throw new ApiException( + "Missing the required parameter 'createVolumePayload' when calling createVolume(Async)"); } - return deleteImageCall(projectId, imageId, _callback); + return createVolumeCall(projectId, region, createVolumePayload, _callback); } /** - * Delete an Image. Delete an image that is part of the project. + * Create new volume. Create a new volume in a project. If a volume source is not provided, an + * empty volume will be created. The size property is required if no source or an image source + * is provided. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createVolumePayload Request a volume creation. (required) + * @return Volume * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -5295,25 +5868,32 @@ private okhttp3.Call deleteImageValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
204 Image delete request has been accepted. -
201 Create request for volume accepted. -
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 void deleteImage( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public Volume createVolume( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateVolumePayload createVolumePayload) throws ApiException { - deleteImageWithHttpInfo(projectId, imageId); + ApiResponse localVarResp = + createVolumeWithHttpInfo(projectId, region, createVolumePayload); + return localVarResp.getData(); } /** - * Delete an Image. Delete an image that is part of the project. + * Create new volume. Create a new volume in a project. If a volume source is not provided, an + * empty volume will be created. The size property is required if no source or an image source + * is provided. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @return ApiResponse<Void> + * @param region The STACKIT Region of the resources. (required) + * @param createVolumePayload Request a volume creation. (required) + * @return ApiResponse<Volume> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -5321,18 +5901,25 @@ public void deleteImage( * *
Response Details
Status Code Description Response Headers
204 Image delete request has been accepted. -
201 Create request for volume accepted. -
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 deleteImageWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public ApiResponse createVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateVolumePayload createVolumePayload) throws ApiException { - okhttp3.Call localVarCall = deleteImageValidateBeforeCall(projectId, imageId, null); - return localVarApiClient.execute(localVarCall); + okhttp3.Call localVarCall = + createVolumeValidateBeforeCall(projectId, region, createVolumePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete an Image. (asynchronously) Delete an image that is part of the project. + * Create new volume. (asynchronously) Create a new volume in a project. If a volume source is + * not provided, an empty volume will be created. The size property is required if no source or + * an image source is provided. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param createVolumePayload Request a volume creation. (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 @@ -5341,7 +5928,7 @@ public ApiResponse deleteImageWithHttpInfo( * * * - * + * * * * @@ -5349,22 +5936,26 @@ public ApiResponse deleteImageWithHttpInfo( * *
Response Details
Status Code Description Response Headers
204 Image delete request has been accepted. -
201 Create request for volume accepted. -
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 deleteImageAsync( + public okhttp3.Call createVolumeAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull CreateVolumePayload createVolumePayload, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteImageValidateBeforeCall(projectId, imageId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = + createVolumeValidateBeforeCall(projectId, region, createVolumePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteImageShare + * Build call for deallocateServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -5372,17 +5963,19 @@ public okhttp3.Call deleteImageAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 Image share removed. -
202 Server deallocation 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 deleteImageShareCall( + public okhttp3.Call deallocateServerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -5402,13 +5995,16 @@ public okhttp3.Call deleteImageShareCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images/{imageId}/share" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/deallocate" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "imageId" + "}", - localVarApiClient.escapeString(imageId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5433,7 +6029,7 @@ public okhttp3.Call deleteImageShareCall( return localVarApiClient.buildCall( basePath, localVarPath, - "DELETE", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -5445,56 +6041,70 @@ public okhttp3.Call deleteImageShareCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteImageShareValidateBeforeCall( + private okhttp3.Call deallocateServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, 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 deleteImageShare(Async)"); + "Missing the required parameter 'projectId' when calling deallocateServer(Async)"); } - // verify the required parameter 'imageId' is set - if (imageId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'imageId' when calling deleteImageShare(Async)"); + "Missing the required parameter 'region' when calling deallocateServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling deallocateServer(Async)"); } - return deleteImageShareCall(projectId, imageId, _callback); + return deallocateServerCall(projectId, region, serverId, _callback); } /** - * Remove image share. Remove the image share. New scope will be local. + * Deallocate an existing server. Deallocate an existing server. The server will be removed from + * the hypervisor so only the volume will be billed. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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 Image share removed. -
202 Server deallocation 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 deleteImageShare( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public void deallocateServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) throws ApiException { - deleteImageShareWithHttpInfo(projectId, imageId); + deallocateServerWithHttpInfo(projectId, region, serverId); } /** - * Remove image share. Remove the image share. New scope will be local. + * Deallocate an existing server. Deallocate an existing server. The server will be removed from + * the hypervisor so only the volume will be billed. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -5502,26 +6112,32 @@ public void deleteImageShare( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 Image share removed. -
202 Server deallocation 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 deleteImageShareWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public ApiResponse deallocateServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) throws ApiException { - okhttp3.Call localVarCall = deleteImageShareValidateBeforeCall(projectId, imageId, null); + okhttp3.Call localVarCall = + deallocateServerValidateBeforeCall(projectId, region, serverId, null); return localVarApiClient.execute(localVarCall); } /** - * Remove image share. (asynchronously) Remove the image share. New scope will be local. + * Deallocate an existing server. (asynchronously) Deallocate an existing server. The server + * will be removed from the hypervisor so only the volume will be billed. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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 @@ -5530,33 +6146,34 @@ public ApiResponse deleteImageShareWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 Image share removed. -
202 Server deallocation 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 deleteImageShareAsync( + public okhttp3.Call deallocateServerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteImageShareValidateBeforeCall(projectId, imageId, _callback); + deallocateServerValidateBeforeCall(projectId, region, serverId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteImageShareConsumer + * Build call for deleteAffinityGroup * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image - * share. (required) + * @param region The STACKIT Region of the resources. (required) + * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -5564,7 +6181,7 @@ public okhttp3.Call deleteImageShareAsync( * * * - * + * * * * @@ -5572,10 +6189,10 @@ public okhttp3.Call deleteImageShareAsync( * *
Response Details
Status Code Description Response Headers
204 Image share consumer removed. -
204 Delete request for an server group was accepted. -
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 deleteImageShareConsumerCall( + public okhttp3.Call deleteAffinityGroupCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UUID consumerProjectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID affinityGroupId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -5595,16 +6212,16 @@ public okhttp3.Call deleteImageShareConsumerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + "/v2/projects/{projectId}/regions/{region}/affinity-groups/{affinityGroupId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "imageId" + "}", - localVarApiClient.escapeString(imageId.toString())) + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( - "{" + "consumerProjectId" + "}", - localVarApiClient.escapeString(consumerProjectId.toString())); + "{" + "affinityGroupId" + "}", + localVarApiClient.escapeString(affinityGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5641,47 +6258,46 @@ public okhttp3.Call deleteImageShareConsumerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteImageShareConsumerValidateBeforeCall( + private okhttp3.Call deleteAffinityGroupValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UUID consumerProjectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID affinityGroupId, 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 deleteImageShareConsumer(Async)"); + "Missing the required parameter 'projectId' when calling deleteAffinityGroup(Async)"); } - // verify the required parameter 'imageId' is set - if (imageId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'imageId' when calling deleteImageShareConsumer(Async)"); + "Missing the required parameter 'region' when calling deleteAffinityGroup(Async)"); } - // verify the required parameter 'consumerProjectId' is set - if (consumerProjectId == null) { + // verify the required parameter 'affinityGroupId' is set + if (affinityGroupId == null) { throw new ApiException( - "Missing the required parameter 'consumerProjectId' when calling deleteImageShareConsumer(Async)"); + "Missing the required parameter 'affinityGroupId' when calling deleteAffinityGroup(Async)"); } - return deleteImageShareConsumerCall(projectId, imageId, consumerProjectId, _callback); + return deleteAffinityGroupCall(projectId, region, affinityGroupId, _callback); } /** - * Remove an image share consumer. Remove consumer from a shared image. + * Delete a affinity group in a project. Delete a affinity group in the given project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image - * share. (required) + * @param region The STACKIT Region of the resources. (required) + * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -5689,21 +6305,20 @@ private okhttp3.Call deleteImageShareConsumerValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
204 Image share consumer removed. -
204 Delete request for an server group was accepted. -
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 void deleteImageShareConsumer( + public void deleteAffinityGroup( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UUID consumerProjectId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID affinityGroupId) throws ApiException { - deleteImageShareConsumerWithHttpInfo(projectId, imageId, consumerProjectId); + deleteAffinityGroupWithHttpInfo(projectId, region, affinityGroupId); } /** - * Remove an image share consumer. Remove consumer from a shared image. + * Delete a affinity group in a project. Delete a affinity group in the given project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image - * share. (required) + * @param region The STACKIT Region of the resources. (required) + * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -5711,7 +6326,7 @@ public void deleteImageShareConsumer( * * * - * + * * * * @@ -5719,24 +6334,23 @@ public void deleteImageShareConsumer( * *
Response Details
Status Code Description Response Headers
204 Image share consumer removed. -
204 Delete request for an server group was accepted. -
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 deleteImageShareConsumerWithHttpInfo( + public ApiResponse deleteAffinityGroupWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UUID consumerProjectId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID affinityGroupId) throws ApiException { okhttp3.Call localVarCall = - deleteImageShareConsumerValidateBeforeCall( - projectId, imageId, consumerProjectId, null); + deleteAffinityGroupValidateBeforeCall(projectId, region, affinityGroupId, null); return localVarApiClient.execute(localVarCall); } /** - * Remove an image share consumer. (asynchronously) Remove consumer from a shared image. + * Delete a affinity group in a project. (asynchronously) Delete a affinity group in the given + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image - * share. (required) + * @param region The STACKIT Region of the resources. (required) + * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -5745,7 +6359,7 @@ public ApiResponse deleteImageShareConsumerWithHttpInfo( * * * - * + * * * * @@ -5753,24 +6367,27 @@ public ApiResponse deleteImageShareConsumerWithHttpInfo( * *
Response Details
Status Code Description Response Headers
204 Image share consumer removed. -
204 Delete request for an server group was accepted. -
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 deleteImageShareConsumerAsync( + public okhttp3.Call deleteAffinityGroupAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UUID consumerProjectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID affinityGroupId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteImageShareConsumerValidateBeforeCall( - projectId, imageId, consumerProjectId, _callback); + deleteAffinityGroupValidateBeforeCall( + projectId, region, affinityGroupId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteKeyPair + * Build call for deleteBackup * - * @param keypairName The name of an SSH keypair. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param force Force action. (optional, default to false) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -5778,7 +6395,7 @@ public okhttp3.Call deleteImageShareConsumerAsync( * * * - * + * * * * @@ -5786,8 +6403,12 @@ public okhttp3.Call deleteImageShareConsumerAsync( * *
Response Details
Status Code Description Response Headers
204 Delete request for an SSH keypair was accepted. -
204 Backup delete request has been accepted. -
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 deleteKeyPairCall( - @javax.annotation.Nonnull String keypairName, final ApiCallback _callback) + public okhttp3.Call deleteBackupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nullable Boolean force, + final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -5806,10 +6427,16 @@ public okhttp3.Call deleteKeyPairCall( // create path and map variables String localVarPath = - "/v1/keypairs/{keypairName}" + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" .replace( - "{" + "keypairName" + "}", - localVarApiClient.escapeString(keypairName.toString())); + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "backupId" + "}", + localVarApiClient.escapeString(backupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5817,6 +6444,10 @@ public okhttp3.Call deleteKeyPairCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (force != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("force", force)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -5846,29 +6477,48 @@ public okhttp3.Call deleteKeyPairCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteKeyPairValidateBeforeCall( - @javax.annotation.Nonnull String keypairName, final ApiCallback _callback) + private okhttp3.Call deleteBackupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nullable Boolean force, + final ApiCallback _callback) throws ApiException { - // verify the required parameter 'keypairName' is set - if (keypairName == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'keypairName' when calling deleteKeyPair(Async)"); + "Missing the required parameter 'projectId' when calling deleteBackup(Async)"); } - return deleteKeyPairCall(keypairName, _callback); + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling deleteBackup(Async)"); + } + + // verify the required parameter 'backupId' is set + if (backupId == null) { + throw new ApiException( + "Missing the required parameter 'backupId' when calling deleteBackup(Async)"); + } + + return deleteBackupCall(projectId, region, backupId, force, _callback); } /** - * Delete an SSH keypair. Delete an SSH keypair from a user. + * Delete a backup. Delete a backup that is part of the project. * - * @param keypairName The name of an SSH keypair. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param force Force action. (optional, default to false) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -5876,14 +6526,22 @@ private okhttp3.Call deleteKeyPairValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
204 Delete request for an SSH keypair was accepted. -
204 Backup delete request has been accepted. -
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 void deleteKeyPair(@javax.annotation.Nonnull String keypairName) throws ApiException { - deleteKeyPairWithHttpInfo(keypairName); + public void deleteBackup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nullable Boolean force) + throws ApiException { + deleteBackupWithHttpInfo(projectId, region, backupId, force); } /** - * Delete an SSH keypair. Delete an SSH keypair from a user. + * Delete a backup. Delete a backup that is part of the project. * - * @param keypairName The name of an SSH keypair. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param force Force action. (optional, default to false) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -5891,7 +6549,7 @@ public void deleteKeyPair(@javax.annotation.Nonnull String keypairName) throws A * * * - * + * * * * @@ -5899,16 +6557,24 @@ public void deleteKeyPair(@javax.annotation.Nonnull String keypairName) throws A * *
Response Details
Status Code Description Response Headers
204 Delete request for an SSH keypair was accepted. -
204 Backup delete request has been accepted. -
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 deleteKeyPairWithHttpInfo(@javax.annotation.Nonnull String keypairName) + public ApiResponse deleteBackupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nullable Boolean force) throws ApiException { - okhttp3.Call localVarCall = deleteKeyPairValidateBeforeCall(keypairName, null); + okhttp3.Call localVarCall = + deleteBackupValidateBeforeCall(projectId, region, backupId, force, null); return localVarApiClient.execute(localVarCall); } /** - * Delete an SSH keypair. (asynchronously) Delete an SSH keypair from a user. + * Delete a backup. (asynchronously) Delete a backup that is part of the project. * - * @param keypairName The name of an SSH keypair. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param force Force action. (optional, default to false) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -5917,7 +6583,7 @@ public ApiResponse deleteKeyPairWithHttpInfo(@javax.annotation.Nonnull Str * * * - * + * * * * @@ -5925,20 +6591,26 @@ public ApiResponse deleteKeyPairWithHttpInfo(@javax.annotation.Nonnull Str * *
Response Details
Status Code Description Response Headers
204 Delete request for an SSH keypair was accepted. -
204 Backup delete request has been accepted. -
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 deleteKeyPairAsync( - @javax.annotation.Nonnull String keypairName, final ApiCallback _callback) + public okhttp3.Call deleteBackupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nullable Boolean force, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteKeyPairValidateBeforeCall(keypairName, _callback); + okhttp3.Call localVarCall = + deleteBackupValidateBeforeCall(projectId, region, backupId, force, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteNetwork + * Build call for deleteImage * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -5946,18 +6618,18 @@ public okhttp3.Call deleteKeyPairAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Delete request for network has been accepted. -
204 Image delete request 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 deleteNetworkCall( + public okhttp3.Call deleteImageCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -5977,13 +6649,16 @@ public okhttp3.Call deleteNetworkCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/networks/{networkId}" + "/v2/projects/{projectId}/regions/{region}/images/{imageId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "imageId" + "}", + localVarApiClient.escapeString(imageId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -6020,57 +6695,67 @@ public okhttp3.Call deleteNetworkCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteNetworkValidateBeforeCall( + private okhttp3.Call deleteImageValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, 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 deleteNetwork(Async)"); + "Missing the required parameter 'projectId' when calling deleteImage(Async)"); } - // verify the required parameter 'networkId' is set - if (networkId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'networkId' when calling deleteNetwork(Async)"); + "Missing the required parameter 'region' when calling deleteImage(Async)"); + } + + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException( + "Missing the required parameter 'imageId' when calling deleteImage(Async)"); } - return deleteNetworkCall(projectId, networkId, _callback); + return deleteImageCall(projectId, region, imageId, _callback); } /** - * Delete network. Delete a network. If the network is still in use, the deletion will fail. + * Delete an Image. Delete an image that is part of the project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (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
202 Delete request for network has been accepted. -
204 Image delete request 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 deleteNetwork( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID networkId) + public void deleteImage( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId) throws ApiException { - deleteNetworkWithHttpInfo(projectId, networkId); + deleteImageWithHttpInfo(projectId, region, imageId); } /** - * Delete network. Delete a network. If the network is still in use, the deletion will fail. + * Delete an Image. Delete an image that is part of the project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -6078,28 +6763,29 @@ public void deleteNetwork( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Delete request for network has been accepted. -
204 Image delete request 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 deleteNetworkWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID networkId) + public ApiResponse deleteImageWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId) throws ApiException { - okhttp3.Call localVarCall = deleteNetworkValidateBeforeCall(projectId, networkId, null); + okhttp3.Call localVarCall = deleteImageValidateBeforeCall(projectId, region, imageId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete network. (asynchronously) Delete a network. If the network is still in use, the - * deletion will fail. + * Delete an Image. (asynchronously) Delete an image that is part of the project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (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 @@ -6108,32 +6794,33 @@ public ApiResponse deleteNetworkWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Delete request for network has been accepted. -
204 Image delete request 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 deleteNetworkAsync( + public okhttp3.Call deleteImageAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteNetworkValidateBeforeCall(projectId, networkId, _callback); + deleteImageValidateBeforeCall(projectId, region, imageId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteNetworkArea + * Build call for deleteImageShare * - * @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 imageId The identifier (ID) of a STACKIT Image. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -6141,18 +6828,18 @@ public okhttp3.Call deleteNetworkAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Delete request for area has been accepted. -
204 Image share removed. -
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 deleteNetworkAreaCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + public okhttp3.Call deleteImageShareCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -6172,13 +6859,16 @@ public okhttp3.Call deleteNetworkAreaCall( // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}" + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "imageId" + "}", + localVarApiClient.escapeString(imageId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -6215,59 +6905,67 @@ public okhttp3.Call deleteNetworkAreaCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteNetworkAreaValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + private okhttp3.Call deleteImageShareValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling deleteNetworkArea(Async)"); + "Missing the required parameter 'projectId' when calling deleteImageShare(Async)"); } - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling deleteNetworkArea(Async)"); + "Missing the required parameter 'region' when calling deleteImageShare(Async)"); } - return deleteNetworkAreaCall(organizationId, areaId, _callback); + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException( + "Missing the required parameter 'imageId' when calling deleteImageShare(Async)"); + } + + return deleteImageShareCall(projectId, region, imageId, _callback); } /** - * Delete a network area. Delete an existing network area in an organization. This is only - * possible if no projects are using the area anymore. + * Remove image share. Remove the image share. New scope will be local. * - * @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 imageId The identifier (ID) of a STACKIT Image. (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
202 Delete request for area has been accepted. -
204 Image share removed. -
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 deleteNetworkArea( - @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + public void deleteImageShare( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId) throws ApiException { - deleteNetworkAreaWithHttpInfo(organizationId, areaId); + deleteImageShareWithHttpInfo(projectId, region, imageId); } /** - * Delete a network area. Delete an existing network area in an organization. This is only - * possible if no projects are using the area anymore. + * Remove image share. Remove the image share. New scope will be local. * - * @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 imageId The identifier (ID) of a STACKIT Image. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -6275,29 +6973,30 @@ public void deleteNetworkArea( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Delete request for area has been accepted. -
204 Image share removed. -
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 deleteNetworkAreaWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + public ApiResponse deleteImageShareWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId) throws ApiException { okhttp3.Call localVarCall = - deleteNetworkAreaValidateBeforeCall(organizationId, areaId, null); + deleteImageShareValidateBeforeCall(projectId, region, imageId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete a network area. (asynchronously) Delete an existing network area in an organization. - * This is only possible if no projects are using the area anymore. + * Remove image share. (asynchronously) Remove the image share. New scope will be local. * - * @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 imageId The identifier (ID) of a STACKIT Image. (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 @@ -6306,33 +7005,35 @@ public ApiResponse deleteNetworkAreaWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Delete request for area has been accepted. -
204 Image share removed. -
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 deleteNetworkAreaAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + public okhttp3.Call deleteImageShareAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteNetworkAreaValidateBeforeCall(organizationId, areaId, _callback); + deleteImageShareValidateBeforeCall(projectId, region, imageId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteNetworkAreaRange + * Build call for deleteImageShareConsumer * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image + * share. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -6340,19 +7041,19 @@ public okhttp3.Call deleteNetworkAreaAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Delete request for network range has been accepted. -
204 Image share consumer removed. -
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 deleteNetworkAreaRangeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID networkRangeId, + public okhttp3.Call deleteImageShareConsumerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -6372,16 +7073,19 @@ public okhttp3.Call deleteNetworkAreaRangeCall( // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share/{consumerProjectId}" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( - "{" + "networkRangeId" + "}", - localVarApiClient.escapeString(networkRangeId.toString())); + "{" + "imageId" + "}", + localVarApiClient.escapeString(imageId.toString())) + .replace( + "{" + "consumerProjectId" + "}", + localVarApiClient.escapeString(consumerProjectId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -6418,70 +7122,80 @@ public okhttp3.Call deleteNetworkAreaRangeCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteNetworkAreaRangeValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID networkRangeId, + private okhttp3.Call deleteImageShareConsumerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling deleteNetworkAreaRange(Async)"); + "Missing the required parameter 'projectId' when calling deleteImageShareConsumer(Async)"); } - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling deleteNetworkAreaRange(Async)"); + "Missing the required parameter 'region' when calling deleteImageShareConsumer(Async)"); } - // verify the required parameter 'networkRangeId' is set - if (networkRangeId == null) { + // verify the required parameter 'imageId' is set + if (imageId == null) { throw new ApiException( - "Missing the required parameter 'networkRangeId' when calling deleteNetworkAreaRange(Async)"); + "Missing the required parameter 'imageId' when calling deleteImageShareConsumer(Async)"); + } + + // verify the required parameter 'consumerProjectId' is set + if (consumerProjectId == null) { + throw new ApiException( + "Missing the required parameter 'consumerProjectId' when calling deleteImageShareConsumer(Async)"); } - return deleteNetworkAreaRangeCall(organizationId, areaId, networkRangeId, _callback); + return deleteImageShareConsumerCall( + projectId, region, imageId, consumerProjectId, _callback); } /** - * Delete a network range. Delete a network range of a network area. The deletion will fail if - * the network range is still used. + * Remove an image share consumer. Remove consumer from a shared image. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image + * share. (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
202 Delete request for network range has been accepted. -
204 Image share consumer removed. -
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 deleteNetworkAreaRange( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID networkRangeId) + public void deleteImageShareConsumer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId) throws ApiException { - deleteNetworkAreaRangeWithHttpInfo(organizationId, areaId, networkRangeId); + deleteImageShareConsumerWithHttpInfo(projectId, region, imageId, consumerProjectId); } /** - * Delete a network range. Delete a network range of a network area. The deletion will fail if - * the network range is still used. + * Remove an image share consumer. Remove consumer from a shared image. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image + * share. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -6489,33 +7203,34 @@ public void deleteNetworkAreaRange( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Delete request for network range has been accepted. -
204 Image share consumer removed. -
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 deleteNetworkAreaRangeWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID networkRangeId) + public ApiResponse deleteImageShareConsumerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId) throws ApiException { okhttp3.Call localVarCall = - deleteNetworkAreaRangeValidateBeforeCall( - organizationId, areaId, networkRangeId, null); + deleteImageShareConsumerValidateBeforeCall( + projectId, region, imageId, consumerProjectId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete a network range. (asynchronously) Delete a network range of a network area. The - * deletion will fail if the network range is still used. + * Remove an image share consumer. (asynchronously) Remove consumer from a shared image. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image + * share. (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 @@ -6524,35 +7239,33 @@ public ApiResponse deleteNetworkAreaRangeWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Delete request for network range has been accepted. -
204 Image share consumer removed. -
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 deleteNetworkAreaRangeAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID networkRangeId, + public okhttp3.Call deleteImageShareConsumerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteNetworkAreaRangeValidateBeforeCall( - organizationId, areaId, networkRangeId, _callback); + deleteImageShareConsumerValidateBeforeCall( + projectId, region, imageId, consumerProjectId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteNetworkAreaRoute + * Build call for deleteKeyPair * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) + * @param keypairName The name of an SSH keypair. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -6560,7 +7273,7 @@ public okhttp3.Call deleteNetworkAreaRangeAsync( * * * - * + * * * * @@ -6568,11 +7281,8 @@ public okhttp3.Call deleteNetworkAreaRangeAsync( * *
Response Details
Status Code Description Response Headers
202 Delete request for network route has been accepted. -
204 Delete request for an SSH keypair was accepted. -
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 deleteNetworkAreaRouteCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) + public okhttp3.Call deleteKeyPairCall( + @javax.annotation.Nonnull String keypairName, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -6591,16 +7301,10 @@ public okhttp3.Call deleteNetworkAreaRouteCall( // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "/v2/keypairs/{keypairName}" .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) - .replace( - "{" + "routeId" + "}", - localVarApiClient.escapeString(routeId.toString())); + "{" + "keypairName" + "}", + localVarApiClient.escapeString(keypairName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -6637,46 +7341,29 @@ public okhttp3.Call deleteNetworkAreaRouteCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteNetworkAreaRouteValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) + private okhttp3.Call deleteKeyPairValidateBeforeCall( + @javax.annotation.Nonnull String keypairName, 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 deleteNetworkAreaRoute(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling deleteNetworkAreaRoute(Async)"); - } - - // verify the required parameter 'routeId' is set - if (routeId == null) { + // verify the required parameter 'keypairName' is set + if (keypairName == null) { throw new ApiException( - "Missing the required parameter 'routeId' when calling deleteNetworkAreaRoute(Async)"); + "Missing the required parameter 'keypairName' when calling deleteKeyPair(Async)"); } - return deleteNetworkAreaRouteCall(organizationId, areaId, routeId, _callback); + return deleteKeyPairCall(keypairName, _callback); } /** - * Delete a network route. Delete a network route of a network area. + * Delete an SSH keypair. Delete an SSH keypair from a user. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) + * @param keypairName The name of an SSH keypair. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -6684,20 +7371,14 @@ private okhttp3.Call deleteNetworkAreaRouteValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
202 Delete request for network route has been accepted. -
204 Delete request for an SSH keypair was accepted. -
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 void deleteNetworkAreaRoute( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId) - throws ApiException { - deleteNetworkAreaRouteWithHttpInfo(organizationId, areaId, routeId); + public void deleteKeyPair(@javax.annotation.Nonnull String keypairName) throws ApiException { + deleteKeyPairWithHttpInfo(keypairName); } /** - * Delete a network route. Delete a network route of a network area. + * Delete an SSH keypair. Delete an SSH keypair from a user. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) + * @param keypairName The name of an SSH keypair. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -6705,7 +7386,7 @@ public void deleteNetworkAreaRoute( * * * - * + * * * * @@ -6713,22 +7394,16 @@ public void deleteNetworkAreaRoute( * *
Response Details
Status Code Description Response Headers
202 Delete request for network route has been accepted. -
204 Delete request for an SSH keypair was accepted. -
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 deleteNetworkAreaRouteWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId) + public ApiResponse deleteKeyPairWithHttpInfo(@javax.annotation.Nonnull String keypairName) throws ApiException { - okhttp3.Call localVarCall = - deleteNetworkAreaRouteValidateBeforeCall(organizationId, areaId, routeId, null); + okhttp3.Call localVarCall = deleteKeyPairValidateBeforeCall(keypairName, null); return localVarApiClient.execute(localVarCall); } /** - * Delete a network route. (asynchronously) Delete a network route of a network area. + * Delete an SSH keypair. (asynchronously) Delete an SSH keypair from a user. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) + * @param keypairName The name of an SSH keypair. (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 @@ -6737,7 +7412,7 @@ public ApiResponse deleteNetworkAreaRouteWithHttpInfo( * * * - * + * * * * @@ -6745,26 +7420,21 @@ public ApiResponse deleteNetworkAreaRouteWithHttpInfo( * *
Response Details
Status Code Description Response Headers
202 Delete request for network route has been accepted. -
204 Delete request for an SSH keypair was accepted. -
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 deleteNetworkAreaRouteAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) + public okhttp3.Call deleteKeyPairAsync( + @javax.annotation.Nonnull String keypairName, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = - deleteNetworkAreaRouteValidateBeforeCall( - organizationId, areaId, routeId, _callback); + okhttp3.Call localVarCall = deleteKeyPairValidateBeforeCall(keypairName, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteNic + * Build call for deleteNetwork * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -6772,18 +7442,19 @@ public okhttp3.Call deleteNetworkAreaRouteAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 Network interface delete request has been accepted. -
202 Delete request for network 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 deleteNicCall( + public okhttp3.Call deleteNetworkCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -6803,16 +7474,16 @@ public okhttp3.Call deleteNicCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())) + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( - "{" + "nicId" + "}", - localVarApiClient.escapeString(nicId.toString())); + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -6849,67 +7520,68 @@ public okhttp3.Call deleteNicCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteNicValidateBeforeCall( + private okhttp3.Call deleteNetworkValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId, 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 deleteNic(Async)"); + "Missing the required parameter 'projectId' when calling deleteNetwork(Async)"); } - // verify the required parameter 'networkId' is set - if (networkId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'networkId' when calling deleteNic(Async)"); + "Missing the required parameter 'region' when calling deleteNetwork(Async)"); } - // verify the required parameter 'nicId' is set - if (nicId == null) { + // verify the required parameter 'networkId' is set + if (networkId == null) { throw new ApiException( - "Missing the required parameter 'nicId' when calling deleteNic(Async)"); + "Missing the required parameter 'networkId' when calling deleteNetwork(Async)"); } - return deleteNicCall(projectId, networkId, nicId, _callback); + return deleteNetworkCall(projectId, region, networkId, _callback); } /** - * Delete a network interface. Delete a network interface that is part of the project. + * Delete network. Delete a network. If the network 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 networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (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 Network interface delete request has been accepted. -
202 Delete request for network 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 deleteNic( + public void deleteNetwork( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId) throws ApiException { - deleteNicWithHttpInfo(projectId, networkId, nicId); + deleteNetworkWithHttpInfo(projectId, region, networkId); } /** - * Delete a network interface. Delete a network interface that is part of the project. + * Delete network. Delete a network. If the network 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 networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -6917,30 +7589,32 @@ public void deleteNic( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 Network interface delete request has been accepted. -
202 Delete request for network 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 deleteNicWithHttpInfo( + public ApiResponse deleteNetworkWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId) throws ApiException { - okhttp3.Call localVarCall = deleteNicValidateBeforeCall(projectId, networkId, nicId, null); + okhttp3.Call localVarCall = + deleteNetworkValidateBeforeCall(projectId, region, networkId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete a network interface. (asynchronously) Delete a network interface that is part of the - * project. + * Delete network. (asynchronously) Delete a network. If the network 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 networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (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 @@ -6949,32 +7623,33 @@ public ApiResponse deleteNicWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 Network interface delete request has been accepted. -
202 Delete request for network 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 deleteNicAsync( + public okhttp3.Call deleteNetworkAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteNicValidateBeforeCall(projectId, networkId, nicId, _callback); + deleteNetworkValidateBeforeCall(projectId, region, networkId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deletePublicIP + * Build call for deleteNetworkArea * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -6982,17 +7657,18 @@ public okhttp3.Call deleteNicAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 The public IP has been deleted. -
204 Delete request for area 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 deletePublicIPCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID publicIpId, + public okhttp3.Call deleteNetworkAreaCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -7012,13 +7688,13 @@ public okhttp3.Call deletePublicIPCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/public-ips/{publicIpId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "publicIpId" + "}", - localVarApiClient.escapeString(publicIpId.toString())); + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -7055,56 +7731,59 @@ public okhttp3.Call deletePublicIPCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deletePublicIPValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID publicIpId, + private okhttp3.Call deleteNetworkAreaValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling deletePublicIP(Async)"); + "Missing the required parameter 'organizationId' when calling deleteNetworkArea(Async)"); } - // verify the required parameter 'publicIpId' is set - if (publicIpId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'publicIpId' when calling deletePublicIP(Async)"); + "Missing the required parameter 'areaId' when calling deleteNetworkArea(Async)"); } - return deletePublicIPCall(projectId, publicIpId, _callback); + return deleteNetworkAreaCall(organizationId, areaId, _callback); } /** - * Delete a public IP. Delete a public IP that is part of the project. + * Delete a network area. Delete an existing network area in an organization. This is only + * possible if no projects are using the area anymore. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (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 The public IP has been deleted. -
204 Delete request for area 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 deletePublicIP( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID publicIpId) + public void deleteNetworkArea( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) throws ApiException { - deletePublicIPWithHttpInfo(projectId, publicIpId); + deleteNetworkAreaWithHttpInfo(organizationId, areaId); } /** - * Delete a public IP. Delete a public IP that is part of the project. + * Delete a network area. Delete an existing network area in an organization. This is only + * possible if no projects are using the area anymore. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -7112,26 +7791,29 @@ public void deletePublicIP( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 The public IP has been deleted. -
204 Delete request for area 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 deletePublicIPWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID publicIpId) + public ApiResponse deleteNetworkAreaWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) throws ApiException { - okhttp3.Call localVarCall = deletePublicIPValidateBeforeCall(projectId, publicIpId, null); + okhttp3.Call localVarCall = + deleteNetworkAreaValidateBeforeCall(organizationId, areaId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete a public IP. (asynchronously) Delete a public IP that is part of the project. + * Delete a network area. (asynchronously) Delete an existing network area in an organization. + * This is only possible if no projects are using the area anymore. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (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 @@ -7140,31 +7822,34 @@ public ApiResponse deletePublicIPWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 The public IP has been deleted. -
204 Delete request for area 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 deletePublicIPAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID publicIpId, + public okhttp3.Call deleteNetworkAreaAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deletePublicIPValidateBeforeCall(projectId, publicIpId, _callback); + deleteNetworkAreaValidateBeforeCall(organizationId, areaId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteSecurityGroup + * Build call for deleteNetworkAreaRange * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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 networkRangeId The identifier (ID) of a STACKIT Network Range. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -7172,7 +7857,7 @@ public okhttp3.Call deletePublicIPAsync( * * * - * + * * * * @@ -7181,9 +7866,11 @@ public okhttp3.Call deletePublicIPAsync( * *
Response Details
Status Code Description Response Headers
204 Delete request for security group has been accepted. -
202 Delete request for network range accepted. -
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 deleteSecurityGroupCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, + public okhttp3.Call deleteNetworkAreaRangeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkRangeId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -7203,13 +7890,19 @@ public okhttp3.Call deleteSecurityGroupCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/security-groups/{securityGroupId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges/{networkRangeId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "securityGroupId" + "}", - localVarApiClient.escapeString(securityGroupId.toString())); + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "networkRangeId" + "}", + localVarApiClient.escapeString(networkRangeId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -7246,38 +7939,56 @@ public okhttp3.Call deleteSecurityGroupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteSecurityGroupValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, + private okhttp3.Call deleteNetworkAreaRangeValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkRangeId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling deleteSecurityGroup(Async)"); + "Missing the required parameter 'organizationId' when calling deleteNetworkAreaRange(Async)"); } - // verify the required parameter 'securityGroupId' is set - if (securityGroupId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'securityGroupId' when calling deleteSecurityGroup(Async)"); + "Missing the required parameter 'areaId' when calling deleteNetworkAreaRange(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling deleteNetworkAreaRange(Async)"); + } + + // verify the required parameter 'networkRangeId' is set + if (networkRangeId == null) { + throw new ApiException( + "Missing the required parameter 'networkRangeId' when calling deleteNetworkAreaRange(Async)"); } - return deleteSecurityGroupCall(projectId, securityGroupId, _callback); + return deleteNetworkAreaRangeCall( + organizationId, areaId, region, networkRangeId, _callback); } /** - * Delete security group. Delete a security group. + * Delete a network range. Delete a network range of a network area. The deletion will fail if + * the network range is still used. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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 networkRangeId The identifier (ID) of a STACKIT Network Range. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -7286,18 +7997,23 @@ private okhttp3.Call deleteSecurityGroupValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
204 Delete request for security group has been accepted. -
202 Delete request for network range accepted. -
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 void deleteSecurityGroup( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId) + public void deleteNetworkAreaRange( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkRangeId) throws ApiException { - deleteSecurityGroupWithHttpInfo(projectId, securityGroupId); + deleteNetworkAreaRangeWithHttpInfo(organizationId, areaId, region, networkRangeId); } /** - * Delete security group. Delete a security group. + * Delete a network range. Delete a network range of a network area. The deletion will fail if + * the network range is still used. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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 networkRangeId The identifier (ID) of a STACKIT Network Range. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -7305,7 +8021,7 @@ public void deleteSecurityGroup( * * * - * + * * * * @@ -7314,20 +8030,26 @@ public void deleteSecurityGroup( * *
Response Details
Status Code Description Response Headers
204 Delete request for security group has been accepted. -
202 Delete request for network range accepted. -
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 deleteSecurityGroupWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId) + public ApiResponse deleteNetworkAreaRangeWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkRangeId) throws ApiException { okhttp3.Call localVarCall = - deleteSecurityGroupValidateBeforeCall(projectId, securityGroupId, null); + deleteNetworkAreaRangeValidateBeforeCall( + organizationId, areaId, region, networkRangeId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete security group. (asynchronously) Delete a security group. + * Delete a network range. (asynchronously) Delete a network range of a network area. The + * deletion will fail if the network range is still used. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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 networkRangeId The identifier (ID) of a STACKIT Network Range. (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 @@ -7336,7 +8058,7 @@ public ApiResponse deleteSecurityGroupWithHttpInfo( * * * - * + * * * * @@ -7345,24 +8067,27 @@ public ApiResponse deleteSecurityGroupWithHttpInfo( * *
Response Details
Status Code Description Response Headers
204 Delete request for security group has been accepted. -
202 Delete request for network range accepted. -
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 deleteSecurityGroupAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, + public okhttp3.Call deleteNetworkAreaRangeAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkRangeId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteSecurityGroupValidateBeforeCall(projectId, securityGroupId, _callback); + deleteNetworkAreaRangeValidateBeforeCall( + organizationId, areaId, region, networkRangeId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteSecurityGroupRule + * Build call for deleteNetworkAreaRegion * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (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 _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -7370,18 +8095,19 @@ public okhttp3.Call deleteSecurityGroupAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 Delete request for security group rule has been accepted. -
202 Regional configuration has been deleted. -
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 deleteSecurityGroupRuleCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull UUID securityGroupRuleId, + public okhttp3.Call deleteNetworkAreaRegionCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -7401,16 +8127,16 @@ public okhttp3.Call deleteSecurityGroupRuleCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "securityGroupId" + "}", - localVarApiClient.escapeString(securityGroupId.toString())) + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) .replace( - "{" + "securityGroupRuleId" + "}", - localVarApiClient.escapeString(securityGroupRuleId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -7447,68 +8173,70 @@ public okhttp3.Call deleteSecurityGroupRuleCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteSecurityGroupRuleValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull UUID securityGroupRuleId, + private okhttp3.Call deleteNetworkAreaRegionValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling deleteSecurityGroupRule(Async)"); + "Missing the required parameter 'organizationId' when calling deleteNetworkAreaRegion(Async)"); } - // verify the required parameter 'securityGroupId' is set - if (securityGroupId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'securityGroupId' when calling deleteSecurityGroupRule(Async)"); + "Missing the required parameter 'areaId' when calling deleteNetworkAreaRegion(Async)"); } - // verify the required parameter 'securityGroupRuleId' is set - if (securityGroupRuleId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'securityGroupRuleId' when calling deleteSecurityGroupRule(Async)"); + "Missing the required parameter 'region' when calling deleteNetworkAreaRegion(Async)"); } - return deleteSecurityGroupRuleCall( - projectId, securityGroupId, securityGroupRuleId, _callback); + return deleteNetworkAreaRegionCall(organizationId, areaId, region, _callback); } /** - * Delete security group rule. Delete a security group rule. + * Delete a configuration of region for a network area. Delete a current configuration of region + * for a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (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) * @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 security group rule has been accepted. -
202 Regional configuration has been deleted. -
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 deleteSecurityGroupRule( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull UUID securityGroupRuleId) + public void deleteNetworkAreaRegion( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region) throws ApiException { - deleteSecurityGroupRuleWithHttpInfo(projectId, securityGroupId, securityGroupRuleId); + deleteNetworkAreaRegionWithHttpInfo(organizationId, areaId, region); } /** - * Delete security group rule. Delete a security group rule. + * Delete a configuration of region for a network area. Delete a current configuration of region + * for a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (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) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -7516,31 +8244,32 @@ public void deleteSecurityGroupRule( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 Delete request for security group rule has been accepted. -
202 Regional configuration has been deleted. -
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 deleteSecurityGroupRuleWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull UUID securityGroupRuleId) + public ApiResponse deleteNetworkAreaRegionWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region) throws ApiException { okhttp3.Call localVarCall = - deleteSecurityGroupRuleValidateBeforeCall( - projectId, securityGroupId, securityGroupRuleId, null); + deleteNetworkAreaRegionValidateBeforeCall(organizationId, areaId, region, null); return localVarApiClient.execute(localVarCall); } /** - * Delete security group rule. (asynchronously) Delete a security group rule. + * Delete a configuration of region for a network area. (asynchronously) Delete a current + * configuration of region for a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (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 _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 @@ -7549,33 +8278,36 @@ public ApiResponse deleteSecurityGroupRuleWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
204 Delete request for security group rule has been accepted. -
202 Regional configuration has been deleted. -
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 deleteSecurityGroupRuleAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull UUID securityGroupRuleId, + public okhttp3.Call deleteNetworkAreaRegionAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteSecurityGroupRuleValidateBeforeCall( - projectId, securityGroupId, securityGroupRuleId, _callback); + deleteNetworkAreaRegionValidateBeforeCall( + organizationId, areaId, region, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteServer + * Build call for deleteNetworkAreaRoute * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (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 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 @@ -7583,7 +8315,7 @@ public okhttp3.Call deleteSecurityGroupRuleAsync( * * * - * + * * * * @@ -7591,9 +8323,11 @@ public okhttp3.Call deleteSecurityGroupRuleAsync( * *
Response Details
Status Code Description Response Headers
204 Delete request for server accepted. -
202 Delete request for the network route has been accepted. -
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 deleteServerCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + public okhttp3.Call deleteNetworkAreaRouteCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -7613,13 +8347,19 @@ public okhttp3.Call deleteServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "routeId" + "}", + localVarApiClient.escapeString(routeId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -7656,38 +8396,54 @@ public okhttp3.Call deleteServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteServerValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + private okhttp3.Call deleteNetworkAreaRouteValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling deleteServer(Async)"); + "Missing the required parameter 'organizationId' when calling deleteNetworkAreaRoute(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling deleteServer(Async)"); + "Missing the required parameter 'areaId' when calling deleteNetworkAreaRoute(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling deleteNetworkAreaRoute(Async)"); + } + + // verify the required parameter 'routeId' is set + if (routeId == null) { + throw new ApiException( + "Missing the required parameter 'routeId' when calling deleteNetworkAreaRoute(Async)"); } - return deleteServerCall(projectId, serverId, _callback); + return deleteNetworkAreaRouteCall(organizationId, areaId, region, routeId, _callback); } /** - * Delete a server. Delete a server. Volumes won't be deleted. + * Delete a network route. Delete a network route of a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (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 routeId The identifier (ID) of a STACKIT Route. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -7695,17 +8451,22 @@ private okhttp3.Call deleteServerValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
204 Delete request for server accepted. -
202 Delete request for the network route has been accepted. -
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 void deleteServer( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public void deleteNetworkAreaRoute( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId) throws ApiException { - deleteServerWithHttpInfo(projectId, serverId); + deleteNetworkAreaRouteWithHttpInfo(organizationId, areaId, region, routeId); } /** - * Delete a server. Delete a server. Volumes won't be deleted. + * Delete a network route. Delete a network route of a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (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 routeId The identifier (ID) of a STACKIT Route. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -7713,7 +8474,7 @@ public void deleteServer( * * * - * + * * * * @@ -7721,18 +8482,25 @@ public void deleteServer( * *
Response Details
Status Code Description Response Headers
204 Delete request for server accepted. -
202 Delete request for the network route has been accepted. -
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 deleteServerWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public ApiResponse deleteNetworkAreaRouteWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId) throws ApiException { - okhttp3.Call localVarCall = deleteServerValidateBeforeCall(projectId, serverId, null); + okhttp3.Call localVarCall = + deleteNetworkAreaRouteValidateBeforeCall( + organizationId, areaId, region, routeId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete a server. (asynchronously) Delete a server. Volumes won't be deleted. + * Delete a network route. (asynchronously) Delete a network route of a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (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 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 @@ -7741,7 +8509,7 @@ public ApiResponse deleteServerWithHttpInfo( * * * - * + * * * * @@ -7749,22 +8517,28 @@ public ApiResponse deleteServerWithHttpInfo( * *
Response Details
Status Code Description Response Headers
204 Delete request for server accepted. -
202 Delete request for the network route has been accepted. -
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 deleteServerAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + public okhttp3.Call deleteNetworkAreaRouteAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteServerValidateBeforeCall(projectId, serverId, _callback); + okhttp3.Call localVarCall = + deleteNetworkAreaRouteValidateBeforeCall( + organizationId, areaId, region, routeId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteSnapshot + * Build call for deleteNic * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -7772,7 +8546,7 @@ public okhttp3.Call deleteServerAsync( * * * - * + * * * * @@ -7780,9 +8554,11 @@ public okhttp3.Call deleteServerAsync( * *
Response Details
Status Code Description Response Headers
204 Snapshot delete request has been accepted. -
204 Network interface delete request has been accepted. -
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 deleteSnapshotCall( + public okhttp3.Call deleteNicCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID snapshotId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -7802,13 +8578,19 @@ public okhttp3.Call deleteSnapshotCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/snapshots/{snapshotId}" + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "snapshotId" + "}", - localVarApiClient.escapeString(snapshotId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())) + .replace( + "{" + "nicId" + "}", + localVarApiClient.escapeString(nicId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -7845,38 +8627,54 @@ public okhttp3.Call deleteSnapshotCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteSnapshotValidateBeforeCall( + private okhttp3.Call deleteNicValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID snapshotId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, 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 deleteSnapshot(Async)"); + "Missing the required parameter 'projectId' when calling deleteNic(Async)"); } - // verify the required parameter 'snapshotId' is set - if (snapshotId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'snapshotId' when calling deleteSnapshot(Async)"); + "Missing the required parameter 'region' when calling deleteNic(Async)"); + } + + // verify the required parameter 'networkId' is set + if (networkId == null) { + throw new ApiException( + "Missing the required parameter 'networkId' when calling deleteNic(Async)"); + } + + // verify the required parameter 'nicId' is set + if (nicId == null) { + throw new ApiException( + "Missing the required parameter 'nicId' when calling deleteNic(Async)"); } - return deleteSnapshotCall(projectId, snapshotId, _callback); + return deleteNicCall(projectId, region, networkId, nicId, _callback); } /** - * Delete a snapshot. Delete a snapshot that is part of the project. + * Delete a network interface. Delete a network interface that is part of the project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -7884,17 +8682,22 @@ private okhttp3.Call deleteSnapshotValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
204 Snapshot delete request has been accepted. -
204 Network interface delete request has been accepted. -
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 void deleteSnapshot( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID snapshotId) + public void deleteNic( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId) throws ApiException { - deleteSnapshotWithHttpInfo(projectId, snapshotId); + deleteNicWithHttpInfo(projectId, region, networkId, nicId); } /** - * Delete a snapshot. Delete a snapshot that is part of the project. + * Delete a network interface. Delete a network interface that is part of the project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -7902,7 +8705,7 @@ public void deleteSnapshot( * * * - * + * * * * @@ -7910,18 +8713,25 @@ public void deleteSnapshot( * *
Response Details
Status Code Description Response Headers
204 Snapshot delete request has been accepted. -
204 Network interface delete request has been accepted. -
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 deleteSnapshotWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID snapshotId) + public ApiResponse deleteNicWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId) throws ApiException { - okhttp3.Call localVarCall = deleteSnapshotValidateBeforeCall(projectId, snapshotId, null); + okhttp3.Call localVarCall = + deleteNicValidateBeforeCall(projectId, region, networkId, nicId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete a snapshot. (asynchronously) Delete a snapshot that is part of the project. + * Delete a network interface. (asynchronously) Delete a network interface that is part of the + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (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 @@ -7930,7 +8740,7 @@ public ApiResponse deleteSnapshotWithHttpInfo( * * * - * + * * * * @@ -7938,23 +8748,26 @@ public ApiResponse deleteSnapshotWithHttpInfo( * *
Response Details
Status Code Description Response Headers
204 Snapshot delete request has been accepted. -
204 Network interface delete request has been accepted. -
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 deleteSnapshotAsync( + public okhttp3.Call deleteNicAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID snapshotId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - deleteSnapshotValidateBeforeCall(projectId, snapshotId, _callback); + deleteNicValidateBeforeCall(projectId, region, networkId, nicId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteVolume + * Build call for deletePublicIP * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -7962,18 +8775,18 @@ public okhttp3.Call deleteSnapshotAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
204 Volume delete request has been accepted. -
204 The public IP has been deleted. -
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 deleteVolumeCall( + public okhttp3.Call deletePublicIPCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -7993,13 +8806,16 @@ public okhttp3.Call deleteVolumeCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/volumes/{volumeId}" + "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "volumeId" + "}", - localVarApiClient.escapeString(volumeId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "publicIpId" + "}", + localVarApiClient.escapeString(publicIpId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -8036,59 +8852,67 @@ public okhttp3.Call deleteVolumeCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteVolumeValidateBeforeCall( + private okhttp3.Call deletePublicIPValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId, 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 deleteVolume(Async)"); + "Missing the required parameter 'projectId' when calling deletePublicIP(Async)"); } - // verify the required parameter 'volumeId' is set - if (volumeId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'volumeId' when calling deleteVolume(Async)"); + "Missing the required parameter 'region' when calling deletePublicIP(Async)"); + } + + // verify the required parameter 'publicIpId' is set + if (publicIpId == null) { + throw new ApiException( + "Missing the required parameter 'publicIpId' when calling deletePublicIP(Async)"); } - return deleteVolumeCall(projectId, volumeId, _callback); + return deletePublicIPCall(projectId, region, publicIpId, _callback); } /** - * Delete a volume. Delete a volume inside a project. The deletion will fail if the volume is - * still in use. + * Delete a public IP. Delete a public IP that is part of the project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (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 Volume delete request has been accepted. -
204 The public IP has been deleted. -
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 deleteVolume( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID volumeId) + public void deletePublicIP( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId) throws ApiException { - deleteVolumeWithHttpInfo(projectId, volumeId); + deletePublicIPWithHttpInfo(projectId, region, publicIpId); } /** - * Delete a volume. Delete a volume inside a project. The deletion will fail if the volume is - * still in use. + * Delete a public IP. Delete a public IP that is part of the project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -8096,28 +8920,30 @@ public void deleteVolume( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
204 Volume delete request has been accepted. -
204 The public IP has been deleted. -
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 deleteVolumeWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID volumeId) + public ApiResponse deletePublicIPWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId) throws ApiException { - okhttp3.Call localVarCall = deleteVolumeValidateBeforeCall(projectId, volumeId, null); + okhttp3.Call localVarCall = + deletePublicIPValidateBeforeCall(projectId, region, publicIpId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete a volume. (asynchronously) Delete a volume inside a project. The deletion will fail if - * the volume is still in use. + * Delete a public IP. (asynchronously) Delete a public IP that is part of the project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (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 @@ -8126,31 +8952,35 @@ public ApiResponse deleteVolumeWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
204 Volume delete request has been accepted. -
204 The public IP has been deleted. -
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 deleteVolumeAsync( + public okhttp3.Call deletePublicIPAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteVolumeValidateBeforeCall(projectId, volumeId, _callback); + okhttp3.Call localVarCall = + deletePublicIPValidateBeforeCall(projectId, region, publicIpId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getAffinityGroup + * Build call for deleteRouteFromRoutingTable * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (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 _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -8158,7 +8988,7 @@ public okhttp3.Call deleteVolumeAsync( * * * - * + * * * * @@ -8166,9 +8996,12 @@ public okhttp3.Call deleteVolumeAsync( * *
Response Details
Status Code Description Response Headers
200 Show affinity group details. -
204 Delete request for the route has been accepted. -
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 getAffinityGroupCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID affinityGroupId, + public okhttp3.Call deleteRouteFromRoutingTableCall( + @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; @@ -8188,13 +9021,22 @@ public okhttp3.Call getAffinityGroupCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/affinity-groups/{affinityGroupId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "affinityGroupId" + "}", - localVarApiClient.escapeString(affinityGroupId.toString())); + "{" + "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(); @@ -8219,7 +9061,7 @@ public okhttp3.Call getAffinityGroupCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -8231,39 +9073,63 @@ public okhttp3.Call getAffinityGroupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getAffinityGroupValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID affinityGroupId, + private okhttp3.Call deleteRouteFromRoutingTableValidateBeforeCall( + @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 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling getAffinityGroup(Async)"); + "Missing the required parameter 'organizationId' when calling deleteRouteFromRoutingTable(Async)"); } - // verify the required parameter 'affinityGroupId' is set - if (affinityGroupId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'affinityGroupId' when calling getAffinityGroup(Async)"); + "Missing the required parameter 'areaId' when calling deleteRouteFromRoutingTable(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling deleteRouteFromRoutingTable(Async)"); + } + + // verify the required parameter 'routingTableId' is set + if (routingTableId == null) { + throw new ApiException( + "Missing the required parameter 'routingTableId' when calling deleteRouteFromRoutingTable(Async)"); + } + + // verify the required parameter 'routeId' is set + if (routeId == null) { + throw new ApiException( + "Missing the required parameter 'routeId' when calling deleteRouteFromRoutingTable(Async)"); } - return getAffinityGroupCall(projectId, affinityGroupId, _callback); + return deleteRouteFromRoutingTableCall( + organizationId, areaId, region, routingTableId, routeId, _callback); } /** - * Get the affinity group. Get the affinity group created in a project. + * Delete a route in a routing table. Delete a route in an existing routing table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) - * @return AffinityGroup + * @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) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -8271,28 +9137,33 @@ private okhttp3.Call getAffinityGroupValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show affinity group details. -
204 Delete request for the route has been accepted. -
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 AffinityGroup getAffinityGroup( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID affinityGroupId) + public void deleteRouteFromRoutingTable( + @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 = - getAffinityGroupWithHttpInfo(projectId, affinityGroupId); - return localVarResp.getData(); + deleteRouteFromRoutingTableWithHttpInfo( + organizationId, areaId, region, routingTableId, routeId); } /** - * Get the affinity group. Get the affinity group created in a project. + * Delete a route in a routing table. Delete a route in an existing routing table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) - * @return ApiResponse<AffinityGroup> + * @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 ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -8300,21 +9171,28 @@ public AffinityGroup getAffinityGroup( * *
Response Details
Status Code Description Response Headers
200 Show affinity group details. -
204 Delete request for the route has been accepted. -
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 getAffinityGroupWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID affinityGroupId) + public ApiResponse deleteRouteFromRoutingTableWithHttpInfo( + @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 { okhttp3.Call localVarCall = - getAffinityGroupValidateBeforeCall(projectId, affinityGroupId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + deleteRouteFromRoutingTableValidateBeforeCall( + organizationId, areaId, region, routingTableId, routeId, null); + return localVarApiClient.execute(localVarCall); } /** - * Get the affinity group. (asynchronously) Get the affinity group created in a project. + * Delete a route in a routing table. (asynchronously) Delete a route in an existing routing + * table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (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 _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 @@ -8323,7 +9201,7 @@ public ApiResponse getAffinityGroupWithHttpInfo( * * * - * + * * * * @@ -8331,25 +9209,29 @@ public ApiResponse getAffinityGroupWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show affinity group details. -
204 Delete request for the route has been accepted. -
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 getAffinityGroupAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID affinityGroupId, - final ApiCallback _callback) + public okhttp3.Call deleteRouteFromRoutingTableAsync( + @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 { okhttp3.Call localVarCall = - getAffinityGroupValidateBeforeCall(projectId, affinityGroupId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + deleteRouteFromRoutingTableValidateBeforeCall( + organizationId, areaId, region, routingTableId, routeId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getAttachedVolume + * Build call for deleteRoutingTableFromArea * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (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 _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -8357,7 +9239,7 @@ public okhttp3.Call getAffinityGroupAsync( * * * - * + * * * * @@ -8365,10 +9247,11 @@ public okhttp3.Call getAffinityGroupAsync( * *
Response Details
Status Code Description Response Headers
200 Get details about a volume attachment. -
204 Delete request for the routing table has been accepted. -
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 getAttachedVolumeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, + public okhttp3.Call deleteRoutingTableFromAreaCall( + @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 { String basePath = null; @@ -8388,16 +9271,19 @@ public okhttp3.Call getAttachedVolumeCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())) + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) .replace( - "{" + "volumeId" + "}", - localVarApiClient.escapeString(volumeId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "routingTableId" + "}", + localVarApiClient.escapeString(routingTableId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -8422,7 +9308,7 @@ public okhttp3.Call getAttachedVolumeCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -8434,47 +9320,55 @@ public okhttp3.Call getAttachedVolumeCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getAttachedVolumeValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, + private okhttp3.Call deleteRoutingTableFromAreaValidateBeforeCall( + @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 { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling getAttachedVolume(Async)"); + "Missing the required parameter 'organizationId' when calling deleteRoutingTableFromArea(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling getAttachedVolume(Async)"); + "Missing the required parameter 'areaId' when calling deleteRoutingTableFromArea(Async)"); } - // verify the required parameter 'volumeId' is set - if (volumeId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'volumeId' when calling getAttachedVolume(Async)"); + "Missing the required parameter 'region' when calling deleteRoutingTableFromArea(Async)"); + } + + // verify the required parameter 'routingTableId' is set + if (routingTableId == null) { + throw new ApiException( + "Missing the required parameter 'routingTableId' when calling deleteRoutingTableFromArea(Async)"); } - return getAttachedVolumeCall(projectId, serverId, volumeId, _callback); + return deleteRoutingTableFromAreaCall( + organizationId, areaId, region, routingTableId, _callback); } /** - * Get Volume Attachment details. Get the details of an existing Volume Attachment. + * Delete a routing table. Delete a routing table of a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @return VolumeAttachment - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * @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) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -8482,30 +9376,30 @@ private okhttp3.Call getAttachedVolumeValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Get details about a volume attachment. -
204 Delete request for the routing table has been accepted. -
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 VolumeAttachment getAttachedVolume( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId) + public void deleteRoutingTableFromArea( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId) throws ApiException { - ApiResponse localVarResp = - getAttachedVolumeWithHttpInfo(projectId, serverId, volumeId); - return localVarResp.getData(); + deleteRoutingTableFromAreaWithHttpInfo(organizationId, areaId, region, routingTableId); } /** - * Get Volume Attachment details. Get the details of an existing Volume Attachment. + * Delete a routing table. Delete a routing table of a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @return ApiResponse<VolumeAttachment> + * @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<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -8513,24 +9407,25 @@ public VolumeAttachment getAttachedVolume( * *
Response Details
Status Code Description Response Headers
200 Get details about a volume attachment. -
204 Delete request for the routing table has been accepted. -
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 getAttachedVolumeWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId) + public ApiResponse deleteRoutingTableFromAreaWithHttpInfo( + @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 = - getAttachedVolumeValidateBeforeCall(projectId, serverId, volumeId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + deleteRoutingTableFromAreaValidateBeforeCall( + organizationId, areaId, region, routingTableId, null); + return localVarApiClient.execute(localVarCall); } /** - * Get Volume Attachment details. (asynchronously) Get the details of an existing Volume - * Attachment. + * Delete a routing table. (asynchronously) Delete a routing table of a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (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 _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 @@ -8539,7 +9434,7 @@ public ApiResponse getAttachedVolumeWithHttpInfo( * * * - * + * * * * @@ -8547,25 +9442,27 @@ public ApiResponse getAttachedVolumeWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Get details about a volume attachment. -
204 Delete request for the routing table has been accepted. -
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 getAttachedVolumeAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - final ApiCallback _callback) + public okhttp3.Call deleteRoutingTableFromAreaAsync( + @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 = - getAttachedVolumeValidateBeforeCall(projectId, serverId, volumeId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + deleteRoutingTableFromAreaValidateBeforeCall( + organizationId, areaId, region, routingTableId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getBackup + * Build call for deleteSecurityGroup * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -8573,17 +9470,19 @@ public okhttp3.Call getAttachedVolumeAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Show backup details. -
204 Delete request for security group 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 getBackupCall( + public okhttp3.Call deleteSecurityGroupCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -8603,13 +9502,16 @@ public okhttp3.Call getBackupCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/backups/{backupId}" + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "backupId" + "}", - localVarApiClient.escapeString(backupId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -8634,7 +9536,7 @@ public okhttp3.Call getBackupCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -8646,86 +9548,100 @@ public okhttp3.Call getBackupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getBackupValidateBeforeCall( + private okhttp3.Call deleteSecurityGroupValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, 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 getBackup(Async)"); + "Missing the required parameter 'projectId' when calling deleteSecurityGroup(Async)"); } - // verify the required parameter 'backupId' is set - if (backupId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'backupId' when calling getBackup(Async)"); + "Missing the required parameter 'region' when calling deleteSecurityGroup(Async)"); + } + + // verify the required parameter 'securityGroupId' is set + if (securityGroupId == null) { + throw new ApiException( + "Missing the required parameter 'securityGroupId' when calling deleteSecurityGroup(Async)"); } - return getBackupCall(projectId, backupId, _callback); + return deleteSecurityGroupCall(projectId, region, securityGroupId, _callback); } /** - * Get details about a backup. Get details about a block device backup. + * Delete security group. Delete a security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) - * @return Backup + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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
200 Show backup details. -
204 Delete request for security group 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 Backup getBackup( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID backupId) + public void deleteSecurityGroup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId) throws ApiException { - ApiResponse localVarResp = getBackupWithHttpInfo(projectId, backupId); - return localVarResp.getData(); + deleteSecurityGroupWithHttpInfo(projectId, region, securityGroupId); } /** - * Get details about a backup. Get details about a block device backup. + * Delete security group. Delete a security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) - * @return ApiResponse<Backup> + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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
200 Show backup details. -
204 Delete request for security group 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 getBackupWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID backupId) + public ApiResponse deleteSecurityGroupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId) throws ApiException { - okhttp3.Call localVarCall = getBackupValidateBeforeCall(projectId, backupId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + okhttp3.Call localVarCall = + deleteSecurityGroupValidateBeforeCall(projectId, region, securityGroupId, null); + return localVarApiClient.execute(localVarCall); } /** - * Get details about a backup. (asynchronously) Get details about a block device backup. + * Delete security group. (asynchronously) Delete a security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -8734,31 +9650,36 @@ public ApiResponse getBackupWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Show backup details. -
204 Delete request for security group 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 getBackupAsync( + public okhttp3.Call deleteSecurityGroupAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getBackupValidateBeforeCall(projectId, backupId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = + deleteSecurityGroupValidateBeforeCall( + projectId, region, securityGroupId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getImage + * Build call for deleteSecurityGroupRule * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -8766,7 +9687,7 @@ public okhttp3.Call getBackupAsync( * * * - * + * * * * @@ -8774,9 +9695,11 @@ public okhttp3.Call getBackupAsync( * *
Response Details
Status Code Description Response Headers
200 Show Image details. -
204 Delete request for security group rule has been accepted. -
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 getImageCall( + public okhttp3.Call deleteSecurityGroupRuleCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -8796,13 +9719,19 @@ public okhttp3.Call getImageCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images/{imageId}" + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "imageId" + "}", - localVarApiClient.escapeString(imageId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())) + .replace( + "{" + "securityGroupRuleId" + "}", + localVarApiClient.escapeString(securityGroupRuleId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -8827,7 +9756,7 @@ public okhttp3.Call getImageCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -8839,39 +9768,55 @@ public okhttp3.Call getImageCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getImageValidateBeforeCall( + private okhttp3.Call deleteSecurityGroupRuleValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId, 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 getImage(Async)"); + "Missing the required parameter 'projectId' when calling deleteSecurityGroupRule(Async)"); } - // verify the required parameter 'imageId' is set - if (imageId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'imageId' when calling getImage(Async)"); + "Missing the required parameter 'region' when calling deleteSecurityGroupRule(Async)"); + } + + // verify the required parameter 'securityGroupId' is set + if (securityGroupId == null) { + throw new ApiException( + "Missing the required parameter 'securityGroupId' when calling deleteSecurityGroupRule(Async)"); + } + + // verify the required parameter 'securityGroupRuleId' is set + if (securityGroupRuleId == null) { + throw new ApiException( + "Missing the required parameter 'securityGroupRuleId' when calling deleteSecurityGroupRule(Async)"); } - return getImageCall(projectId, imageId, _callback); + return deleteSecurityGroupRuleCall( + projectId, region, securityGroupId, securityGroupRuleId, _callback); } /** - * Get details about an image. Get details about a specific Image inside a project. + * Delete security group rule. Delete a security group rule. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @return Image + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -8879,26 +9824,31 @@ private okhttp3.Call getImageValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show Image details. -
204 Delete request for security group rule has been accepted. -
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 Image getImage( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public void deleteSecurityGroupRule( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId) throws ApiException { - ApiResponse localVarResp = getImageWithHttpInfo(projectId, imageId); - return localVarResp.getData(); + deleteSecurityGroupRuleWithHttpInfo( + projectId, region, securityGroupId, securityGroupRuleId); } /** - * Get details about an image. Get details about a specific Image inside a project. + * Delete security group rule. Delete a security group rule. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @return ApiResponse<Image> + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (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 * * * - * + * * * * @@ -8906,20 +9856,25 @@ public Image getImage( * *
Response Details
Status Code Description Response Headers
200 Show Image details. -
204 Delete request for security group rule has been accepted. -
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 getImageWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public ApiResponse deleteSecurityGroupRuleWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId) throws ApiException { - okhttp3.Call localVarCall = getImageValidateBeforeCall(projectId, imageId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + okhttp3.Call localVarCall = + deleteSecurityGroupRuleValidateBeforeCall( + projectId, region, securityGroupId, securityGroupRuleId, null); + return localVarApiClient.execute(localVarCall); } /** - * Get details about an image. (asynchronously) Get details about a specific Image inside a - * project. + * Delete security group rule. (asynchronously) Delete a security group rule. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (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 @@ -8928,7 +9883,7 @@ public ApiResponse getImageWithHttpInfo( * * * - * + * * * * @@ -8936,23 +9891,27 @@ public ApiResponse getImageWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show Image details. -
204 Delete request for security group rule has been accepted. -
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 getImageAsync( + public okhttp3.Call deleteSecurityGroupRuleAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getImageValidateBeforeCall(projectId, imageId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = + deleteSecurityGroupRuleValidateBeforeCall( + projectId, region, securityGroupId, securityGroupRuleId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getImageShare + * Build call for deleteServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -8960,7 +9919,7 @@ public okhttp3.Call getImageAsync( * * * - * + * * * * @@ -8968,9 +9927,10 @@ public okhttp3.Call getImageAsync( * *
Response Details
Status Code Description Response Headers
200 Show Image share details. -
204 Delete request for server accepted. -
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 getImageShareCall( + public okhttp3.Call deleteServerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -8990,13 +9950,16 @@ public okhttp3.Call getImageShareCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images/{imageId}/share" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "imageId" + "}", - localVarApiClient.escapeString(imageId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -9021,7 +9984,7 @@ public okhttp3.Call getImageShareCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -9033,39 +9996,46 @@ public okhttp3.Call getImageShareCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getImageShareValidateBeforeCall( + private okhttp3.Call deleteServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, 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 getImageShare(Async)"); + "Missing the required parameter 'projectId' when calling deleteServer(Async)"); } - // verify the required parameter 'imageId' is set - if (imageId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'imageId' when calling getImageShare(Async)"); + "Missing the required parameter 'region' when calling deleteServer(Async)"); } - return getImageShareCall(projectId, imageId, _callback); - } - - /** - * Get share details of an image. Get share details about an shared image. + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling deleteServer(Async)"); + } + + return deleteServerCall(projectId, region, serverId, _callback); + } + + /** + * Delete a server. Delete a server. Volumes won't be deleted. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @return ImageShare + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -9073,26 +10043,28 @@ private okhttp3.Call getImageShareValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show Image share details. -
204 Delete request for server accepted. -
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 ImageShare getImageShare( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public void deleteServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) throws ApiException { - ApiResponse localVarResp = getImageShareWithHttpInfo(projectId, imageId); - return localVarResp.getData(); + deleteServerWithHttpInfo(projectId, region, serverId); } /** - * Get share details of an image. Get share details about an shared image. + * Delete a server. Delete a server. Volumes won't be deleted. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @return ApiResponse<ImageShare> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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 * * * - * + * * * * @@ -9100,19 +10072,22 @@ public ImageShare getImageShare( * *
Response Details
Status Code Description Response Headers
200 Show Image share details. -
204 Delete request for server accepted. -
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 getImageShareWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public ApiResponse deleteServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) throws ApiException { - okhttp3.Call localVarCall = getImageShareValidateBeforeCall(projectId, imageId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + okhttp3.Call localVarCall = + deleteServerValidateBeforeCall(projectId, region, serverId, null); + return localVarApiClient.execute(localVarCall); } /** - * Get share details of an image. (asynchronously) Get share details about an shared image. + * Delete a server. (asynchronously) Delete a server. Volumes won't be deleted. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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 @@ -9121,7 +10096,7 @@ public ApiResponse getImageShareWithHttpInfo( * * * - * + * * * * @@ -9129,25 +10104,25 @@ public ApiResponse getImageShareWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show Image share details. -
204 Delete request for server accepted. -
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 getImageShareAsync( + public okhttp3.Call deleteServerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getImageShareValidateBeforeCall(projectId, imageId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = + deleteServerValidateBeforeCall(projectId, region, serverId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getImageShareConsumer + * Build call for deleteSnapshot * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image - * share. (required) + * @param region The STACKIT Region of the resources. (required) + * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -9155,7 +10130,7 @@ public okhttp3.Call getImageShareAsync( * * * - * + * * * * @@ -9163,10 +10138,10 @@ public okhttp3.Call getImageShareAsync( * *
Response Details
Status Code Description Response Headers
200 Show Image share consumer details. -
204 Snapshot delete request has been accepted. -
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 getImageShareConsumerCall( + public okhttp3.Call deleteSnapshotCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UUID consumerProjectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID snapshotId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -9186,16 +10161,16 @@ public okhttp3.Call getImageShareConsumerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "imageId" + "}", - localVarApiClient.escapeString(imageId.toString())) + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( - "{" + "consumerProjectId" + "}", - localVarApiClient.escapeString(consumerProjectId.toString())); + "{" + "snapshotId" + "}", + localVarApiClient.escapeString(snapshotId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -9220,7 +10195,7 @@ public okhttp3.Call getImageShareConsumerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -9232,48 +10207,46 @@ public okhttp3.Call getImageShareConsumerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getImageShareConsumerValidateBeforeCall( + private okhttp3.Call deleteSnapshotValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UUID consumerProjectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID snapshotId, 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 getImageShareConsumer(Async)"); + "Missing the required parameter 'projectId' when calling deleteSnapshot(Async)"); } - // verify the required parameter 'imageId' is set - if (imageId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'imageId' when calling getImageShareConsumer(Async)"); + "Missing the required parameter 'region' when calling deleteSnapshot(Async)"); } - // verify the required parameter 'consumerProjectId' is set - if (consumerProjectId == null) { + // verify the required parameter 'snapshotId' is set + if (snapshotId == null) { throw new ApiException( - "Missing the required parameter 'consumerProjectId' when calling getImageShareConsumer(Async)"); + "Missing the required parameter 'snapshotId' when calling deleteSnapshot(Async)"); } - return getImageShareConsumerCall(projectId, imageId, consumerProjectId, _callback); + return deleteSnapshotCall(projectId, region, snapshotId, _callback); } /** - * Get image share consumer. Get details about an image share consumer. + * Delete a snapshot. Delete a snapshot that is part of the project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image - * share. (required) - * @return ImageShareConsumer + * @param region The STACKIT Region of the resources. (required) + * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -9281,31 +10254,28 @@ private okhttp3.Call getImageShareConsumerValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show Image share consumer details. -
204 Snapshot delete request has been accepted. -
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 ImageShareConsumer getImageShareConsumer( + public void deleteSnapshot( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UUID consumerProjectId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID snapshotId) throws ApiException { - ApiResponse localVarResp = - getImageShareConsumerWithHttpInfo(projectId, imageId, consumerProjectId); - return localVarResp.getData(); + deleteSnapshotWithHttpInfo(projectId, region, snapshotId); } /** - * Get image share consumer. Get details about an image share consumer. + * Delete a snapshot. Delete a snapshot that is part of the project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image - * share. (required) - * @return ApiResponse<ImageShareConsumer> + * @param region The STACKIT Region of the resources. (required) + * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (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 * * * - * + * * * * @@ -9313,25 +10283,22 @@ public ImageShareConsumer getImageShareConsumer( * *
Response Details
Status Code Description Response Headers
200 Show Image share consumer details. -
204 Snapshot delete request has been accepted. -
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 getImageShareConsumerWithHttpInfo( + public ApiResponse deleteSnapshotWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UUID consumerProjectId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID snapshotId) throws ApiException { okhttp3.Call localVarCall = - getImageShareConsumerValidateBeforeCall( - projectId, imageId, consumerProjectId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + deleteSnapshotValidateBeforeCall(projectId, region, snapshotId, null); + return localVarApiClient.execute(localVarCall); } /** - * Get image share consumer. (asynchronously) Get details about an image share consumer. + * Delete a snapshot. (asynchronously) Delete a snapshot that is part of the project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image - * share. (required) + * @param region The STACKIT Region of the resources. (required) + * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (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 @@ -9340,7 +10307,7 @@ public ApiResponse getImageShareConsumerWithHttpInfo( * * * - * + * * * * @@ -9348,25 +10315,25 @@ public ApiResponse getImageShareConsumerWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show Image share consumer details. -
204 Snapshot delete request has been accepted. -
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 getImageShareConsumerAsync( + public okhttp3.Call deleteSnapshotAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UUID consumerProjectId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID snapshotId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getImageShareConsumerValidateBeforeCall( - projectId, imageId, consumerProjectId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + deleteSnapshotValidateBeforeCall(projectId, region, snapshotId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getKeyPair + * Build call for deleteVolume * - * @param keypairName The name of an SSH keypair. (required) + * @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 _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -9374,16 +10341,20 @@ public okhttp3.Call getImageShareConsumerAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Show SSH keypair details. -
204 Volume delete request 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 getKeyPairCall( - @javax.annotation.Nonnull String keypairName, final ApiCallback _callback) + public okhttp3.Call deleteVolumeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -9402,10 +10373,16 @@ public okhttp3.Call getKeyPairCall( // create path and map variables String localVarPath = - "/v1/keypairs/{keypairName}" + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" .replace( - "{" + "keypairName" + "}", - localVarApiClient.escapeString(keypairName.toString())); + "{" + "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(); @@ -9430,7 +10407,7 @@ public okhttp3.Call getKeyPairCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -9442,72 +10419,103 @@ public okhttp3.Call getKeyPairCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getKeyPairValidateBeforeCall( - @javax.annotation.Nonnull String keypairName, final ApiCallback _callback) + private okhttp3.Call deleteVolumeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + final ApiCallback _callback) throws ApiException { - // verify the required parameter 'keypairName' is set - if (keypairName == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'keypairName' when calling getKeyPair(Async)"); + "Missing the required parameter 'projectId' when calling deleteVolume(Async)"); } - return getKeyPairCall(keypairName, _callback); + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling deleteVolume(Async)"); + } + + // verify the required parameter 'volumeId' is set + if (volumeId == null) { + throw new ApiException( + "Missing the required parameter 'volumeId' when calling deleteVolume(Async)"); + } + + return deleteVolumeCall(projectId, region, volumeId, _callback); } /** - * Get SSH keypair details. Get details about an SSH keypair. + * Delete a volume. Delete a volume inside a project. The deletion will fail if the volume is + * still in use. * - * @param keypairName The name of an SSH keypair. (required) - * @return Keypair + * @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) * @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 SSH keypair details. -
204 Volume delete request 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 Keypair getKeyPair(@javax.annotation.Nonnull String keypairName) throws ApiException { - ApiResponse localVarResp = getKeyPairWithHttpInfo(keypairName); - return localVarResp.getData(); + public void deleteVolume( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId) + throws ApiException { + deleteVolumeWithHttpInfo(projectId, region, volumeId); } /** - * Get SSH keypair details. Get details about an SSH keypair. + * Delete a volume. Delete a volume inside a project. The deletion will fail if the volume is + * still in use. * - * @param keypairName The name of an SSH keypair. (required) - * @return ApiResponse<Keypair> + * @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) + * @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
200 Show SSH keypair details. -
204 Volume delete request 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 getKeyPairWithHttpInfo(@javax.annotation.Nonnull String keypairName) + public ApiResponse deleteVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId) throws ApiException { - okhttp3.Call localVarCall = getKeyPairValidateBeforeCall(keypairName, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + okhttp3.Call localVarCall = + deleteVolumeValidateBeforeCall(projectId, region, volumeId, null); + return localVarApiClient.execute(localVarCall); } /** - * Get SSH keypair details. (asynchronously) Get details about an SSH keypair. + * Delete a volume. (asynchronously) Delete a volume inside a project. The deletion will fail if + * the volume is still in use. * - * @param keypairName The name of an SSH keypair. (required) + * @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 _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 @@ -9516,29 +10524,34 @@ public ApiResponse getKeyPairWithHttpInfo(@javax.annotation.Nonnull Str * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Show SSH keypair details. -
204 Volume delete request 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 getKeyPairAsync( - @javax.annotation.Nonnull String keypairName, final ApiCallback _callback) + public okhttp3.Call deleteVolumeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getKeyPairValidateBeforeCall(keypairName, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = + deleteVolumeValidateBeforeCall(projectId, region, volumeId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getMachineType + * Build call for getAffinityGroup * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param machineType STACKIT machine type Name. (required) + * @param region The STACKIT Region of the resources. (required) + * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -9546,7 +10559,7 @@ public okhttp3.Call getKeyPairAsync( * * * - * + * * * * @@ -9554,9 +10567,10 @@ public okhttp3.Call getKeyPairAsync( * *
Response Details
Status Code Description Response Headers
200 Show machine type details. -
200 Show affinity group 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 getMachineTypeCall( + public okhttp3.Call getAffinityGroupCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String machineType, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID affinityGroupId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -9576,14 +10590,17 @@ public okhttp3.Call getMachineTypeCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/machine-types/{machineType}" + "/v2/projects/{projectId}/regions/{region}/affinity-groups/{affinityGroupId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "machineType" + "}", - localVarApiClient.escapeString(machineType.toString())); - + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "affinityGroupId" + "}", + localVarApiClient.escapeString(affinityGroupId.toString())); + List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); @@ -9619,39 +10636,47 @@ public okhttp3.Call getMachineTypeCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getMachineTypeValidateBeforeCall( + private okhttp3.Call getAffinityGroupValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String machineType, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID affinityGroupId, 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 getMachineType(Async)"); + "Missing the required parameter 'projectId' when calling getAffinityGroup(Async)"); } - // verify the required parameter 'machineType' is set - if (machineType == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'machineType' when calling getMachineType(Async)"); + "Missing the required parameter 'region' when calling getAffinityGroup(Async)"); + } + + // verify the required parameter 'affinityGroupId' is set + if (affinityGroupId == null) { + throw new ApiException( + "Missing the required parameter 'affinityGroupId' when calling getAffinityGroup(Async)"); } - return getMachineTypeCall(projectId, machineType, _callback); + return getAffinityGroupCall(projectId, region, affinityGroupId, _callback); } /** - * Get details about a machine type. Get details about a specific machine type. + * Get the affinity group. Get the affinity group created in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param machineType STACKIT machine type Name. (required) - * @return MachineType + * @param region The STACKIT Region of the resources. (required) + * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) + * @return AffinityGroup * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -9659,26 +10684,30 @@ private okhttp3.Call getMachineTypeValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show machine type details. -
200 Show affinity group 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 MachineType getMachineType( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String machineType) + public AffinityGroup getAffinityGroup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID affinityGroupId) throws ApiException { - ApiResponse localVarResp = getMachineTypeWithHttpInfo(projectId, machineType); + ApiResponse localVarResp = + getAffinityGroupWithHttpInfo(projectId, region, affinityGroupId); return localVarResp.getData(); } /** - * Get details about a machine type. Get details about a specific machine type. + * Get the affinity group. Get the affinity group created in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param machineType STACKIT machine type Name. (required) - * @return ApiResponse<MachineType> + * @param region The STACKIT Region of the resources. (required) + * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) + * @return ApiResponse<AffinityGroup> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -9686,19 +10715,23 @@ public MachineType getMachineType( * *
Response Details
Status Code Description Response Headers
200 Show machine type details. -
200 Show affinity group 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 ApiResponse getMachineTypeWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String machineType) + public ApiResponse getAffinityGroupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID affinityGroupId) throws ApiException { - okhttp3.Call localVarCall = getMachineTypeValidateBeforeCall(projectId, machineType, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getAffinityGroupValidateBeforeCall(projectId, region, affinityGroupId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get details about a machine type. (asynchronously) Get details about a specific machine type. + * Get the affinity group. (asynchronously) Get the affinity group created in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param machineType STACKIT machine type Name. (required) + * @param region The STACKIT Region of the resources. (required) + * @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -9707,7 +10740,7 @@ public ApiResponse getMachineTypeWithHttpInfo( * * * - * + * * * * @@ -9715,24 +10748,27 @@ public ApiResponse getMachineTypeWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show machine type details. -
200 Show affinity group 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 getMachineTypeAsync( + public okhttp3.Call getAffinityGroupAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String machineType, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID affinityGroupId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getMachineTypeValidateBeforeCall(projectId, machineType, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getAffinityGroupValidateBeforeCall(projectId, region, affinityGroupId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getNetwork + * Build call for getAttachedVolume * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -9740,7 +10776,7 @@ public okhttp3.Call getMachineTypeAsync( * * * - * + * * * * @@ -9748,9 +10784,11 @@ public okhttp3.Call getMachineTypeAsync( * *
Response Details
Status Code Description Response Headers
200 Show network details. -
200 Get details about a volume attachment. -
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 getNetworkCall( + public okhttp3.Call getAttachedVolumeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -9770,13 +10808,19 @@ public okhttp3.Call getNetworkCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/networks/{networkId}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "volumeId" + "}", + localVarApiClient.escapeString(volumeId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -9813,39 +10857,55 @@ public okhttp3.Call getNetworkCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getNetworkValidateBeforeCall( + private okhttp3.Call getAttachedVolumeValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, 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 getNetwork(Async)"); + "Missing the required parameter 'projectId' when calling getAttachedVolume(Async)"); } - // verify the required parameter 'networkId' is set - if (networkId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'networkId' when calling getNetwork(Async)"); + "Missing the required parameter 'region' when calling getAttachedVolume(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling getAttachedVolume(Async)"); + } + + // verify the required parameter 'volumeId' is set + if (volumeId == null) { + throw new ApiException( + "Missing the required parameter 'volumeId' when calling getAttachedVolume(Async)"); } - return getNetworkCall(projectId, networkId, _callback); + return getAttachedVolumeCall(projectId, region, serverId, volumeId, _callback); } /** - * Get network details. Get details about a network of a project. + * Get Volume Attachment details. Get the details of an existing Volume Attachment. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @return Network + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @return VolumeAttachment * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -9853,26 +10913,32 @@ private okhttp3.Call getNetworkValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show network details. -
200 Get details about a volume attachment. -
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 Network getNetwork( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID networkId) + public VolumeAttachment getAttachedVolume( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId) throws ApiException { - ApiResponse localVarResp = getNetworkWithHttpInfo(projectId, networkId); + ApiResponse localVarResp = + getAttachedVolumeWithHttpInfo(projectId, region, serverId, volumeId); return localVarResp.getData(); } /** - * Get network details. Get details about a network of a project. + * Get Volume Attachment details. Get the details of an existing Volume Attachment. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @return ApiResponse<Network> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @return ApiResponse<VolumeAttachment> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -9880,19 +10946,26 @@ public Network getNetwork( * *
Response Details
Status Code Description Response Headers
200 Show network details. -
200 Get details about a volume attachment. -
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 getNetworkWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID networkId) + public ApiResponse getAttachedVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId) throws ApiException { - okhttp3.Call localVarCall = getNetworkValidateBeforeCall(projectId, networkId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getAttachedVolumeValidateBeforeCall(projectId, region, serverId, volumeId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get network details. (asynchronously) Get details about a network of a project. + * Get Volume Attachment details. (asynchronously) Get the details of an existing Volume + * Attachment. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (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 @@ -9901,7 +10974,7 @@ public ApiResponse getNetworkWithHttpInfo( * * * - * + * * * * @@ -9909,23 +10982,28 @@ public ApiResponse getNetworkWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show network details. -
200 Get details about a volume attachment. -
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 getNetworkAsync( + public okhttp3.Call getAttachedVolumeAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getNetworkValidateBeforeCall(projectId, networkId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getAttachedVolumeValidateBeforeCall( + projectId, region, serverId, volumeId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getNetworkArea + * Build call for getBackup * - * @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 backupId The identifier (ID) of a STACKIT Backup. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -9933,7 +11011,7 @@ public okhttp3.Call getNetworkAsync( * * * - * + * * * * @@ -9941,9 +11019,10 @@ public okhttp3.Call getNetworkAsync( * *
Response Details
Status Code Description Response Headers
200 Show network area details. -
200 Show backup 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 getNetworkAreaCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + public okhttp3.Call getBackupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -9963,13 +11042,16 @@ public okhttp3.Call getNetworkAreaCall( // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}" + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "backupId" + "}", + localVarApiClient.escapeString(backupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -10006,39 +11088,47 @@ public okhttp3.Call getNetworkAreaCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getNetworkAreaValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + private okhttp3.Call getBackupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling getNetworkArea(Async)"); + "Missing the required parameter 'projectId' when calling getBackup(Async)"); } - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling getNetworkArea(Async)"); + "Missing the required parameter 'region' when calling getBackup(Async)"); } - return getNetworkAreaCall(organizationId, areaId, _callback); + // verify the required parameter 'backupId' is set + if (backupId == null) { + throw new ApiException( + "Missing the required parameter 'backupId' when calling getBackup(Async)"); + } + + return getBackupCall(projectId, region, backupId, _callback); } /** - * Get details about a network area. Get details about a network area in an organization. + * Get details about a backup. Get details about a block device backup. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @return NetworkArea + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @return Backup * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -10046,26 +11136,29 @@ private okhttp3.Call getNetworkAreaValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show network area details. -
200 Show backup 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 NetworkArea getNetworkArea( - @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + public Backup getBackup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId) throws ApiException { - ApiResponse localVarResp = getNetworkAreaWithHttpInfo(organizationId, areaId); + ApiResponse localVarResp = getBackupWithHttpInfo(projectId, region, backupId); return localVarResp.getData(); } /** - * Get details about a network area. Get details about a network area in an organization. + * Get details about a backup. Get details about a block device backup. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @return ApiResponse<NetworkArea> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @return ApiResponse<Backup> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -10073,20 +11166,22 @@ public NetworkArea getNetworkArea( * *
Response Details
Status Code Description Response Headers
200 Show network area details. -
200 Show backup 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 ApiResponse getNetworkAreaWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + public ApiResponse getBackupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId) throws ApiException { - okhttp3.Call localVarCall = getNetworkAreaValidateBeforeCall(organizationId, areaId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getBackupValidateBeforeCall(projectId, region, backupId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get details about a network area. (asynchronously) Get details about a network area in an - * organization. + * Get details about a backup. (asynchronously) Get details about a block device backup. * - * @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 backupId The identifier (ID) of a STACKIT Backup. (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 @@ -10095,7 +11190,7 @@ public ApiResponse getNetworkAreaWithHttpInfo( * * * - * + * * * * @@ -10103,33 +11198,34 @@ public ApiResponse getNetworkAreaWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show network area details. -
200 Show backup 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 getNetworkAreaAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - final ApiCallback _callback) + public okhttp3.Call getBackupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getNetworkAreaValidateBeforeCall(organizationId, areaId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getBackupValidateBeforeCall(projectId, region, backupId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getNetworkAreaRange + * Build call for getImage * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @param _callback Callback for upload/download progress + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (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 * * * - * + * * * * @@ -10137,10 +11233,10 @@ public okhttp3.Call getNetworkAreaAsync( * *
Response Details
Status Code Description Response Headers
200 Show network range details. -
200 Show Image 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 getNetworkAreaRangeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID networkRangeId, + public okhttp3.Call getImageCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -10160,16 +11256,16 @@ public okhttp3.Call getNetworkAreaRangeCall( // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + "/v2/projects/{projectId}/regions/{region}/images/{imageId}" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( - "{" + "networkRangeId" + "}", - localVarApiClient.escapeString(networkRangeId.toString())); + "{" + "imageId" + "}", + localVarApiClient.escapeString(imageId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -10206,47 +11302,47 @@ public okhttp3.Call getNetworkAreaRangeCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getNetworkAreaRangeValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID networkRangeId, + private okhttp3.Call getImageValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling getNetworkAreaRange(Async)"); + "Missing the required parameter 'projectId' when calling getImage(Async)"); } - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling getNetworkAreaRange(Async)"); + "Missing the required parameter 'region' when calling getImage(Async)"); } - // verify the required parameter 'networkRangeId' is set - if (networkRangeId == null) { + // verify the required parameter 'imageId' is set + if (imageId == null) { throw new ApiException( - "Missing the required parameter 'networkRangeId' when calling getNetworkAreaRange(Async)"); + "Missing the required parameter 'imageId' when calling getImage(Async)"); } - return getNetworkAreaRangeCall(organizationId, areaId, networkRangeId, _callback); + return getImageCall(projectId, region, imageId, _callback); } /** - * Get details about a network range. Get details about a network range in a network area. + * Get details about an image. Get details about a specific Image 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 networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @return NetworkRange + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @return Image * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -10254,30 +11350,29 @@ private okhttp3.Call getNetworkAreaRangeValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show network range details. -
200 Show Image 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 NetworkRange getNetworkAreaRange( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID networkRangeId) + public Image getImage( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId) throws ApiException { - ApiResponse localVarResp = - getNetworkAreaRangeWithHttpInfo(organizationId, areaId, networkRangeId); + ApiResponse localVarResp = getImageWithHttpInfo(projectId, region, imageId); return localVarResp.getData(); } /** - * Get details about a network range. Get details about a network range in a network area. + * Get details about an image. Get details about a specific Image 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 networkRangeId The identifier (ID) of a STACKIT Network Range. (required) - * @return ApiResponse<NetworkRange> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @return ApiResponse<Image> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -10285,24 +11380,23 @@ public NetworkRange getNetworkAreaRange( * *
Response Details
Status Code Description Response Headers
200 Show network range details. -
200 Show Image 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 ApiResponse getNetworkAreaRangeWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID networkRangeId) + public ApiResponse getImageWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId) throws ApiException { - okhttp3.Call localVarCall = - getNetworkAreaRangeValidateBeforeCall(organizationId, areaId, networkRangeId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getImageValidateBeforeCall(projectId, region, imageId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get details about a network range. (asynchronously) Get details about a network range in a - * network area. + * Get details about an image. (asynchronously) Get details about a specific Image 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 networkRangeId The identifier (ID) of a STACKIT Network Range. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (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 @@ -10311,7 +11405,7 @@ public ApiResponse getNetworkAreaRangeWithHttpInfo( * * * - * + * * * * @@ -10319,27 +11413,26 @@ public ApiResponse getNetworkAreaRangeWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show network range details. -
200 Show Image 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 getNetworkAreaRangeAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID networkRangeId, - final ApiCallback _callback) + public okhttp3.Call getImageAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getNetworkAreaRangeValidateBeforeCall( - organizationId, areaId, networkRangeId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getImageValidateBeforeCall(projectId, region, imageId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getNetworkAreaRoute + * Build call for getImageShare * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -10347,7 +11440,7 @@ public okhttp3.Call getNetworkAreaRangeAsync( * * * - * + * * * * @@ -10355,10 +11448,10 @@ public okhttp3.Call getNetworkAreaRangeAsync( * *
Response Details
Status Code Description Response Headers
200 Show route details. -
200 Show Image share 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 getNetworkAreaRouteCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId, + public okhttp3.Call getImageShareCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -10378,16 +11471,16 @@ public okhttp3.Call getNetworkAreaRouteCall( // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( - "{" + "routeId" + "}", - localVarApiClient.escapeString(routeId.toString())); + "{" + "imageId" + "}", + localVarApiClient.escapeString(imageId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -10424,48 +11517,47 @@ public okhttp3.Call getNetworkAreaRouteCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getNetworkAreaRouteValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId, + private okhttp3.Call getImageShareValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling getNetworkAreaRoute(Async)"); + "Missing the required parameter 'projectId' when calling getImageShare(Async)"); } - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling getNetworkAreaRoute(Async)"); + "Missing the required parameter 'region' when calling getImageShare(Async)"); } - // verify the required parameter 'routeId' is set - if (routeId == null) { + // verify the required parameter 'imageId' is set + if (imageId == null) { throw new ApiException( - "Missing the required parameter 'routeId' when calling getNetworkAreaRoute(Async)"); + "Missing the required parameter 'imageId' when calling getImageShare(Async)"); } - return getNetworkAreaRouteCall(organizationId, areaId, routeId, _callback); + return getImageShareCall(projectId, region, imageId, _callback); } /** - * Get details about a network route. Get details about a network route defined in a network - * area. + * Get share details of an image. Get share details about an shared image. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @return Route + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @return ImageShare * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -10473,31 +11565,30 @@ private okhttp3.Call getNetworkAreaRouteValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show route details. -
200 Show Image share 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 getNetworkAreaRoute( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId) + public ImageShare getImageShare( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId) throws ApiException { - ApiResponse localVarResp = - getNetworkAreaRouteWithHttpInfo(organizationId, areaId, routeId); + ApiResponse localVarResp = + getImageShareWithHttpInfo(projectId, region, imageId); return localVarResp.getData(); } /** - * Get details about a network route. Get details about a network route defined in a network - * area. + * Get share details of an image. Get share details about an shared image. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @return ApiResponse<Route> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @return ApiResponse<ImageShare> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -10505,24 +11596,23 @@ public Route getNetworkAreaRoute( * *
Response Details
Status Code Description Response Headers
200 Show route details. -
200 Show Image share 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 ApiResponse getNetworkAreaRouteWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId) + public ApiResponse getImageShareWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId) throws ApiException { okhttp3.Call localVarCall = - getNetworkAreaRouteValidateBeforeCall(organizationId, areaId, routeId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + getImageShareValidateBeforeCall(projectId, region, imageId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get details about a network route. (asynchronously) Get details about a network route defined - * in a network area. + * Get share details of an image. (asynchronously) Get share details about an shared image. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (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 @@ -10531,7 +11621,7 @@ public ApiResponse getNetworkAreaRouteWithHttpInfo( * * * - * + * * * * @@ -10539,26 +11629,28 @@ public ApiResponse getNetworkAreaRouteWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show route details. -
200 Show Image share 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 getNetworkAreaRouteAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId, - final ApiCallback _callback) + public okhttp3.Call getImageShareAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getNetworkAreaRouteValidateBeforeCall(organizationId, areaId, routeId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getImageShareValidateBeforeCall(projectId, region, imageId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getNic + * Build call for getImageShareConsumer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image + * share. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -10566,7 +11658,7 @@ public okhttp3.Call getNetworkAreaRouteAsync( * * * - * + * * * * @@ -10574,10 +11666,11 @@ public okhttp3.Call getNetworkAreaRouteAsync( * *
Response Details
Status Code Description Response Headers
200 Show network interface details. -
200 Show Image share consumer 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 getNicCall( + public okhttp3.Call getImageShareConsumerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -10597,16 +11690,19 @@ public okhttp3.Call getNicCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share/{consumerProjectId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())) + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( - "{" + "nicId" + "}", - localVarApiClient.escapeString(nicId.toString())); + "{" + "imageId" + "}", + localVarApiClient.escapeString(imageId.toString())) + .replace( + "{" + "consumerProjectId" + "}", + localVarApiClient.escapeString(consumerProjectId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -10643,48 +11739,56 @@ public okhttp3.Call getNicCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getNicValidateBeforeCall( + private okhttp3.Call getImageShareConsumerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId, 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 getNic(Async)"); + "Missing the required parameter 'projectId' when calling getImageShareConsumer(Async)"); } - // verify the required parameter 'networkId' is set - if (networkId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'networkId' when calling getNic(Async)"); + "Missing the required parameter 'region' when calling getImageShareConsumer(Async)"); } - // verify the required parameter 'nicId' is set - if (nicId == null) { + // verify the required parameter 'imageId' is set + if (imageId == null) { throw new ApiException( - "Missing the required parameter 'nicId' when calling getNic(Async)"); + "Missing the required parameter 'imageId' when calling getImageShareConsumer(Async)"); } - return getNicCall(projectId, networkId, nicId, _callback); - } + // verify the required parameter 'consumerProjectId' is set + if (consumerProjectId == null) { + throw new ApiException( + "Missing the required parameter 'consumerProjectId' when calling getImageShareConsumer(Async)"); + } + + return getImageShareConsumerCall(projectId, region, imageId, consumerProjectId, _callback); + } /** - * Get details about a network interface of a network. Get details about a network interface - * inside a network. + * Get image share consumer. Get details about an image share consumer. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (required) - * @return NIC + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image + * share. (required) + * @return ImageShareConsumer * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -10692,30 +11796,33 @@ private okhttp3.Call getNicValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show network interface details. -
200 Show Image share consumer 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 NIC getNic( + public ImageShareConsumer getImageShareConsumer( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId) throws ApiException { - ApiResponse localVarResp = getNicWithHttpInfo(projectId, networkId, nicId); + ApiResponse localVarResp = + getImageShareConsumerWithHttpInfo(projectId, region, imageId, consumerProjectId); return localVarResp.getData(); } /** - * Get details about a network interface of a network. Get details about a network interface - * inside a network. + * Get image share consumer. Get details about an image share consumer. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (required) - * @return ApiResponse<NIC> + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image + * share. (required) + * @return ApiResponse<ImageShareConsumer> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -10723,23 +11830,27 @@ public NIC getNic( * *
Response Details
Status Code Description Response Headers
200 Show network interface details. -
200 Show Image share consumer 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 ApiResponse getNicWithHttpInfo( + public ApiResponse getImageShareConsumerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId) throws ApiException { - okhttp3.Call localVarCall = getNicValidateBeforeCall(projectId, networkId, nicId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getImageShareConsumerValidateBeforeCall( + projectId, region, imageId, consumerProjectId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get details about a network interface of a network. (asynchronously) Get details about a - * network interface inside a network. + * Get image share consumer. (asynchronously) Get details about an image share consumer. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image + * share. (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 @@ -10748,7 +11859,7 @@ public ApiResponse getNicWithHttpInfo( * * * - * + * * * * @@ -10756,25 +11867,26 @@ public ApiResponse getNicWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show network interface details. -
200 Show Image share consumer 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 getNicAsync( + public okhttp3.Call getImageShareConsumerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getNicValidateBeforeCall(projectId, networkId, nicId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getImageShareConsumerValidateBeforeCall( + projectId, region, imageId, consumerProjectId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getOrganizationRequest + * Build call for getKeyPair * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param requestId The identifier (ID) of a STACKIT Request. (required) + * @param keypairName The name of an SSH keypair. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -10782,7 +11894,7 @@ public okhttp3.Call getNicAsync( * * * - * + * * * * @@ -10790,10 +11902,8 @@ public okhttp3.Call getNicAsync( * *
Response Details
Status Code Description Response Headers
200 Show organization request details. -
200 Show SSH keypair 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 getOrganizationRequestCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull String requestId, - final ApiCallback _callback) + public okhttp3.Call getKeyPairCall( + @javax.annotation.Nonnull String keypairName, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -10812,13 +11922,10 @@ public okhttp3.Call getOrganizationRequestCall( // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/requests/{requestId}" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "/v2/keypairs/{keypairName}" .replace( - "{" + "requestId" + "}", - localVarApiClient.escapeString(requestId.toString())); + "{" + "keypairName" + "}", + localVarApiClient.escapeString(keypairName.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -10855,40 +11962,30 @@ public okhttp3.Call getOrganizationRequestCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getOrganizationRequestValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull String requestId, - final ApiCallback _callback) + private okhttp3.Call getKeyPairValidateBeforeCall( + @javax.annotation.Nonnull String keypairName, 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 getOrganizationRequest(Async)"); - } - - // verify the required parameter 'requestId' is set - if (requestId == null) { + // verify the required parameter 'keypairName' is set + if (keypairName == null) { throw new ApiException( - "Missing the required parameter 'requestId' when calling getOrganizationRequest(Async)"); + "Missing the required parameter 'keypairName' when calling getKeyPair(Async)"); } - return getOrganizationRequestCall(organizationId, requestId, _callback); + return getKeyPairCall(keypairName, _callback); } /** - * Lookup an organization request ID. Lookup an organization request ID from a previous request. - * This allows to find resource IDs of resources generated during a organization request. + * Get SSH keypair details. Get details about an SSH keypair. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param requestId The identifier (ID) of a STACKIT Request. (required) - * @return Request + * @param keypairName The name of an SSH keypair. (required) + * @return Keypair * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -10896,29 +11993,23 @@ private okhttp3.Call getOrganizationRequestValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show organization request details. -
200 Show SSH keypair 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 Request getOrganizationRequest( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull String requestId) - throws ApiException { - ApiResponse localVarResp = - getOrganizationRequestWithHttpInfo(organizationId, requestId); + public Keypair getKeyPair(@javax.annotation.Nonnull String keypairName) throws ApiException { + ApiResponse localVarResp = getKeyPairWithHttpInfo(keypairName); return localVarResp.getData(); } /** - * Lookup an organization request ID. Lookup an organization request ID from a previous request. - * This allows to find resource IDs of resources generated during a organization request. + * Get SSH keypair details. Get details about an SSH keypair. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param requestId The identifier (ID) of a STACKIT Request. (required) - * @return ApiResponse<Request> + * @param keypairName The name of an SSH keypair. (required) + * @return ApiResponse<Keypair> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -10926,23 +12017,17 @@ public Request getOrganizationRequest( * *
Response Details
Status Code Description Response Headers
200 Show organization request details. -
200 Show SSH keypair 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 ApiResponse getOrganizationRequestWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull String requestId) + public ApiResponse getKeyPairWithHttpInfo(@javax.annotation.Nonnull String keypairName) throws ApiException { - okhttp3.Call localVarCall = - getOrganizationRequestValidateBeforeCall(organizationId, requestId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getKeyPairValidateBeforeCall(keypairName, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Lookup an organization request ID. (asynchronously) Lookup an organization request ID from a - * previous request. This allows to find resource IDs of resources generated during a - * organization request. + * Get SSH keypair details. (asynchronously) Get details about an SSH keypair. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param requestId The identifier (ID) of a STACKIT Request. (required) + * @param keypairName The name of an SSH keypair. (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 @@ -10951,7 +12036,7 @@ public ApiResponse getOrganizationRequestWithHttpInfo( * * * - * + * * * * @@ -10959,23 +12044,22 @@ public ApiResponse getOrganizationRequestWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show organization request details. -
200 Show SSH keypair 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 getOrganizationRequestAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull String requestId, - final ApiCallback _callback) + public okhttp3.Call getKeyPairAsync( + @javax.annotation.Nonnull String keypairName, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = - getOrganizationRequestValidateBeforeCall(organizationId, requestId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getKeyPairValidateBeforeCall(keypairName, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getProjectDetails + * Build call for getMachineType * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param machineType STACKIT machine type Name. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -10983,7 +12067,7 @@ public okhttp3.Call getOrganizationRequestAsync( * * * - * + * * * * @@ -10991,8 +12075,11 @@ public okhttp3.Call getOrganizationRequestAsync( * *
Response Details
Status Code Description Response Headers
200 Show project details. -
200 Show machine type 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 getProjectDetailsCall( - @javax.annotation.Nonnull UUID projectId, final ApiCallback _callback) + public okhttp3.Call getMachineTypeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String machineType, + final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -11011,10 +12098,16 @@ public okhttp3.Call getProjectDetailsCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}" + "/v2/projects/{projectId}/regions/{region}/machine-types/{machineType}" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "machineType" + "}", + localVarApiClient.escapeString(machineType.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -11051,30 +12144,47 @@ public okhttp3.Call getProjectDetailsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getProjectDetailsValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, final ApiCallback _callback) + private okhttp3.Call getMachineTypeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String machineType, + 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 getProjectDetails(Async)"); + "Missing the required parameter 'projectId' when calling getMachineType(Async)"); } - return getProjectDetailsCall(projectId, _callback); + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getMachineType(Async)"); + } + + // verify the required parameter 'machineType' is set + if (machineType == null) { + throw new ApiException( + "Missing the required parameter 'machineType' when calling getMachineType(Async)"); + } + + return getMachineTypeCall(projectId, region, machineType, _callback); } /** - * Get project details. Get details about a STACKIT project. + * Get details about a machine type. Get details about a specific machine type. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @return Project + * @param region The STACKIT Region of the resources. (required) + * @param machineType STACKIT machine type Name. (required) + * @return MachineType * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -11082,23 +12192,30 @@ private okhttp3.Call getProjectDetailsValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show project details. -
200 Show machine type 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 Project getProjectDetails(@javax.annotation.Nonnull UUID projectId) throws ApiException { - ApiResponse localVarResp = getProjectDetailsWithHttpInfo(projectId); + public MachineType getMachineType( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String machineType) + throws ApiException { + ApiResponse localVarResp = + getMachineTypeWithHttpInfo(projectId, region, machineType); return localVarResp.getData(); } /** - * Get project details. Get details about a STACKIT project. + * Get details about a machine type. Get details about a specific machine type. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @return ApiResponse<Project> + * @param region The STACKIT Region of the resources. (required) + * @param machineType STACKIT machine type Name. (required) + * @return ApiResponse<MachineType> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -11106,17 +12223,23 @@ public Project getProjectDetails(@javax.annotation.Nonnull UUID projectId) throw * *
Response Details
Status Code Description Response Headers
200 Show project details. -
200 Show machine type 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 ApiResponse getProjectDetailsWithHttpInfo( - @javax.annotation.Nonnull UUID projectId) throws ApiException { - okhttp3.Call localVarCall = getProjectDetailsValidateBeforeCall(projectId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse getMachineTypeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String machineType) + throws ApiException { + okhttp3.Call localVarCall = + getMachineTypeValidateBeforeCall(projectId, region, machineType, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get project details. (asynchronously) Get details about a STACKIT project. + * Get details about a machine type. (asynchronously) Get details about a specific machine type. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param machineType STACKIT machine type Name. (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 @@ -11125,7 +12248,7 @@ public ApiResponse getProjectDetailsWithHttpInfo( * * * - * + * * * * @@ -11133,21 +12256,26 @@ public ApiResponse getProjectDetailsWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show project details. -
200 Show machine type 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 getProjectDetailsAsync( - @javax.annotation.Nonnull UUID projectId, final ApiCallback _callback) + public okhttp3.Call getMachineTypeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String machineType, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getProjectDetailsValidateBeforeCall(projectId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getMachineTypeValidateBeforeCall(projectId, region, machineType, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getProjectNIC + * Build call for getNetwork * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param nicId The identifier (ID) of a network interface. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -11155,7 +12283,7 @@ public okhttp3.Call getProjectDetailsAsync( * * * - * + * * * * @@ -11163,9 +12291,10 @@ public okhttp3.Call getProjectDetailsAsync( * *
Response Details
Status Code Description Response Headers
200 Show details of network interface. -
200 Show network 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 getProjectNICCall( + public okhttp3.Call getNetworkCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -11185,13 +12314,16 @@ public okhttp3.Call getProjectNICCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/nics/{nicId}" + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "nicId" + "}", - localVarApiClient.escapeString(nicId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -11228,40 +12360,47 @@ public okhttp3.Call getProjectNICCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getProjectNICValidateBeforeCall( + private okhttp3.Call getNetworkValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, 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 getProjectNIC(Async)"); + "Missing the required parameter 'projectId' when calling getNetwork(Async)"); } - // verify the required parameter 'nicId' is set - if (nicId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'nicId' when calling getProjectNIC(Async)"); + "Missing the required parameter 'region' when calling getNetwork(Async)"); } - return getProjectNICCall(projectId, nicId, _callback); + // verify the required parameter 'networkId' is set + if (networkId == null) { + throw new ApiException( + "Missing the required parameter 'networkId' when calling getNetwork(Async)"); + } + + return getNetworkCall(projectId, region, networkId, _callback); } /** - * Get details about a network interface of a project. Get details about a network interface - * inside a project. + * Get network details. Get details about a network of a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param nicId The identifier (ID) of a network interface. (required) - * @return NIC + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @return Network * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -11269,27 +12408,29 @@ private okhttp3.Call getProjectNICValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show details of network interface. -
200 Show network 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 NIC getProjectNIC( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID nicId) + public Network getNetwork( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId) throws ApiException { - ApiResponse localVarResp = getProjectNICWithHttpInfo(projectId, nicId); + ApiResponse localVarResp = getNetworkWithHttpInfo(projectId, region, networkId); return localVarResp.getData(); } /** - * Get details about a network interface of a project. Get details about a network interface - * inside a project. + * Get network details. Get details about a network of a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param nicId The identifier (ID) of a network interface. (required) - * @return ApiResponse<NIC> + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @return ApiResponse<Network> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -11297,20 +12438,23 @@ public NIC getProjectNIC( * *
Response Details
Status Code Description Response Headers
200 Show details of network interface. -
200 Show network 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 ApiResponse getProjectNICWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID nicId) + public ApiResponse getNetworkWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId) throws ApiException { - okhttp3.Call localVarCall = getProjectNICValidateBeforeCall(projectId, nicId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getNetworkValidateBeforeCall(projectId, region, networkId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get details about a network interface of a project. (asynchronously) Get details about a - * network interface inside a project. + * Get network details. (asynchronously) Get details about a network of a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param nicId The identifier (ID) of a network interface. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (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 @@ -11319,7 +12463,7 @@ public ApiResponse getProjectNICWithHttpInfo( * * * - * + * * * * @@ -11327,23 +12471,25 @@ public ApiResponse getProjectNICWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show details of network interface. -
200 Show network 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 getProjectNICAsync( + public okhttp3.Call getNetworkAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID nicId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getProjectNICValidateBeforeCall(projectId, nicId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getNetworkValidateBeforeCall(projectId, region, networkId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getProjectRequest + * Build call for getNetworkArea * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param requestId The identifier (ID) of a STACKIT Request. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -11351,7 +12497,7 @@ public okhttp3.Call getProjectNICAsync( * * * - * + * * * * @@ -11359,9 +12505,9 @@ public okhttp3.Call getProjectNICAsync( * *
Response Details
Status Code Description Response Headers
200 Show project request details. -
200 Show network area 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 getProjectRequestCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String requestId, + public okhttp3.Call getNetworkAreaCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -11381,13 +12527,13 @@ public okhttp3.Call getProjectRequestCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/requests/{requestId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "requestId" + "}", - localVarApiClient.escapeString(requestId.toString())); + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -11424,40 +12570,39 @@ public okhttp3.Call getProjectRequestCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getProjectRequestValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String requestId, + private okhttp3.Call getNetworkAreaValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling getProjectRequest(Async)"); + "Missing the required parameter 'organizationId' when calling getNetworkArea(Async)"); } - // verify the required parameter 'requestId' is set - if (requestId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'requestId' when calling getProjectRequest(Async)"); + "Missing the required parameter 'areaId' when calling getNetworkArea(Async)"); } - return getProjectRequestCall(projectId, requestId, _callback); + return getNetworkAreaCall(organizationId, areaId, _callback); } /** - * Lookup a project request ID. Lookup a project request ID from a previous request. This allows - * to find resource IDs of resources generated during a projects request. + * Get details about a network area. Get details about a network area in an organization. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param requestId The identifier (ID) of a STACKIT Request. (required) - * @return Request + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @return NetworkArea * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -11465,27 +12610,26 @@ private okhttp3.Call getProjectRequestValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show project request details. -
200 Show network area 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 Request getProjectRequest( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String requestId) + public NetworkArea getNetworkArea( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) throws ApiException { - ApiResponse localVarResp = getProjectRequestWithHttpInfo(projectId, requestId); + ApiResponse localVarResp = getNetworkAreaWithHttpInfo(organizationId, areaId); return localVarResp.getData(); } /** - * Lookup a project request ID. Lookup a project request ID from a previous request. This allows - * to find resource IDs of resources generated during a projects request. + * Get details about a network area. Get details about a network area in an organization. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param requestId The identifier (ID) of a STACKIT Request. (required) - * @return ApiResponse<Request> + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @return ApiResponse<NetworkArea> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -11493,20 +12637,20 @@ public Request getProjectRequest( * *
Response Details
Status Code Description Response Headers
200 Show project request details. -
200 Show network area 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 ApiResponse getProjectRequestWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String requestId) + public ApiResponse getNetworkAreaWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) throws ApiException { - okhttp3.Call localVarCall = getProjectRequestValidateBeforeCall(projectId, requestId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getNetworkAreaValidateBeforeCall(organizationId, areaId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Lookup a project request ID. (asynchronously) Lookup a project request ID from a previous - * request. This allows to find resource IDs of resources generated during a projects request. + * Get details about a network area. (asynchronously) Get details about a network area in an + * organization. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param requestId The identifier (ID) of a STACKIT Request. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (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 @@ -11515,7 +12659,7 @@ public ApiResponse getProjectRequestWithHttpInfo( * * * - * + * * * * @@ -11523,24 +12667,26 @@ public ApiResponse getProjectRequestWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show project request details. -
200 Show network area 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 getProjectRequestAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String requestId, - final ApiCallback _callback) + public okhttp3.Call getNetworkAreaAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getProjectRequestValidateBeforeCall(projectId, requestId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getNetworkAreaValidateBeforeCall(organizationId, areaId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getPublicIP + * Build call for getNetworkAreaRange * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (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 networkRangeId The identifier (ID) of a STACKIT Network Range. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -11548,7 +12694,7 @@ public okhttp3.Call getProjectRequestAsync( * * * - * + * * * * @@ -11556,9 +12702,11 @@ public okhttp3.Call getProjectRequestAsync( * *
Response Details
Status Code Description Response Headers
200 Show public IP details. -
200 Show network range 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 getPublicIPCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID publicIpId, + public okhttp3.Call getNetworkAreaRangeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkRangeId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -11578,13 +12726,19 @@ public okhttp3.Call getPublicIPCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/public-ips/{publicIpId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges/{networkRangeId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "publicIpId" + "}", - localVarApiClient.escapeString(publicIpId.toString())); + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "networkRangeId" + "}", + localVarApiClient.escapeString(networkRangeId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -11621,39 +12775,55 @@ public okhttp3.Call getPublicIPCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getPublicIPValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID publicIpId, + private okhttp3.Call getNetworkAreaRangeValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkRangeId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling getPublicIP(Async)"); + "Missing the required parameter 'organizationId' when calling getNetworkAreaRange(Async)"); } - // verify the required parameter 'publicIpId' is set - if (publicIpId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'publicIpId' when calling getPublicIP(Async)"); + "Missing the required parameter 'areaId' when calling getNetworkAreaRange(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getNetworkAreaRange(Async)"); + } + + // verify the required parameter 'networkRangeId' is set + if (networkRangeId == null) { + throw new ApiException( + "Missing the required parameter 'networkRangeId' when calling getNetworkAreaRange(Async)"); } - return getPublicIPCall(projectId, publicIpId, _callback); + return getNetworkAreaRangeCall(organizationId, areaId, region, networkRangeId, _callback); } /** - * Get details about a public IP. Get details about a public IP inside a project. + * Get details about a network range. Get details about a network range in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (required) - * @return PublicIp + * @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 networkRangeId The identifier (ID) of a STACKIT Network Range. (required) + * @return NetworkRange * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -11661,26 +12831,32 @@ private okhttp3.Call getPublicIPValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show public IP details. -
200 Show network range 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 PublicIp getPublicIP( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID publicIpId) + public NetworkRange getNetworkAreaRange( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkRangeId) throws ApiException { - ApiResponse localVarResp = getPublicIPWithHttpInfo(projectId, publicIpId); + ApiResponse localVarResp = + getNetworkAreaRangeWithHttpInfo(organizationId, areaId, region, networkRangeId); return localVarResp.getData(); } /** - * Get details about a public IP. Get details about a public IP inside a project. + * Get details about a network range. Get details about a network range in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (required) - * @return ApiResponse<PublicIp> + * @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 networkRangeId The identifier (ID) of a STACKIT Network Range. (required) + * @return ApiResponse<NetworkRange> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -11688,20 +12864,27 @@ public PublicIp getPublicIP( * *
Response Details
Status Code Description Response Headers
200 Show public IP details. -
200 Show network range 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 ApiResponse getPublicIPWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID publicIpId) + public ApiResponse getNetworkAreaRangeWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkRangeId) throws ApiException { - okhttp3.Call localVarCall = getPublicIPValidateBeforeCall(projectId, publicIpId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getNetworkAreaRangeValidateBeforeCall( + organizationId, areaId, region, networkRangeId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get details about a public IP. (asynchronously) Get details about a public IP inside a - * project. + * Get details about a network range. (asynchronously) Get details about a network range in a + * network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (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 networkRangeId The identifier (ID) of a STACKIT Network Range. (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 @@ -11710,7 +12893,7 @@ public ApiResponse getPublicIPWithHttpInfo( * * * - * + * * * * @@ -11718,23 +12901,28 @@ public ApiResponse getPublicIPWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show public IP details. -
200 Show network range 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 getPublicIPAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID publicIpId, - final ApiCallback _callback) + public okhttp3.Call getNetworkAreaRangeAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkRangeId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getPublicIPValidateBeforeCall(projectId, publicIpId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getNetworkAreaRangeValidateBeforeCall( + organizationId, areaId, region, networkRangeId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getSecurityGroup + * Build call for getNetworkAreaRegion * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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 _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -11742,7 +12930,7 @@ public okhttp3.Call getPublicIPAsync( * * * - * + * * * * @@ -11750,9 +12938,10 @@ public okhttp3.Call getPublicIPAsync( * *
Response Details
Status Code Description Response Headers
200 Show security group details. -
200 Show configured region 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 getSecurityGroupCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, + public okhttp3.Call getNetworkAreaRegionCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -11772,13 +12961,16 @@ public okhttp3.Call getSecurityGroupCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/security-groups/{securityGroupId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "securityGroupId" + "}", - localVarApiClient.escapeString(securityGroupId.toString())); + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -11815,39 +13007,48 @@ public okhttp3.Call getSecurityGroupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getSecurityGroupValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, + private okhttp3.Call getNetworkAreaRegionValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling getSecurityGroup(Async)"); + "Missing the required parameter 'organizationId' when calling getNetworkAreaRegion(Async)"); } - // verify the required parameter 'securityGroupId' is set - if (securityGroupId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'securityGroupId' when calling getSecurityGroup(Async)"); + "Missing the required parameter 'areaId' when calling getNetworkAreaRegion(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getNetworkAreaRegion(Async)"); } - return getSecurityGroupCall(projectId, securityGroupId, _callback); + return getNetworkAreaRegionCall(organizationId, areaId, region, _callback); } /** - * Get security group details. Get details about a security group of a project. + * Get details about a configured region. Get details about a configured region in a network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @return SecurityGroup + * @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) + * @return RegionalArea * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -11855,28 +13056,31 @@ private okhttp3.Call getSecurityGroupValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show security group details. -
200 Show configured region 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 SecurityGroup getSecurityGroup( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId) + public RegionalArea getNetworkAreaRegion( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region) throws ApiException { - ApiResponse localVarResp = - getSecurityGroupWithHttpInfo(projectId, securityGroupId); + ApiResponse localVarResp = + getNetworkAreaRegionWithHttpInfo(organizationId, areaId, region); return localVarResp.getData(); } /** - * Get security group details. Get details about a security group of a project. + * Get details about a configured region. Get details about a configured region in a network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @return ApiResponse<SecurityGroup> + * @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) + * @return ApiResponse<RegionalArea> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -11884,21 +13088,24 @@ public SecurityGroup getSecurityGroup( * *
Response Details
Status Code Description Response Headers
200 Show security group details. -
200 Show configured region 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 ApiResponse getSecurityGroupWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId) + public ApiResponse getNetworkAreaRegionWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region) throws ApiException { okhttp3.Call localVarCall = - getSecurityGroupValidateBeforeCall(projectId, securityGroupId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + getNetworkAreaRegionValidateBeforeCall(organizationId, areaId, region, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get security group details. (asynchronously) Get details about a security group of a project. + * Get details about a configured region. (asynchronously) Get details about a configured region + * in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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 _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 @@ -11907,7 +13114,7 @@ public ApiResponse getSecurityGroupWithHttpInfo( * * * - * + * * * * @@ -11915,25 +13122,27 @@ public ApiResponse getSecurityGroupWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show security group details. -
200 Show configured region 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 getSecurityGroupAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - final ApiCallback _callback) + public okhttp3.Call getNetworkAreaRegionAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getSecurityGroupValidateBeforeCall(projectId, securityGroupId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getNetworkAreaRegionValidateBeforeCall(organizationId, areaId, region, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getSecurityGroupRule + * Build call for getNetworkAreaRoute * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (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 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 @@ -11941,7 +13150,7 @@ public okhttp3.Call getSecurityGroupAsync( * * * - * + * * * * @@ -11949,10 +13158,11 @@ public okhttp3.Call getSecurityGroupAsync( * *
Response Details
Status Code Description Response Headers
200 Show security group rule details. -
200 Show route 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 getSecurityGroupRuleCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull UUID securityGroupRuleId, + public okhttp3.Call getNetworkAreaRouteCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -11972,16 +13182,19 @@ public okhttp3.Call getSecurityGroupRuleCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "securityGroupId" + "}", - localVarApiClient.escapeString(securityGroupId.toString())) + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) .replace( - "{" + "securityGroupRuleId" + "}", - localVarApiClient.escapeString(securityGroupRuleId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "routeId" + "}", + localVarApiClient.escapeString(routeId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -12018,47 +13231,56 @@ public okhttp3.Call getSecurityGroupRuleCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getSecurityGroupRuleValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull UUID securityGroupRuleId, + private okhttp3.Call getNetworkAreaRouteValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling getSecurityGroupRule(Async)"); + "Missing the required parameter 'organizationId' when calling getNetworkAreaRoute(Async)"); } - // verify the required parameter 'securityGroupId' is set - if (securityGroupId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'securityGroupId' when calling getSecurityGroupRule(Async)"); + "Missing the required parameter 'areaId' when calling getNetworkAreaRoute(Async)"); } - // verify the required parameter 'securityGroupRuleId' is set - if (securityGroupRuleId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'securityGroupRuleId' when calling getSecurityGroupRule(Async)"); + "Missing the required parameter 'region' when calling getNetworkAreaRoute(Async)"); + } + + // verify the required parameter 'routeId' is set + if (routeId == null) { + throw new ApiException( + "Missing the required parameter 'routeId' when calling getNetworkAreaRoute(Async)"); } - return getSecurityGroupRuleCall(projectId, securityGroupId, securityGroupRuleId, _callback); + return getNetworkAreaRouteCall(organizationId, areaId, region, routeId, _callback); } /** - * Get security group rule details. Get details about a security group rule of a project. + * Get details about a network route. Get details about a network route defined in a network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (required) - * @return SecurityGroupRule + * @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 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 * * * - * + * * * * @@ -12066,30 +13288,33 @@ private okhttp3.Call getSecurityGroupRuleValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show security group rule details. -
200 Show route 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 SecurityGroupRule getSecurityGroupRule( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull UUID securityGroupRuleId) + public Route getNetworkAreaRoute( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId) throws ApiException { - ApiResponse localVarResp = - getSecurityGroupRuleWithHttpInfo(projectId, securityGroupId, securityGroupRuleId); + ApiResponse localVarResp = + getNetworkAreaRouteWithHttpInfo(organizationId, areaId, region, routeId); return localVarResp.getData(); } /** - * Get security group rule details. Get details about a security group rule of a project. + * Get details about a network route. Get details about a network route defined in a network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (required) - * @return ApiResponse<SecurityGroupRule> + * @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 routeId The identifier (ID) of a STACKIT Route. (required) + * @return ApiResponse<Route> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -12097,25 +13322,27 @@ public SecurityGroupRule getSecurityGroupRule( * *
Response Details
Status Code Description Response Headers
200 Show security group rule details. -
200 Show route 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 ApiResponse getSecurityGroupRuleWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull UUID securityGroupRuleId) + public ApiResponse getNetworkAreaRouteWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId) throws ApiException { okhttp3.Call localVarCall = - getSecurityGroupRuleValidateBeforeCall( - projectId, securityGroupId, securityGroupRuleId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + getNetworkAreaRouteValidateBeforeCall( + organizationId, areaId, region, routeId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get security group rule details. (asynchronously) Get details about a security group rule of - * a project. + * Get details about a network route. (asynchronously) Get details about a network route defined + * in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (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 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 @@ -12124,7 +13351,7 @@ public ApiResponse getSecurityGroupRuleWithHttpInfo( * * * - * + * * * * @@ -12132,27 +13359,29 @@ public ApiResponse getSecurityGroupRuleWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show security group rule details. -
200 Show route 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 getSecurityGroupRuleAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - @javax.annotation.Nonnull UUID securityGroupRuleId, - final ApiCallback _callback) + public okhttp3.Call getNetworkAreaRouteAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getSecurityGroupRuleValidateBeforeCall( - projectId, securityGroupId, securityGroupRuleId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getNetworkAreaRouteValidateBeforeCall( + organizationId, areaId, region, routeId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getServer + * Build call for getNic * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param details Show detailed information about server. (optional, default to false) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -12160,7 +13389,7 @@ public okhttp3.Call getSecurityGroupRuleAsync( * * * - * + * * * * @@ -12168,10 +13397,11 @@ public okhttp3.Call getSecurityGroupRuleAsync( * *
Response Details
Status Code Description Response Headers
200 Show server details. -
200 Show network interface 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 getServerCall( + public okhttp3.Call getNicCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable Boolean details, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -12191,13 +13421,19 @@ public okhttp3.Call getServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}" + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())) + .replace( + "{" + "nicId" + "}", + localVarApiClient.escapeString(nicId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -12205,10 +13441,6 @@ public okhttp3.Call getServerCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (details != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("details", details)); - } - final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -12238,41 +13470,56 @@ public okhttp3.Call getServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getServerValidateBeforeCall( + private okhttp3.Call getNicValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable Boolean details, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, 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 getServer(Async)"); + "Missing the required parameter 'projectId' when calling getNic(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling getServer(Async)"); + "Missing the required parameter 'region' when calling getNic(Async)"); + } + + // verify the required parameter 'networkId' is set + if (networkId == null) { + throw new ApiException( + "Missing the required parameter 'networkId' when calling getNic(Async)"); + } + + // verify the required parameter 'nicId' is set + if (nicId == null) { + throw new ApiException( + "Missing the required parameter 'nicId' when calling getNic(Async)"); } - return getServerCall(projectId, serverId, details, _callback); + return getNicCall(projectId, region, networkId, nicId, _callback); } /** - * Get server details. Get details about a server by its ID. + * Get details about a network interface. Get details about a network interface inside a + * network. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param details Show detailed information about server. (optional, default to false) - * @return Server + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (required) + * @return NIC * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -12280,29 +13527,32 @@ private okhttp3.Call getServerValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show server details. -
200 Show network interface 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 Server getServer( + public NIC getNic( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable Boolean details) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId) throws ApiException { - ApiResponse localVarResp = getServerWithHttpInfo(projectId, serverId, details); + ApiResponse localVarResp = getNicWithHttpInfo(projectId, region, networkId, nicId); return localVarResp.getData(); } /** - * Get server details. Get details about a server by its ID. + * Get details about a network interface. Get details about a network interface inside a + * network. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param details Show detailed information about server. (optional, default to false) - * @return ApiResponse<Server> + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (required) + * @return ApiResponse<NIC> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -12310,22 +13560,26 @@ public Server getServer( * *
Response Details
Status Code Description Response Headers
200 Show server details. -
200 Show network interface 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 ApiResponse getServerWithHttpInfo( + public ApiResponse getNicWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable Boolean details) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId) throws ApiException { - okhttp3.Call localVarCall = getServerValidateBeforeCall(projectId, serverId, details, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getNicValidateBeforeCall(projectId, region, networkId, nicId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get server details. (asynchronously) Get details about a server by its ID. + * Get details about a network interface. (asynchronously) Get details about a network interface + * inside a network. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param details Show detailed information about server. (optional, default to false) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (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 @@ -12334,7 +13588,7 @@ public ApiResponse getServerWithHttpInfo( * * * - * + * * * * @@ -12342,25 +13596,26 @@ public ApiResponse getServerWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show server details. -
200 Show network interface 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 getServerAsync( + public okhttp3.Call getNicAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable Boolean details, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getServerValidateBeforeCall(projectId, serverId, details, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getNicValidateBeforeCall(projectId, region, networkId, nicId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getServerConsole + * Build call for getOrganizationRequest * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param requestId The identifier (ID) of a STACKIT Request. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -12368,7 +13623,7 @@ public okhttp3.Call getServerAsync( * * * - * + * * * * @@ -12376,9 +13631,9 @@ public okhttp3.Call getServerAsync( * *
Response Details
Status Code Description Response Headers
200 Show server console URL. -
200 Show organization request 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 getServerConsoleCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + public okhttp3.Call getOrganizationRequestCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull String requestId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -12398,13 +13653,13 @@ public okhttp3.Call getServerConsoleCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/console" + "/v2/organizations/{organizationId}/requests/{requestId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + "{" + "requestId" + "}", + localVarApiClient.escapeString(requestId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -12441,39 +13696,40 @@ public okhttp3.Call getServerConsoleCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getServerConsoleValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + private okhttp3.Call getOrganizationRequestValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull String requestId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling getServerConsole(Async)"); + "Missing the required parameter 'organizationId' when calling getOrganizationRequest(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'requestId' is set + if (requestId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling getServerConsole(Async)"); + "Missing the required parameter 'requestId' when calling getOrganizationRequest(Async)"); } - return getServerConsoleCall(projectId, serverId, _callback); + return getOrganizationRequestCall(organizationId, requestId, _callback); } /** - * Get server console. Get a URL for server remote console. + * Lookup an organization request ID. Lookup an organization request ID from a previous request. + * This allows to find resource IDs of resources generated during a organization request. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @return ServerConsoleUrl + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param requestId The identifier (ID) of a STACKIT Request. (required) + * @return Request * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -12481,27 +13737,29 @@ private okhttp3.Call getServerConsoleValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show server console URL. -
200 Show organization request 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 ServerConsoleUrl getServerConsole( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public Request getOrganizationRequest( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull String requestId) throws ApiException { - ApiResponse localVarResp = - getServerConsoleWithHttpInfo(projectId, serverId); + ApiResponse localVarResp = + getOrganizationRequestWithHttpInfo(organizationId, requestId); return localVarResp.getData(); } /** - * Get server console. Get a URL for server remote console. + * Lookup an organization request ID. Lookup an organization request ID from a previous request. + * This allows to find resource IDs of resources generated during a organization request. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @return ApiResponse<ServerConsoleUrl> + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param requestId The identifier (ID) of a STACKIT Request. (required) + * @return ApiResponse<Request> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -12509,19 +13767,23 @@ public ServerConsoleUrl getServerConsole( * *
Response Details
Status Code Description Response Headers
200 Show server console URL. -
200 Show organization request 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 ApiResponse getServerConsoleWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public ApiResponse getOrganizationRequestWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull String requestId) throws ApiException { - okhttp3.Call localVarCall = getServerConsoleValidateBeforeCall(projectId, serverId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getOrganizationRequestValidateBeforeCall(organizationId, requestId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get server console. (asynchronously) Get a URL for server remote console. + * Lookup an organization request ID. (asynchronously) Lookup an organization request ID from a + * previous request. This allows to find resource IDs of resources generated during a + * organization request. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param requestId The identifier (ID) of a STACKIT Request. (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 @@ -12530,7 +13792,7 @@ public ApiResponse getServerConsoleWithHttpInfo( * * * - * + * * * * @@ -12538,26 +13800,23 @@ public ApiResponse getServerConsoleWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show server console URL. -
200 Show organization request 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 getServerConsoleAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - final ApiCallback _callback) + public okhttp3.Call getOrganizationRequestAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull String requestId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getServerConsoleValidateBeforeCall(projectId, serverId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getOrganizationRequestValidateBeforeCall(organizationId, requestId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getServerLog + * Build call for getProjectDetails * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param length Request the server log. By default the length is limited to 2000 lines. Set to - * 0 to retrieve the complete log. (optional, default to 2000) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -12565,7 +13824,7 @@ public okhttp3.Call getServerConsoleAsync( * * * - * + * * * * @@ -12573,11 +13832,8 @@ public okhttp3.Call getServerConsoleAsync( * *
Response Details
Status Code Description Response Headers
200 Show server console log. -
200 Show project 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 getServerLogCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable Long length, - final ApiCallback _callback) + public okhttp3.Call getProjectDetailsCall( + @javax.annotation.Nonnull UUID projectId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -12596,13 +13852,10 @@ public okhttp3.Call getServerLogCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/log" + "/v2/projects/{projectId}" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) - .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + localVarApiClient.escapeString(projectId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -12610,10 +13863,6 @@ public okhttp3.Call getServerLogCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (length != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("length", length)); - } - final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -12643,42 +13892,30 @@ public okhttp3.Call getServerLogCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getServerLogValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable Long length, - final ApiCallback _callback) + private okhttp3.Call getProjectDetailsValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, 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 getServerLog(Async)"); - } - - // verify the required parameter 'serverId' is set - if (serverId == null) { - throw new ApiException( - "Missing the required parameter 'serverId' when calling getServerLog(Async)"); + "Missing the required parameter 'projectId' when calling getProjectDetails(Async)"); } - return getServerLogCall(projectId, serverId, length, _callback); + return getProjectDetailsCall(projectId, _callback); } /** - * Get server log. Get server console log. + * Get project details. Get details about a STACKIT project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param length Request the server log. By default the length is limited to 2000 lines. Set to - * 0 to retrieve the complete log. (optional, default to 2000) - * @return GetServerLog200Response + * @return Project * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -12686,31 +13923,23 @@ private okhttp3.Call getServerLogValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show server console log. -
200 Show project 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 GetServerLog200Response getServerLog( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable Long length) - throws ApiException { - ApiResponse localVarResp = - getServerLogWithHttpInfo(projectId, serverId, length); + public Project getProjectDetails(@javax.annotation.Nonnull UUID projectId) throws ApiException { + ApiResponse localVarResp = getProjectDetailsWithHttpInfo(projectId); return localVarResp.getData(); } /** - * Get server log. Get server console log. + * Get project details. Get details about a STACKIT project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param length Request the server log. By default the length is limited to 2000 lines. Set to - * 0 to retrieve the complete log. (optional, default to 2000) - * @return ApiResponse<GetServerLog200Response> + * @return ApiResponse<Project> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -12718,24 +13947,17 @@ public GetServerLog200Response getServerLog( * *
Response Details
Status Code Description Response Headers
200 Show server console log. -
200 Show project 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 ApiResponse getServerLogWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable Long length) - throws ApiException { - okhttp3.Call localVarCall = - getServerLogValidateBeforeCall(projectId, serverId, length, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse getProjectDetailsWithHttpInfo( + @javax.annotation.Nonnull UUID projectId) throws ApiException { + okhttp3.Call localVarCall = getProjectDetailsValidateBeforeCall(projectId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get server log. (asynchronously) Get server console log. + * Get project details. (asynchronously) Get details about a STACKIT project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param length Request the server log. By default the length is limited to 2000 lines. Set to - * 0 to retrieve the complete log. (optional, default to 2000) * @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 @@ -12744,7 +13966,7 @@ public ApiResponse getServerLogWithHttpInfo( * * * - * + * * * * @@ -12752,25 +13974,22 @@ public ApiResponse getServerLogWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show server console log. -
200 Show project 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 getServerLogAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable Long length, - final ApiCallback _callback) + public okhttp3.Call getProjectDetailsAsync( + @javax.annotation.Nonnull UUID projectId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = - getServerLogValidateBeforeCall(projectId, serverId, length, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getProjectDetailsValidateBeforeCall(projectId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getSnapshot + * Build call for getProjectNIC * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) + * @param region The STACKIT Region of the resources. (required) + * @param nicId The identifier (ID) of a network interface. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -12778,7 +13997,7 @@ public okhttp3.Call getServerLogAsync( * * * - * + * * * * @@ -12786,9 +14005,10 @@ public okhttp3.Call getServerLogAsync( * *
Response Details
Status Code Description Response Headers
200 Show snapshot details. -
200 Show details of network interface. -
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 getSnapshotCall( + public okhttp3.Call getProjectNICCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID snapshotId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID nicId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -12808,13 +14028,16 @@ public okhttp3.Call getSnapshotCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/snapshots/{snapshotId}" + "/v2/projects/{projectId}/regions/{region}/nics/{nicId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "snapshotId" + "}", - localVarApiClient.escapeString(snapshotId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "nicId" + "}", + localVarApiClient.escapeString(nicId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -12851,39 +14074,48 @@ public okhttp3.Call getSnapshotCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getSnapshotValidateBeforeCall( + private okhttp3.Call getProjectNICValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID snapshotId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID nicId, 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 getSnapshot(Async)"); + "Missing the required parameter 'projectId' when calling getProjectNIC(Async)"); } - // verify the required parameter 'snapshotId' is set - if (snapshotId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'snapshotId' when calling getSnapshot(Async)"); + "Missing the required parameter 'region' when calling getProjectNIC(Async)"); + } + + // verify the required parameter 'nicId' is set + if (nicId == null) { + throw new ApiException( + "Missing the required parameter 'nicId' when calling getProjectNIC(Async)"); } - return getSnapshotCall(projectId, snapshotId, _callback); + return getProjectNICCall(projectId, region, nicId, _callback); } /** - * Get details about a snapshot. Get details about a block device snapshot. + * Get details about a network interface of a project. Get details about a network interface + * inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) - * @return Snapshot + * @param region The STACKIT Region of the resources. (required) + * @param nicId The identifier (ID) of a network interface. (required) + * @return NIC * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -12891,26 +14123,30 @@ private okhttp3.Call getSnapshotValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show snapshot details. -
200 Show details of network interface. -
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 Snapshot getSnapshot( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID snapshotId) + public NIC getProjectNIC( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID nicId) throws ApiException { - ApiResponse localVarResp = getSnapshotWithHttpInfo(projectId, snapshotId); + ApiResponse localVarResp = getProjectNICWithHttpInfo(projectId, region, nicId); return localVarResp.getData(); } /** - * Get details about a snapshot. Get details about a block device snapshot. + * Get details about a network interface of a project. Get details about a network interface + * inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) - * @return ApiResponse<Snapshot> + * @param region The STACKIT Region of the resources. (required) + * @param nicId The identifier (ID) of a network interface. (required) + * @return ApiResponse<NIC> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -12918,19 +14154,23 @@ public Snapshot getSnapshot( * *
Response Details
Status Code Description Response Headers
200 Show snapshot details. -
200 Show details of network interface. -
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 getSnapshotWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID snapshotId) + public ApiResponse getProjectNICWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID nicId) throws ApiException { - okhttp3.Call localVarCall = getSnapshotValidateBeforeCall(projectId, snapshotId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getProjectNICValidateBeforeCall(projectId, region, nicId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get details about a snapshot. (asynchronously) Get details about a block device snapshot. + * Get details about a network interface of a project. (asynchronously) Get details about a + * network interface inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) + * @param region The STACKIT Region of the resources. (required) + * @param nicId The identifier (ID) of a network interface. (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 @@ -12939,7 +14179,7 @@ public ApiResponse getSnapshotWithHttpInfo( * * * - * + * * * * @@ -12947,23 +14187,26 @@ public ApiResponse getSnapshotWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show snapshot details. -
200 Show details of network interface. -
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 getSnapshotAsync( + public okhttp3.Call getProjectNICAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID snapshotId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID nicId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getSnapshotValidateBeforeCall(projectId, snapshotId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getProjectNICValidateBeforeCall(projectId, region, nicId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getVolume + * Build call for getProjectRequest * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param region The STACKIT Region of the resources. (required) + * @param requestId The identifier (ID) of a STACKIT Request. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -12971,7 +14214,7 @@ public okhttp3.Call getSnapshotAsync( * * * - * + * * * * @@ -12979,9 +14222,10 @@ public okhttp3.Call getSnapshotAsync( * *
Response Details
Status Code Description Response Headers
200 Show volume details. -
200 Show project request 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 getVolumeCall( + public okhttp3.Call getProjectRequestCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String requestId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -13001,13 +14245,16 @@ public okhttp3.Call getVolumeCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/volumes/{volumeId}" + "/v2/projects/{projectId}/regions/{region}/requests/{requestId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "volumeId" + "}", - localVarApiClient.escapeString(volumeId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "requestId" + "}", + localVarApiClient.escapeString(requestId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -13044,39 +14291,48 @@ public okhttp3.Call getVolumeCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getVolumeValidateBeforeCall( + private okhttp3.Call getProjectRequestValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String requestId, 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 getVolume(Async)"); + "Missing the required parameter 'projectId' when calling getProjectRequest(Async)"); } - // verify the required parameter 'volumeId' is set - if (volumeId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'volumeId' when calling getVolume(Async)"); + "Missing the required parameter 'region' when calling getProjectRequest(Async)"); + } + + // verify the required parameter 'requestId' is set + if (requestId == null) { + throw new ApiException( + "Missing the required parameter 'requestId' when calling getProjectRequest(Async)"); } - return getVolumeCall(projectId, volumeId, _callback); + return getProjectRequestCall(projectId, region, requestId, _callback); } /** - * Get details about a volume. Get details about a block device volume. + * Lookup a project request ID. Lookup a project request ID from a previous request. This allows + * to find resource IDs of resources generated during a projects request. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @return Volume + * @param region The STACKIT Region of the resources. (required) + * @param requestId The identifier (ID) of a STACKIT Request. (required) + * @return Request * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -13084,26 +14340,31 @@ private okhttp3.Call getVolumeValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show volume details. -
200 Show project request 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 Volume getVolume( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID volumeId) + public Request getProjectRequest( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String requestId) throws ApiException { - ApiResponse localVarResp = getVolumeWithHttpInfo(projectId, volumeId); + ApiResponse localVarResp = + getProjectRequestWithHttpInfo(projectId, region, requestId); return localVarResp.getData(); } /** - * Get details about a volume. Get details about a block device volume. + * Lookup a project request ID. Lookup a project request ID from a previous request. This allows + * to find resource IDs of resources generated during a projects request. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @return ApiResponse<Volume> + * @param region The STACKIT Region of the resources. (required) + * @param requestId The identifier (ID) of a STACKIT Request. (required) + * @return ApiResponse<Request> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -13111,19 +14372,24 @@ public Volume getVolume( * *
Response Details
Status Code Description Response Headers
200 Show volume details. -
200 Show project request 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 ApiResponse getVolumeWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID volumeId) + public ApiResponse getProjectRequestWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String requestId) throws ApiException { - okhttp3.Call localVarCall = getVolumeValidateBeforeCall(projectId, volumeId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getProjectRequestValidateBeforeCall(projectId, region, requestId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get details about a volume. (asynchronously) Get details about a block device volume. + * Lookup a project request ID. (asynchronously) Lookup a project request ID from a previous + * request. This allows to find resource IDs of resources generated during a projects request. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param region The STACKIT Region of the resources. (required) + * @param requestId The identifier (ID) of a STACKIT Request. (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 @@ -13132,7 +14398,7 @@ public ApiResponse getVolumeWithHttpInfo( * * * - * + * * * * @@ -13140,23 +14406,26 @@ public ApiResponse getVolumeWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Show volume details. -
200 Show project request 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 getVolumeAsync( + public okhttp3.Call getProjectRequestAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID volumeId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String requestId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getVolumeValidateBeforeCall(projectId, volumeId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getProjectRequestValidateBeforeCall(projectId, region, requestId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getVolumePerformanceClass + * Build call for getPublicIP * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumePerformanceClass The name of a STACKIT Volume performance class. (required) + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -13164,7 +14433,7 @@ public okhttp3.Call getVolumeAsync( * * * - * + * * * * @@ -13172,9 +14441,10 @@ public okhttp3.Call getVolumeAsync( * *
Response Details
Status Code Description Response Headers
200 Show volume performance class details. -
200 Show public IP 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 getVolumePerformanceClassCall( + public okhttp3.Call getPublicIPCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String volumePerformanceClass, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -13194,13 +14464,16 @@ public okhttp3.Call getVolumePerformanceClassCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" + "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "volumePerformanceClass" + "}", - localVarApiClient.escapeString(volumePerformanceClass.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "publicIpId" + "}", + localVarApiClient.escapeString(publicIpId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -13237,40 +14510,47 @@ public okhttp3.Call getVolumePerformanceClassCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getVolumePerformanceClassValidateBeforeCall( + private okhttp3.Call getPublicIPValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String volumePerformanceClass, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId, 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 getVolumePerformanceClass(Async)"); + "Missing the required parameter 'projectId' when calling getPublicIP(Async)"); } - // verify the required parameter 'volumePerformanceClass' is set - if (volumePerformanceClass == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'volumePerformanceClass' when calling getVolumePerformanceClass(Async)"); + "Missing the required parameter 'region' when calling getPublicIP(Async)"); + } + + // verify the required parameter 'publicIpId' is set + if (publicIpId == null) { + throw new ApiException( + "Missing the required parameter 'publicIpId' when calling getPublicIP(Async)"); } - return getVolumePerformanceClassCall(projectId, volumePerformanceClass, _callback); + return getPublicIPCall(projectId, region, publicIpId, _callback); } /** - * Get details about a volume performance class. Get details about a specific volume performance - * class. + * Get details about a public IP. Get details about a public IP inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumePerformanceClass The name of a STACKIT Volume performance class. (required) - * @return VolumePerformanceClass + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (required) + * @return PublicIp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -13278,29 +14558,29 @@ private okhttp3.Call getVolumePerformanceClassValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Show volume performance class details. -
200 Show public IP 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 VolumePerformanceClass getVolumePerformanceClass( + public PublicIp getPublicIP( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String volumePerformanceClass) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId) throws ApiException { - ApiResponse localVarResp = - getVolumePerformanceClassWithHttpInfo(projectId, volumePerformanceClass); + ApiResponse localVarResp = getPublicIPWithHttpInfo(projectId, region, publicIpId); return localVarResp.getData(); } /** - * Get details about a volume performance class. Get details about a specific volume performance - * class. + * Get details about a public IP. Get details about a public IP inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumePerformanceClass The name of a STACKIT Volume performance class. (required) - * @return ApiResponse<VolumePerformanceClass> + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (required) + * @return ApiResponse<PublicIp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -13308,23 +14588,24 @@ public VolumePerformanceClass getVolumePerformanceClass( * *
Response Details
Status Code Description Response Headers
200 Show volume performance class details. -
200 Show public IP 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 ApiResponse getVolumePerformanceClassWithHttpInfo( + public ApiResponse getPublicIPWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String volumePerformanceClass) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId) throws ApiException { okhttp3.Call localVarCall = - getVolumePerformanceClassValidateBeforeCall( - projectId, volumePerformanceClass, null); - Type localVarReturnType = new TypeToken() {}.getType(); + getPublicIPValidateBeforeCall(projectId, region, publicIpId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get details about a volume performance class. (asynchronously) Get details about a specific - * volume performance class. + * Get details about a public IP. (asynchronously) Get details about a public IP inside a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumePerformanceClass The name of a STACKIT Volume performance class. (required) + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (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 @@ -13333,7 +14614,7 @@ public ApiResponse getVolumePerformanceClassWithHttpInfo * * * - * + * * * * @@ -13341,24 +14622,28 @@ public ApiResponse getVolumePerformanceClassWithHttpInfo * *
Response Details
Status Code Description Response Headers
200 Show volume performance class details. -
200 Show public IP 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 getVolumePerformanceClassAsync( + public okhttp3.Call getPublicIPAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull String volumePerformanceClass, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - getVolumePerformanceClassValidateBeforeCall( - projectId, volumePerformanceClass, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getPublicIPValidateBeforeCall(projectId, region, publicIpId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listAffinityGroups + * Build call for getRouteOfRoutingTable * - * @param projectId The identifier (ID) of a STACKIT Project. (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 _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -13366,17 +14651,21 @@ public okhttp3.Call getVolumePerformanceClassAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
200 List affinity groups. -
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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call listAffinityGroupsCall( - @javax.annotation.Nonnull UUID projectId, final ApiCallback _callback) + 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 @@ -13395,15 +14684,27 @@ public okhttp3.Call listAffinityGroupsCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/affinity-groups" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); + "{" + "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"}; @@ -13435,85 +14736,132 @@ public okhttp3.Call listAffinityGroupsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listAffinityGroupsValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, final ApiCallback _callback) + 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 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling listAffinityGroups(Async)"); + "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 listAffinityGroupsCall(projectId, _callback); + return getRouteOfRoutingTableCall( + organizationId, areaId, region, routingTableId, routeId, _callback); } /** - * Get the affinity groups setup for a project. Get the affinity groups created in a project. - * Affinity groups are an indication of locality of a server relative to another group of - * servers. They can be either running on the same host (affinity) or on different ones - * (anti-affinity). + * Get details about a route of a routing table. Get details about a route defined in a routing + * table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @return AffinityGroupListResponse + * @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 List affinity groups. -
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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public AffinityGroupListResponse listAffinityGroups(@javax.annotation.Nonnull UUID projectId) + 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 = - listAffinityGroupsWithHttpInfo(projectId); + ApiResponse localVarResp = + getRouteOfRoutingTableWithHttpInfo( + organizationId, areaId, region, routingTableId, routeId); return localVarResp.getData(); } /** - * Get the affinity groups setup for a project. Get the affinity groups created in a project. - * Affinity groups are an indication of locality of a server relative to another group of - * servers. They can be either running on the same host (affinity) or on different ones - * (anti-affinity). + * Get details about a route of a routing table. Get details about a route defined in a routing + * table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @return ApiResponse<AffinityGroupListResponse> + * @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 ApiResponse<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 List affinity groups. -
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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ApiResponse listAffinityGroupsWithHttpInfo( - @javax.annotation.Nonnull UUID projectId) throws ApiException { - okhttp3.Call localVarCall = listAffinityGroupsValidateBeforeCall(projectId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse getRouteOfRoutingTableWithHttpInfo( + @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 { + okhttp3.Call localVarCall = + getRouteOfRoutingTableValidateBeforeCall( + organizationId, areaId, region, routingTableId, routeId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get the affinity groups setup for a project. (asynchronously) Get the affinity groups created - * in a project. Affinity groups are an indication of locality of a server relative to another - * group of servers. They can be either running on the same host (affinity) or on different ones - * (anti-affinity). + * Get details about a route of a routing table. (asynchronously) Get details about a route + * defined in a routing table. * - * @param projectId The identifier (ID) of a STACKIT Project. (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 _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 @@ -13522,31 +14870,38 @@ public ApiResponse listAffinityGroupsWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
200 List affinity groups. -
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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call listAffinityGroupsAsync( - @javax.annotation.Nonnull UUID projectId, - final ApiCallback _callback) + public okhttp3.Call getRouteOfRoutingTableAsync( + @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 { - okhttp3.Call localVarCall = listAffinityGroupsValidateBeforeCall(projectId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getRouteOfRoutingTableValidateBeforeCall( + organizationId, areaId, region, routingTableId, routeId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listAttachedVolumes + * Build call for getRoutingTableOfArea * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (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 _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -13554,7 +14909,7 @@ public okhttp3.Call listAffinityGroupsAsync( * * * - * + * * * * @@ -13562,9 +14917,11 @@ public okhttp3.Call listAffinityGroupsAsync( * *
Response Details
Status Code Description Response Headers
200 List volume attachments. -
200 Show routing table 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 listAttachedVolumesCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + public okhttp3.Call getRoutingTableOfAreaCall( + @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 { String basePath = null; @@ -13584,13 +14941,19 @@ public okhttp3.Call listAttachedVolumesCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/volume-attachments" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + "{" + "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(); @@ -13627,39 +14990,56 @@ public okhttp3.Call listAttachedVolumesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listAttachedVolumesValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + private okhttp3.Call getRoutingTableOfAreaValidateBeforeCall( + @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 { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling listAttachedVolumes(Async)"); + "Missing the required parameter 'organizationId' when calling getRoutingTableOfArea(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling listAttachedVolumes(Async)"); + "Missing the required parameter 'areaId' when calling getRoutingTableOfArea(Async)"); } - return listAttachedVolumesCall(projectId, serverId, _callback); + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getRoutingTableOfArea(Async)"); + } + + // verify the required parameter 'routingTableId' is set + if (routingTableId == null) { + throw new ApiException( + "Missing the required parameter 'routingTableId' when calling getRoutingTableOfArea(Async)"); + } + + return getRoutingTableOfAreaCall(organizationId, areaId, region, routingTableId, _callback); } /** - * List all volume attachments of a server. Get a list of all volume attachments of a server. + * Get details about a routing table. Get details about a routing table defined in a network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @return VolumeAttachmentListResponse + * @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 RoutingTable * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -13667,27 +15047,33 @@ private okhttp3.Call listAttachedVolumesValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List volume attachments. -
200 Show routing table 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 VolumeAttachmentListResponse listAttachedVolumes( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public RoutingTable getRoutingTableOfArea( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId) throws ApiException { - ApiResponse localVarResp = - listAttachedVolumesWithHttpInfo(projectId, serverId); + ApiResponse localVarResp = + getRoutingTableOfAreaWithHttpInfo(organizationId, areaId, region, routingTableId); return localVarResp.getData(); } /** - * List all volume attachments of a server. Get a list of all volume attachments of a server. + * Get details about a routing table. Get details about a routing table defined in a network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @return ApiResponse<VolumeAttachmentListResponse> + * @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<RoutingTable> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -13695,21 +15081,27 @@ public VolumeAttachmentListResponse listAttachedVolumes( * *
Response Details
Status Code Description Response Headers
200 List volume attachments. -
200 Show routing table 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 ApiResponse listAttachedVolumesWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public ApiResponse getRoutingTableOfAreaWithHttpInfo( + @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 = - listAttachedVolumesValidateBeforeCall(projectId, serverId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + getRoutingTableOfAreaValidateBeforeCall( + organizationId, areaId, region, routingTableId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all volume attachments of a server. (asynchronously) Get a list of all volume - * attachments of a server. + * Get details about a routing table. (asynchronously) Get details about a routing table defined + * in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (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 _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 @@ -13718,7 +15110,7 @@ public ApiResponse listAttachedVolumesWithHttpInfo * * * - * + * * * * @@ -13726,22 +15118,28 @@ public ApiResponse listAttachedVolumesWithHttpInfo * *
Response Details
Status Code Description Response Headers
200 List volume attachments. -
200 Show routing table 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 listAttachedVolumesAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - final ApiCallback _callback) + public okhttp3.Call getRoutingTableOfAreaAsync( + @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 = - listAttachedVolumesValidateBeforeCall(projectId, serverId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getRoutingTableOfAreaValidateBeforeCall( + organizationId, areaId, region, routingTableId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listAvailabilityZones + * Build call for getSecurityGroup * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -13749,7 +15147,7 @@ public okhttp3.Call listAttachedVolumesAsync( * * * - * + * * * * @@ -13757,7 +15155,12 @@ public okhttp3.Call listAttachedVolumesAsync( * *
Response Details
Status Code Description Response Headers
200 Get a list of availability zones. -
200 Show security group 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 listAvailabilityZonesCall(final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSecurityGroupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -13774,7 +15177,17 @@ public okhttp3.Call listAvailabilityZonesCall(final ApiCallback _callback) throw Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/availability-zones"; + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -13811,22 +15224,47 @@ public okhttp3.Call listAvailabilityZonesCall(final ApiCallback _callback) throw } @SuppressWarnings("rawtypes") - private okhttp3.Call listAvailabilityZonesValidateBeforeCall(final ApiCallback _callback) + private okhttp3.Call getSecurityGroupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + final ApiCallback _callback) throws ApiException { - return listAvailabilityZonesCall(_callback); + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + "Missing the required parameter 'projectId' when calling getSecurityGroup(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getSecurityGroup(Async)"); + } + + // verify the required parameter 'securityGroupId' is set + if (securityGroupId == null) { + throw new ApiException( + "Missing the required parameter 'securityGroupId' when calling getSecurityGroup(Async)"); + } + + return getSecurityGroupCall(projectId, region, securityGroupId, _callback); } /** - * List all availability zones. Get a list of all availability zones. + * Get security group details. Get details about a security group of a project. * - * @return AvailabilityZoneListResponse + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @return SecurityGroup * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -13834,23 +15272,30 @@ private okhttp3.Call listAvailabilityZonesValidateBeforeCall(final ApiCallback _ * *
Response Details
Status Code Description Response Headers
200 Get a list of availability zones. -
200 Show security group 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 AvailabilityZoneListResponse listAvailabilityZones() throws ApiException { - ApiResponse localVarResp = - listAvailabilityZonesWithHttpInfo(); + public SecurityGroup getSecurityGroup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId) + throws ApiException { + ApiResponse localVarResp = + getSecurityGroupWithHttpInfo(projectId, region, securityGroupId); return localVarResp.getData(); } /** - * List all availability zones. Get a list of all availability zones. + * Get security group details. Get details about a security group of a project. * - * @return ApiResponse<AvailabilityZoneListResponse> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @return ApiResponse<SecurityGroup> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -13858,16 +15303,23 @@ public AvailabilityZoneListResponse listAvailabilityZones() throws ApiException * *
Response Details
Status Code Description Response Headers
200 Get a list of availability zones. -
200 Show security group 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 ApiResponse listAvailabilityZonesWithHttpInfo() + public ApiResponse getSecurityGroupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId) throws ApiException { - okhttp3.Call localVarCall = listAvailabilityZonesValidateBeforeCall(null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getSecurityGroupValidateBeforeCall(projectId, region, securityGroupId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all availability zones. (asynchronously) Get a list of all availability zones. + * Get security group details. (asynchronously) Get details about a security group of a project. * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -13876,7 +15328,7 @@ public ApiResponse listAvailabilityZonesWithHttpIn * * * - * + * * * * @@ -13884,20 +15336,27 @@ public ApiResponse listAvailabilityZonesWithHttpIn * *
Response Details
Status Code Description Response Headers
200 Get a list of availability zones. -
200 Show security group 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 listAvailabilityZonesAsync( - final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listAvailabilityZonesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken() {}.getType(); + public okhttp3.Call getSecurityGroupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getSecurityGroupValidateBeforeCall(projectId, region, securityGroupId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listBackups + * Build call for getSecurityGroupRule * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -13905,7 +15364,7 @@ public okhttp3.Call listAvailabilityZonesAsync( * * * - * + * * * * @@ -13913,9 +15372,11 @@ public okhttp3.Call listAvailabilityZonesAsync( * *
Response Details
Status Code Description Response Headers
200 List project backups. -
200 Show security group rule 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 listBackupsCall( + public okhttp3.Call getSecurityGroupRuleCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -13935,10 +15396,19 @@ public okhttp3.Call listBackupsCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/backups" + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())) + .replace( + "{" + "securityGroupRuleId" + "}", + localVarApiClient.escapeString(securityGroupRuleId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -13946,11 +15416,6 @@ public okhttp3.Call listBackupsCall( 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) { @@ -13980,33 +15445,56 @@ public okhttp3.Call listBackupsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listBackupsValidateBeforeCall( + private okhttp3.Call getSecurityGroupRuleValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId, 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 listBackups(Async)"); + "Missing the required parameter 'projectId' when calling getSecurityGroupRule(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getSecurityGroupRule(Async)"); + } + + // verify the required parameter 'securityGroupId' is set + if (securityGroupId == null) { + throw new ApiException( + "Missing the required parameter 'securityGroupId' when calling getSecurityGroupRule(Async)"); + } + + // verify the required parameter 'securityGroupRuleId' is set + if (securityGroupRuleId == null) { + throw new ApiException( + "Missing the required parameter 'securityGroupRuleId' when calling getSecurityGroupRule(Async)"); } - return listBackupsCall(projectId, labelSelector, _callback); + return getSecurityGroupRuleCall( + projectId, region, securityGroupId, securityGroupRuleId, _callback); } /** - * List all backups inside a project. Get a list of all backups inside a project. + * Get security group rule details. Get details about a security group rule of a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return BackupListResponse + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (required) + * @return SecurityGroupRule * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -14014,28 +15502,33 @@ private okhttp3.Call listBackupsValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List project backups. -
200 Show security group rule 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 BackupListResponse listBackups( + public SecurityGroupRule getSecurityGroupRule( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId) throws ApiException { - ApiResponse localVarResp = - listBackupsWithHttpInfo(projectId, labelSelector); + ApiResponse localVarResp = + getSecurityGroupRuleWithHttpInfo( + projectId, region, securityGroupId, securityGroupRuleId); return localVarResp.getData(); } /** - * List all backups inside a project. Get a list of all backups inside a project. + * Get security group rule details. Get details about a security group rule of a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<BackupListResponse> + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (required) + * @return ApiResponse<SecurityGroupRule> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -14043,21 +15536,27 @@ public BackupListResponse listBackups( * *
Response Details
Status Code Description Response Headers
200 List project backups. -
200 Show security group rule 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 ApiResponse listBackupsWithHttpInfo( + public ApiResponse getSecurityGroupRuleWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId) throws ApiException { - okhttp3.Call localVarCall = listBackupsValidateBeforeCall(projectId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getSecurityGroupRuleValidateBeforeCall( + projectId, region, securityGroupId, securityGroupRuleId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all backups inside a project. (asynchronously) Get a list of all backups inside a - * project. + * Get security group rule details. (asynchronously) Get details about a security group rule of + * a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param region The STACKIT Region of the resources. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. (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 @@ -14066,7 +15565,7 @@ public ApiResponse listBackupsWithHttpInfo( * * * - * + * * * * @@ -14074,25 +15573,29 @@ public ApiResponse listBackupsWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List project backups. -
200 Show security group rule 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 listBackupsAsync( + public okhttp3.Call getSecurityGroupRuleAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listBackupsValidateBeforeCall(projectId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getSecurityGroupRuleValidateBeforeCall( + projectId, region, securityGroupId, securityGroupRuleId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listImages + * Build call for getServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param all List all Images. (optional, default to false) - * @param labelSelector Filter resources by labels. (optional) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param details Show detailed information about server. (optional, default to false) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -14100,7 +15603,7 @@ public okhttp3.Call listBackupsAsync( * * * - * + * * * * @@ -14108,10 +15611,11 @@ public okhttp3.Call listBackupsAsync( * *
Response Details
Status Code Description Response Headers
200 List project images. -
200 Show server 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 listImagesCall( + public okhttp3.Call getServerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable Boolean all, - @javax.annotation.Nullable String labelSelector, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Boolean details, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -14131,10 +15635,16 @@ public okhttp3.Call listImagesCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -14142,13 +15652,8 @@ public okhttp3.Call listImagesCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (all != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("all", all)); - } - - if (labelSelector != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("label_selector", labelSelector)); + if (details != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("details", details)); } final String[] localVarAccepts = {"application/json"}; @@ -14180,35 +15685,49 @@ public okhttp3.Call listImagesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listImagesValidateBeforeCall( + private okhttp3.Call getServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable Boolean all, - @javax.annotation.Nullable String labelSelector, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Boolean details, 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 listImages(Async)"); + "Missing the required parameter 'projectId' when calling getServer(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling getServer(Async)"); } - return listImagesCall(projectId, all, labelSelector, _callback); + return getServerCall(projectId, region, serverId, details, _callback); } /** - * List all Images inside a project. Get a list of all images inside a project. + * Get server details. Get details about a server by its ID. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param all List all Images. (optional, default to false) - * @param labelSelector Filter resources by labels. (optional) - * @return ImageListResponse + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param details Show detailed information about server. (optional, default to false) + * @return Server * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -14216,30 +15735,32 @@ private okhttp3.Call listImagesValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List project images. -
200 Show server 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 ImageListResponse listImages( + public Server getServer( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable Boolean all, - @javax.annotation.Nullable String labelSelector) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Boolean details) throws ApiException { - ApiResponse localVarResp = - listImagesWithHttpInfo(projectId, all, labelSelector); + ApiResponse localVarResp = + getServerWithHttpInfo(projectId, region, serverId, details); return localVarResp.getData(); } /** - * List all Images inside a project. Get a list of all images inside a project. + * Get server details. Get details about a server by its ID. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param all List all Images. (optional, default to false) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<ImageListResponse> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param details Show detailed information about server. (optional, default to false) + * @return ApiResponse<Server> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -14247,23 +15768,25 @@ public ImageListResponse listImages( * *
Response Details
Status Code Description Response Headers
200 List project images. -
200 Show server 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 ApiResponse listImagesWithHttpInfo( + public ApiResponse getServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable Boolean all, - @javax.annotation.Nullable String labelSelector) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Boolean details) throws ApiException { okhttp3.Call localVarCall = - listImagesValidateBeforeCall(projectId, all, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + getServerValidateBeforeCall(projectId, region, serverId, details, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all Images inside a project. (asynchronously) Get a list of all images inside a project. + * Get server details. (asynchronously) Get details about a server by its ID. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param all List all Images. (optional, default to false) - * @param labelSelector Filter resources by labels. (optional) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param details Show detailed information about server. (optional, default to false) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -14272,7 +15795,7 @@ public ApiResponse listImagesWithHttpInfo( * * * - * + * * * * @@ -14280,24 +15803,27 @@ public ApiResponse listImagesWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List project images. -
200 Show server 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 listImagesAsync( + public okhttp3.Call getServerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable Boolean all, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Boolean details, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listImagesValidateBeforeCall(projectId, all, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getServerValidateBeforeCall(projectId, region, serverId, details, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listKeyPairs + * Build call for getServerConsole * - * @param labelSelector Filter resources by labels. (optional) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -14305,7 +15831,7 @@ public okhttp3.Call listImagesAsync( * * * - * + * * * * @@ -14313,8 +15839,11 @@ public okhttp3.Call listImagesAsync( * *
Response Details
Status Code Description Response Headers
200 List SSH keypairs. -
200 Show server console URL. -
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 listKeyPairsCall( - @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) + public okhttp3.Call getServerConsoleCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -14332,7 +15861,17 @@ public okhttp3.Call listKeyPairsCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/keypairs"; + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/console" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -14340,11 +15879,6 @@ public okhttp3.Call listKeyPairsCall( 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) { @@ -14374,25 +15908,47 @@ public okhttp3.Call listKeyPairsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listKeyPairsValidateBeforeCall( - @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) + private okhttp3.Call getServerConsoleValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) throws ApiException { - return listKeyPairsCall(labelSelector, _callback); - } + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + "Missing the required parameter 'projectId' when calling getServerConsole(Async)"); + } - /** - * List all SSH keypairs for the requesting user. Get a list of all SSH keypairs assigned to the - * requesting user. - * - * @param labelSelector Filter resources by labels. (optional) - * @return KeyPairListResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getServerConsole(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling getServerConsole(Async)"); + } + + return getServerConsoleCall(projectId, region, serverId, _callback); + } + + /** + * Get server console. Get a URL for server remote console. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @return ServerConsoleUrl + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details * * * - * + * * * * @@ -14400,25 +15956,30 @@ private okhttp3.Call listKeyPairsValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List SSH keypairs. -
200 Show server console URL. -
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 KeyPairListResponse listKeyPairs(@javax.annotation.Nullable String labelSelector) + public ServerConsoleUrl getServerConsole( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) throws ApiException { - ApiResponse localVarResp = listKeyPairsWithHttpInfo(labelSelector); + ApiResponse localVarResp = + getServerConsoleWithHttpInfo(projectId, region, serverId); return localVarResp.getData(); } /** - * List all SSH keypairs for the requesting user. Get a list of all SSH keypairs assigned to the - * requesting user. + * Get server console. Get a URL for server remote console. * - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<KeyPairListResponse> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @return ApiResponse<ServerConsoleUrl> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -14426,18 +15987,23 @@ public KeyPairListResponse listKeyPairs(@javax.annotation.Nullable String labelS * *
Response Details
Status Code Description Response Headers
200 List SSH keypairs. -
200 Show server console URL. -
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 listKeyPairsWithHttpInfo( - @javax.annotation.Nullable String labelSelector) throws ApiException { - okhttp3.Call localVarCall = listKeyPairsValidateBeforeCall(labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse getServerConsoleWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) + throws ApiException { + okhttp3.Call localVarCall = + getServerConsoleValidateBeforeCall(projectId, region, serverId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all SSH keypairs for the requesting user. (asynchronously) Get a list of all SSH - * keypairs assigned to the requesting user. + * Get server console. (asynchronously) Get a URL for server remote console. * - * @param labelSelector Filter resources by labels. (optional) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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 @@ -14446,7 +16012,7 @@ public ApiResponse listKeyPairsWithHttpInfo( * * * - * + * * * * @@ -14454,23 +16020,28 @@ public ApiResponse listKeyPairsWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List SSH keypairs. -
200 Show server console URL. -
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 listKeyPairsAsync( - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + public okhttp3.Call getServerConsoleAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listKeyPairsValidateBeforeCall(labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getServerConsoleValidateBeforeCall(projectId, region, serverId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listMachineTypes + * Build call for getServerLog * * @param projectId The identifier (ID) of a STACKIT Project. (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 region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param length Request the server log. By default the length is limited to 2000 lines. Set to + * 0 to retrieve the complete log. (optional, default to 2000) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -14478,7 +16049,7 @@ public okhttp3.Call listKeyPairsAsync( * * * - * + * * * * @@ -14486,9 +16057,11 @@ public okhttp3.Call listKeyPairsAsync( * *
Response Details
Status Code Description Response Headers
200 List of machine types. -
200 Show server console log. -
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 listMachineTypesCall( + public okhttp3.Call getServerLogCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String filter, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Long length, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -14508,10 +16081,16 @@ public okhttp3.Call listMachineTypesCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/machine-types" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/log" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -14519,8 +16098,8 @@ public okhttp3.Call listMachineTypesCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (filter != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter)); + if (length != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("length", length)); } final String[] localVarAccepts = {"application/json"}; @@ -14552,35 +16131,50 @@ public okhttp3.Call listMachineTypesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listMachineTypesValidateBeforeCall( + private okhttp3.Call getServerLogValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String filter, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Long length, 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 listMachineTypes(Async)"); + "Missing the required parameter 'projectId' when calling getServerLog(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling getServerLog(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling getServerLog(Async)"); } - return listMachineTypesCall(projectId, filter, _callback); + return getServerLogCall(projectId, region, serverId, length, _callback); } /** - * List all machine types available for a project. Get a list of all machine type available in a - * project. + * Get server log. Get server console log. * * @param projectId The identifier (ID) of a STACKIT Project. (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 MachineTypeListResponse + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param length Request the server log. By default the length is limited to 2000 lines. Set to + * 0 to retrieve the complete log. (optional, default to 2000) + * @return GetServerLog200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -14588,29 +16182,33 @@ private okhttp3.Call listMachineTypesValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List of machine types. -
200 Show server console log. -
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 MachineTypeListResponse listMachineTypes( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nullable String filter) + public GetServerLog200Response getServerLog( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Long length) throws ApiException { - ApiResponse localVarResp = - listMachineTypesWithHttpInfo(projectId, filter); + ApiResponse localVarResp = + getServerLogWithHttpInfo(projectId, region, serverId, length); return localVarResp.getData(); } /** - * List all machine types available for a project. Get a list of all machine type available in a - * project. + * Get server log. Get server console log. * * @param projectId The identifier (ID) of a STACKIT Project. (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<MachineTypeListResponse> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param length Request the server log. By default the length is limited to 2000 lines. Set to + * 0 to retrieve the complete log. (optional, default to 2000) + * @return ApiResponse<GetServerLog200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -14618,21 +16216,26 @@ public MachineTypeListResponse listMachineTypes( * *
Response Details
Status Code Description Response Headers
200 List of machine types. -
200 Show server console log. -
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 listMachineTypesWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nullable String filter) + public ApiResponse getServerLogWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Long length) throws ApiException { - okhttp3.Call localVarCall = listMachineTypesValidateBeforeCall(projectId, filter, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + getServerLogValidateBeforeCall(projectId, region, serverId, length, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all machine types available for a project. (asynchronously) Get a list of all machine - * type available in a project. + * Get server log. (asynchronously) Get server console log. * * @param projectId The identifier (ID) of a STACKIT Project. (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 region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param length Request the server log. By default the length is limited to 2000 lines. Set to + * 0 to retrieve the complete log. (optional, default to 2000) * @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 @@ -14641,7 +16244,7 @@ public ApiResponse listMachineTypesWithHttpInfo( * * * - * + * * * * @@ -14649,24 +16252,27 @@ public ApiResponse listMachineTypesWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List of machine types. -
200 Show server console log. -
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 listMachineTypesAsync( + public okhttp3.Call getServerLogAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String filter, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Long length, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listMachineTypesValidateBeforeCall(projectId, filter, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getServerLogValidateBeforeCall(projectId, region, serverId, length, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listNetworkAreaProjects + * Build call for getSnapshot * - * @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 snapshotId The identifier (ID) of a STACKIT Snapshot. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -14674,7 +16280,7 @@ public okhttp3.Call listMachineTypesAsync( * * * - * + * * * * @@ -14682,9 +16288,10 @@ public okhttp3.Call listMachineTypesAsync( * *
Response Details
Status Code Description Response Headers
200 List projects for a network area. -
200 Show snapshot 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 listNetworkAreaProjectsCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + public okhttp3.Call getSnapshotCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID snapshotId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -14704,13 +16311,16 @@ public okhttp3.Call listNetworkAreaProjectsCall( // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}/projects" + "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "snapshotId" + "}", + localVarApiClient.escapeString(snapshotId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -14747,39 +16357,47 @@ public okhttp3.Call listNetworkAreaProjectsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listNetworkAreaProjectsValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + private okhttp3.Call getSnapshotValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID snapshotId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling listNetworkAreaProjects(Async)"); + "Missing the required parameter 'projectId' when calling getSnapshot(Async)"); } - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling listNetworkAreaProjects(Async)"); + "Missing the required parameter 'region' when calling getSnapshot(Async)"); } - return listNetworkAreaProjectsCall(organizationId, areaId, _callback); + // verify the required parameter 'snapshotId' is set + if (snapshotId == null) { + throw new ApiException( + "Missing the required parameter 'snapshotId' when calling getSnapshot(Async)"); + } + + return getSnapshotCall(projectId, region, snapshotId, _callback); } /** - * List all projects using a network area. Get a list of all projects using a network area. + * Get details about a snapshot. Get details about a block device snapshot. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @return ProjectListResponse + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) + * @return Snapshot * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -14787,27 +16405,29 @@ private okhttp3.Call listNetworkAreaProjectsValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List projects for a network area. -
200 Show snapshot 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 ProjectListResponse listNetworkAreaProjects( - @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + public Snapshot getSnapshot( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID snapshotId) throws ApiException { - ApiResponse localVarResp = - listNetworkAreaProjectsWithHttpInfo(organizationId, areaId); + ApiResponse localVarResp = getSnapshotWithHttpInfo(projectId, region, snapshotId); return localVarResp.getData(); } /** - * List all projects using a network area. Get a list of all projects using a network area. + * Get details about a snapshot. Get details about a block device snapshot. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @return ApiResponse<ProjectListResponse> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) + * @return ApiResponse<Snapshot> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -14815,21 +16435,23 @@ public ProjectListResponse listNetworkAreaProjects( * *
Response Details
Status Code Description Response Headers
200 List projects for a network area. -
200 Show snapshot 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 ApiResponse listNetworkAreaProjectsWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + public ApiResponse getSnapshotWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID snapshotId) throws ApiException { okhttp3.Call localVarCall = - listNetworkAreaProjectsValidateBeforeCall(organizationId, areaId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + getSnapshotValidateBeforeCall(projectId, region, snapshotId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all projects using a network area. (asynchronously) Get a list of all projects using a - * network area. + * Get details about a snapshot. (asynchronously) Get details about a block device snapshot. * - * @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 snapshotId The identifier (ID) of a STACKIT Snapshot. (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 @@ -14838,7 +16460,7 @@ public ApiResponse listNetworkAreaProjectsWithHttpInfo( * * * - * + * * * * @@ -14846,24 +16468,26 @@ public ApiResponse listNetworkAreaProjectsWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List projects for a network area. -
200 Show snapshot 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 listNetworkAreaProjectsAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listNetworkAreaProjectsValidateBeforeCall(organizationId, areaId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + public okhttp3.Call getSnapshotAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID snapshotId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getSnapshotValidateBeforeCall(projectId, region, snapshotId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listNetworkAreaRanges + * Build call for getVolume * - * @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 volumeId The identifier (ID) of a STACKIT Volume. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -14871,7 +16495,7 @@ public okhttp3.Call listNetworkAreaProjectsAsync( * * * - * + * * * * @@ -14879,9 +16503,10 @@ public okhttp3.Call listNetworkAreaProjectsAsync( * *
Response Details
Status Code Description Response Headers
200 List all network ranges. -
200 Show volume 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 listNetworkAreaRangesCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + public okhttp3.Call getVolumeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -14901,13 +16526,16 @@ public okhttp3.Call listNetworkAreaRangesCall( // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "volumeId" + "}", + localVarApiClient.escapeString(volumeId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -14944,40 +16572,47 @@ public okhttp3.Call listNetworkAreaRangesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listNetworkAreaRangesValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, + private okhttp3.Call getVolumeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling listNetworkAreaRanges(Async)"); + "Missing the required parameter 'projectId' when calling getVolume(Async)"); } - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling listNetworkAreaRanges(Async)"); + "Missing the required parameter 'region' when calling getVolume(Async)"); } - return listNetworkAreaRangesCall(organizationId, areaId, _callback); + // verify the required parameter 'volumeId' is set + if (volumeId == null) { + throw new ApiException( + "Missing the required parameter 'volumeId' when calling getVolume(Async)"); + } + + return getVolumeCall(projectId, region, volumeId, _callback); } /** - * List all network ranges in a network area. Get a list of all network ranges in a network - * area. + * Get details about a volume. Get details about a block device volume. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @return NetworkRangeListResponse + * @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) + * @return Volume * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -14985,28 +16620,29 @@ private okhttp3.Call listNetworkAreaRangesValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List all network ranges. -
200 Show volume 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 NetworkRangeListResponse listNetworkAreaRanges( - @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + public Volume getVolume( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId) throws ApiException { - ApiResponse localVarResp = - listNetworkAreaRangesWithHttpInfo(organizationId, areaId); + ApiResponse localVarResp = getVolumeWithHttpInfo(projectId, region, volumeId); return localVarResp.getData(); } /** - * List all network ranges in a network area. Get a list of all network ranges in a network - * area. + * Get details about a volume. Get details about a block device volume. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @return ApiResponse<NetworkRangeListResponse> + * @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) + * @return ApiResponse<Volume> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -15014,21 +16650,22 @@ public NetworkRangeListResponse listNetworkAreaRanges( * *
Response Details
Status Code Description Response Headers
200 List all network ranges. -
200 Show volume 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 ApiResponse listNetworkAreaRangesWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + public ApiResponse getVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId) throws ApiException { - okhttp3.Call localVarCall = - listNetworkAreaRangesValidateBeforeCall(organizationId, areaId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getVolumeValidateBeforeCall(projectId, region, volumeId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all network ranges in a network area. (asynchronously) Get a list of all network ranges - * in a network area. + * Get details about a volume. (asynchronously) Get details about a block device volume. * - * @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 volumeId The identifier (ID) of a STACKIT Volume. (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 @@ -15037,7 +16674,7 @@ public ApiResponse listNetworkAreaRangesWithHttpInfo( * * * - * + * * * * @@ -15045,25 +16682,26 @@ public ApiResponse listNetworkAreaRangesWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List all network ranges. -
200 Show volume 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 listNetworkAreaRangesAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - final ApiCallback _callback) + public okhttp3.Call getVolumeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listNetworkAreaRangesValidateBeforeCall(organizationId, areaId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getVolumeValidateBeforeCall(projectId, region, volumeId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listNetworkAreaRoutes + * Build call for getVolumePerformanceClass * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param volumePerformanceClass The name of a STACKIT Volume performance class. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -15071,7 +16709,7 @@ public okhttp3.Call listNetworkAreaRangesAsync( * * * - * + * * * * @@ -15079,10 +16717,10 @@ public okhttp3.Call listNetworkAreaRangesAsync( * *
Response Details
Status Code Description Response Headers
200 List network routes. -
200 Show volume performance class 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 listNetworkAreaRoutesCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nullable String labelSelector, + public okhttp3.Call getVolumePerformanceClassCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String volumePerformanceClass, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -15102,13 +16740,16 @@ public okhttp3.Call listNetworkAreaRoutesCall( // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}/routes" + "/v2/projects/{projectId}/regions/{region}/volume-performance-classes/{volumePerformanceClass}" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "volumePerformanceClass" + "}", + localVarApiClient.escapeString(volumePerformanceClass.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -15116,11 +16757,6 @@ public okhttp3.Call listNetworkAreaRoutesCall( 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) { @@ -15150,42 +16786,48 @@ public okhttp3.Call listNetworkAreaRoutesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listNetworkAreaRoutesValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nullable String labelSelector, + private okhttp3.Call getVolumePerformanceClassValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String volumePerformanceClass, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling listNetworkAreaRoutes(Async)"); + "Missing the required parameter 'projectId' when calling getVolumePerformanceClass(Async)"); } - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling listNetworkAreaRoutes(Async)"); + "Missing the required parameter 'region' when calling getVolumePerformanceClass(Async)"); + } + + // verify the required parameter 'volumePerformanceClass' is set + if (volumePerformanceClass == null) { + throw new ApiException( + "Missing the required parameter 'volumePerformanceClass' when calling getVolumePerformanceClass(Async)"); } - return listNetworkAreaRoutesCall(organizationId, areaId, labelSelector, _callback); + return getVolumePerformanceClassCall(projectId, region, volumePerformanceClass, _callback); } /** - * List all network routes in a network area. Get a list of all network routes defined in a - * network area. + * Get details about a volume performance class. Get details about a specific volume performance + * class. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return RouteListResponse + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param volumePerformanceClass The name of a STACKIT Volume performance class. (required) + * @return VolumePerformanceClass * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -15193,31 +16835,31 @@ private okhttp3.Call listNetworkAreaRoutesValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List network routes. -
200 Show volume performance class 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 RouteListResponse listNetworkAreaRoutes( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nullable String labelSelector) + public VolumePerformanceClass getVolumePerformanceClass( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String volumePerformanceClass) throws ApiException { - ApiResponse localVarResp = - listNetworkAreaRoutesWithHttpInfo(organizationId, areaId, labelSelector); + ApiResponse localVarResp = + getVolumePerformanceClassWithHttpInfo(projectId, region, volumePerformanceClass); return localVarResp.getData(); } /** - * List all network routes in a network area. Get a list of all network routes defined in a - * network area. + * Get details about a volume performance class. Get details about a specific volume performance + * class. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<RouteListResponse> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param volumePerformanceClass The name of a STACKIT Volume performance class. (required) + * @return ApiResponse<VolumePerformanceClass> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -15225,25 +16867,25 @@ public RouteListResponse listNetworkAreaRoutes( * *
Response Details
Status Code Description Response Headers
200 List network routes. -
200 Show volume performance class 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 ApiResponse listNetworkAreaRoutesWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nullable String labelSelector) + public ApiResponse getVolumePerformanceClassWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String volumePerformanceClass) throws ApiException { okhttp3.Call localVarCall = - listNetworkAreaRoutesValidateBeforeCall( - organizationId, areaId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + getVolumePerformanceClassValidateBeforeCall( + projectId, region, volumePerformanceClass, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all network routes in a network area. (asynchronously) Get a list of all network routes - * defined in a network area. + * Get details about a volume performance class. (asynchronously) Get details about a specific + * volume performance class. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param volumePerformanceClass The name of a STACKIT Volume performance class. (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 @@ -15252,7 +16894,7 @@ public ApiResponse listNetworkAreaRoutesWithHttpInfo( * * * - * + * * * * @@ -15260,26 +16902,28 @@ public ApiResponse listNetworkAreaRoutesWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List network routes. -
200 Show volume performance class 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 listNetworkAreaRoutesAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + public okhttp3.Call getVolumePerformanceClassAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull String volumePerformanceClass, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listNetworkAreaRoutesValidateBeforeCall( - organizationId, areaId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + getVolumePerformanceClassValidateBeforeCall( + projectId, region, volumePerformanceClass, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listNetworkAreas + * Build call for imageFromVolume * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageFromVolumePayload Create an image from a volume. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -15287,17 +16931,20 @@ public okhttp3.Call listNetworkAreaRoutesAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Get a list of all network areas. -
201 Image creation details. -
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 listNetworkAreasCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nullable String labelSelector, + public okhttp3.Call imageFromVolumeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable ImageFromVolumePayload imageFromVolumePayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -15313,14 +16960,20 @@ public okhttp3.Call listNetworkAreasCall( basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = imageFromVolumePayload; // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas" + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}/upload" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())); + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "volumeId" + "}", + localVarApiClient.escapeString(volumeId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -15328,18 +16981,13 @@ public okhttp3.Call listNetworkAreasCall( 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[] localVarContentTypes = {"application/json"}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -15350,7 +16998,7 @@ public okhttp3.Call listNetworkAreasCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -15362,87 +17010,111 @@ public okhttp3.Call listNetworkAreasCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listNetworkAreasValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nullable String labelSelector, + private okhttp3.Call imageFromVolumeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable ImageFromVolumePayload imageFromVolumePayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling listNetworkAreas(Async)"); + "Missing the required parameter 'projectId' when calling imageFromVolume(Async)"); } - return listNetworkAreasCall(organizationId, labelSelector, _callback); + // verify the required parameter 'volumeId' is set + if (volumeId == null) { + throw new ApiException( + "Missing the required parameter 'volumeId' when calling imageFromVolume(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling imageFromVolume(Async)"); + } + + return imageFromVolumeCall(projectId, volumeId, region, imageFromVolumePayload, _callback); } /** - * List all network areas in an organization. Get a list of all visible network areas defined in - * an organization. + * Create an image out of a volume. Create an image out a a volume. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return NetworkAreaListResponse + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageFromVolumePayload Create an image from a volume. (optional) + * @return Image * @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 a list of all network areas. -
201 Image creation details. -
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 NetworkAreaListResponse listNetworkAreas( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nullable String labelSelector) + public Image imageFromVolume( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable ImageFromVolumePayload imageFromVolumePayload) throws ApiException { - ApiResponse localVarResp = - listNetworkAreasWithHttpInfo(organizationId, labelSelector); + ApiResponse localVarResp = + imageFromVolumeWithHttpInfo(projectId, volumeId, region, imageFromVolumePayload); return localVarResp.getData(); } /** - * List all network areas in an organization. Get a list of all visible network areas defined in - * an organization. + * Create an image out of a volume. Create an image out a a volume. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<NetworkAreaListResponse> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageFromVolumePayload Create an image from a volume. (optional) + * @return ApiResponse<Image> * @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 a list of all network areas. -
201 Image creation details. -
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 listNetworkAreasWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nullable String labelSelector) + public ApiResponse imageFromVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable ImageFromVolumePayload imageFromVolumePayload) throws ApiException { okhttp3.Call localVarCall = - listNetworkAreasValidateBeforeCall(organizationId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + imageFromVolumeValidateBeforeCall( + projectId, volumeId, region, imageFromVolumePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all network areas in an organization. (asynchronously) Get a list of all visible network - * areas defined in an organization. + * Create an image out of a volume. (asynchronously) Create an image out a a volume. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageFromVolumePayload Create an image from a volume. (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 @@ -15451,32 +17123,36 @@ public ApiResponse listNetworkAreasWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Get a list of all network areas. -
201 Image creation details. -
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 listNetworkAreasAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + public okhttp3.Call imageFromVolumeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable ImageFromVolumePayload imageFromVolumePayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listNetworkAreasValidateBeforeCall(organizationId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + imageFromVolumeValidateBeforeCall( + projectId, volumeId, region, imageFromVolumePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listNetworks + * Build call for listAffinityGroups * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param region The STACKIT Region of the resources. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -15484,17 +17160,18 @@ public okhttp3.Call listNetworkAreasAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 List all networks of a project. -
200 List affinity groups. -
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 listNetworksCall( + public okhttp3.Call listAffinityGroupsCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -15514,10 +17191,13 @@ public okhttp3.Call listNetworksCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/networks" + "/v2/projects/{projectId}/regions/{region}/affinity-groups" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -15525,11 +17205,6 @@ public okhttp3.Call listNetworksCall( 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) { @@ -15559,84 +17234,98 @@ public okhttp3.Call listNetworksCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listNetworksValidateBeforeCall( + private okhttp3.Call listAffinityGroupsValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { // verify the required parameter 'projectId' is set if (projectId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling listNetworks(Async)"); + "Missing the required parameter 'projectId' when calling listAffinityGroups(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling listAffinityGroups(Async)"); } - return listNetworksCall(projectId, labelSelector, _callback); + return listAffinityGroupsCall(projectId, region, _callback); } /** - * List all networks inside a project. Get a list of all networks inside a project. + * Get the affinity groups setup for a project. Get the affinity groups created in a project. + * Affinity groups are an indication of locality of a server relative to another group of + * servers. They can be either running on the same host (affinity) or on different ones + * (anti-affinity). * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return NetworkListResponse + * @param region The STACKIT Region of the resources. (required) + * @return AffinityGroupListResponse * @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 networks of a project. -
200 List affinity groups. -
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 NetworkListResponse listNetworks( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector) + public AffinityGroupListResponse listAffinityGroups( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String region) throws ApiException { - ApiResponse localVarResp = - listNetworksWithHttpInfo(projectId, labelSelector); + ApiResponse localVarResp = + listAffinityGroupsWithHttpInfo(projectId, region); return localVarResp.getData(); } /** - * List all networks inside a project. Get a list of all networks inside a project. + * Get the affinity groups setup for a project. Get the affinity groups created in a project. + * Affinity groups are an indication of locality of a server relative to another group of + * servers. They can be either running on the same host (affinity) or on different ones + * (anti-affinity). * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<NetworkListResponse> + * @param region The STACKIT Region of the resources. (required) + * @return ApiResponse<AffinityGroupListResponse> * @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 networks of a project. -
200 List affinity groups. -
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 listNetworksWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector) + public ApiResponse listAffinityGroupsWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String region) throws ApiException { - okhttp3.Call localVarCall = listNetworksValidateBeforeCall(projectId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = listAffinityGroupsValidateBeforeCall(projectId, region, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all networks inside a project. (asynchronously) Get a list of all networks inside a - * project. + * Get the affinity groups setup for a project. (asynchronously) Get the affinity groups created + * in a project. Affinity groups are an indication of locality of a server relative to another + * group of servers. They can be either running on the same host (affinity) or on different ones + * (anti-affinity). * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param region The STACKIT Region of the resources. (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 @@ -15645,33 +17334,34 @@ public ApiResponse listNetworksWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 List all networks of a project. -
200 List affinity groups. -
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 listNetworksAsync( + public okhttp3.Call listAffinityGroupsAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listNetworksValidateBeforeCall(projectId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listAffinityGroupsValidateBeforeCall(projectId, region, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listNics + * Build call for listAttachedVolumes * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -15679,7 +17369,7 @@ public okhttp3.Call listNetworksAsync( * * * - * + * * * * @@ -15687,10 +17377,10 @@ public okhttp3.Call listNetworksAsync( * *
Response Details
Status Code Description Response Headers
200 List network interfaces of the network. -
200 List volume attachments. -
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 listNicsCall( + public okhttp3.Call listAttachedVolumesCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nullable String labelSelector, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -15710,13 +17400,16 @@ public okhttp3.Call listNicsCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/networks/{networkId}/nics" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -15724,11 +17417,6 @@ public okhttp3.Call listNicsCall( 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) { @@ -15758,42 +17446,47 @@ public okhttp3.Call listNicsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listNicsValidateBeforeCall( + private okhttp3.Call listAttachedVolumesValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nullable String labelSelector, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, 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 listNics(Async)"); + "Missing the required parameter 'projectId' when calling listAttachedVolumes(Async)"); } - // verify the required parameter 'networkId' is set - if (networkId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'networkId' when calling listNics(Async)"); + "Missing the required parameter 'region' when calling listAttachedVolumes(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling listAttachedVolumes(Async)"); } - return listNicsCall(projectId, networkId, labelSelector, _callback); + return listAttachedVolumesCall(projectId, region, serverId, _callback); } /** - * List all network interfaces inside a network. Get a list of all network interfaces inside a - * network. + * List all volume attachments of a server. Get a list of all volume attachments of a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return NICListResponse + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @return VolumeAttachmentListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -15801,31 +17494,30 @@ private okhttp3.Call listNicsValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List network interfaces of the network. -
200 List volume attachments. -
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 NICListResponse listNics( + public VolumeAttachmentListResponse listAttachedVolumes( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nullable String labelSelector) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) throws ApiException { - ApiResponse localVarResp = - listNicsWithHttpInfo(projectId, networkId, labelSelector); + ApiResponse localVarResp = + listAttachedVolumesWithHttpInfo(projectId, region, serverId); return localVarResp.getData(); } /** - * List all network interfaces inside a network. Get a list of all network interfaces inside a - * network. + * List all volume attachments of a server. Get a list of all volume attachments of a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<NICListResponse> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @return ApiResponse<VolumeAttachmentListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -15833,24 +17525,24 @@ public NICListResponse listNics( * *
Response Details
Status Code Description Response Headers
200 List network interfaces of the network. -
200 List volume attachments. -
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 listNicsWithHttpInfo( + public ApiResponse listAttachedVolumesWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nullable String labelSelector) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) throws ApiException { okhttp3.Call localVarCall = - listNicsValidateBeforeCall(projectId, networkId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + listAttachedVolumesValidateBeforeCall(projectId, region, serverId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all network interfaces inside a network. (asynchronously) Get a list of all network - * interfaces inside a network. + * List all volume attachments of a server. (asynchronously) Get a list of all volume + * attachments of a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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 @@ -15859,7 +17551,7 @@ public ApiResponse listNicsWithHttpInfo( * * * - * + * * * * @@ -15867,25 +17559,24 @@ public ApiResponse listNicsWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List network interfaces of the network. -
200 List volume attachments. -
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 listNicsAsync( + public okhttp3.Call listAttachedVolumesAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listNicsValidateBeforeCall(projectId, networkId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listAttachedVolumesValidateBeforeCall(projectId, region, serverId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listProjectNICs + * Build call for listAvailabilityZones * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param region The STACKIT Region of the resources. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -15893,7 +17584,7 @@ public okhttp3.Call listNicsAsync( * * * - * + * * * * @@ -15901,10 +17592,8 @@ public okhttp3.Call listNicsAsync( * *
Response Details
Status Code Description Response Headers
200 List network interfaces of the project. -
200 Get a list of availability zones. -
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 listProjectNICsCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + public okhttp3.Call listAvailabilityZonesCall( + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -15923,10 +17612,10 @@ public okhttp3.Call listProjectNICsCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/nics" + "/v2/regions/{region}/availability-zones" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -15934,11 +17623,6 @@ public okhttp3.Call listProjectNICsCall( 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) { @@ -15968,34 +17652,30 @@ public okhttp3.Call listProjectNICsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listProjectNICsValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + private okhttp3.Call listAvailabilityZonesValidateBeforeCall( + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling listProjectNICs(Async)"); + "Missing the required parameter 'region' when calling listAvailabilityZones(Async)"); } - return listProjectNICsCall(projectId, labelSelector, _callback); + return listAvailabilityZonesCall(region, _callback); } /** - * List all network interfaces inside a project. Get a list of all network interfaces inside a - * project. + * List all availability zones. Get a list of all availability zones. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return NICListResponse + * @param region The STACKIT Region of the resources. (required) + * @return AvailabilityZoneListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16003,29 +17683,25 @@ private okhttp3.Call listProjectNICsValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List network interfaces of the project. -
200 Get a list of availability zones. -
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 NICListResponse listProjectNICs( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - ApiResponse localVarResp = - listProjectNICsWithHttpInfo(projectId, labelSelector); + public AvailabilityZoneListResponse listAvailabilityZones( + @javax.annotation.Nonnull String region) throws ApiException { + ApiResponse localVarResp = + listAvailabilityZonesWithHttpInfo(region); return localVarResp.getData(); } /** - * List all network interfaces inside a project. Get a list of all network interfaces inside a - * project. + * List all availability zones. Get a list of all availability zones. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<NICListResponse> + * @param region The STACKIT Region of the resources. (required) + * @return ApiResponse<AvailabilityZoneListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16033,22 +17709,17 @@ public NICListResponse listProjectNICs( * *
Response Details
Status Code Description Response Headers
200 List network interfaces of the project. -
200 Get a list of availability zones. -
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 listProjectNICsWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector) - throws ApiException { - okhttp3.Call localVarCall = - listProjectNICsValidateBeforeCall(projectId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse listAvailabilityZonesWithHttpInfo( + @javax.annotation.Nonnull String region) throws ApiException { + okhttp3.Call localVarCall = listAvailabilityZonesValidateBeforeCall(region, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all network interfaces inside a project. (asynchronously) Get a list of all network - * interfaces inside a project. + * List all availability zones. (asynchronously) Get a list of all availability zones. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param region The STACKIT Region of the resources. (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 @@ -16057,7 +17728,7 @@ public ApiResponse listProjectNICsWithHttpInfo( * * * - * + * * * * @@ -16065,22 +17736,23 @@ public ApiResponse listProjectNICsWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List network interfaces of the project. -
200 Get a list of availability zones. -
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 listProjectNICsAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + public okhttp3.Call listAvailabilityZonesAsync( + @javax.annotation.Nonnull String region, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = - listProjectNICsValidateBeforeCall(projectId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = listAvailabilityZonesValidateBeforeCall(region, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listPublicIPRanges + * Build call for listBackups * + * @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 @@ -16088,7 +17760,7 @@ public okhttp3.Call listProjectNICsAsync( * * * - * + * * * * @@ -16096,7 +17768,12 @@ public okhttp3.Call listProjectNICsAsync( * *
Response Details
Status Code Description Response Headers
200 List public IP ranges. -
200 List project backups. -
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 listPublicIPRangesCall(final ApiCallback _callback) throws ApiException { + public okhttp3.Call listBackupsCall( + @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[] {}; @@ -16113,7 +17790,14 @@ public okhttp3.Call listPublicIPRangesCall(final ApiCallback _callback) throws A Object localVarPostBody = null; // create path and map variables - String localVarPath = "/v1/networks/public-ip-ranges"; + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/backups" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -16121,6 +17805,11 @@ public okhttp3.Call listPublicIPRangesCall(final ApiCallback _callback) throws A 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) { @@ -16150,22 +17839,41 @@ public okhttp3.Call listPublicIPRangesCall(final ApiCallback _callback) throws A } @SuppressWarnings("rawtypes") - private okhttp3.Call listPublicIPRangesValidateBeforeCall(final ApiCallback _callback) + private okhttp3.Call listBackupsValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { - return listPublicIPRangesCall(_callback); + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + "Missing the required parameter 'projectId' when calling listBackups(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling listBackups(Async)"); + } + + return listBackupsCall(projectId, region, labelSelector, _callback); } /** - * List all public IP ranges. Get a list of all public IP ranges that STACKIT uses. + * List all backups inside a project. Get a list of all backups inside a project. * - * @return PublicNetworkListResponse + * @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) + * @return BackupListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16173,22 +17881,30 @@ private okhttp3.Call listPublicIPRangesValidateBeforeCall(final ApiCallback _cal * *
Response Details
Status Code Description Response Headers
200 List public IP ranges. -
200 List project backups. -
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 PublicNetworkListResponse listPublicIPRanges() throws ApiException { - ApiResponse localVarResp = listPublicIPRangesWithHttpInfo(); + public BackupListResponse listBackups( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listBackupsWithHttpInfo(projectId, region, labelSelector); return localVarResp.getData(); } /** - * List all public IP ranges. Get a list of all public IP ranges that STACKIT uses. + * List all backups inside a project. Get a list of all backups inside a project. * - * @return ApiResponse<PublicNetworkListResponse> + * @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) + * @return ApiResponse<BackupListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16196,17 +17912,24 @@ public PublicNetworkListResponse listPublicIPRanges() throws ApiException { * *
Response Details
Status Code Description Response Headers
200 List public IP ranges. -
200 List project backups. -
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 listPublicIPRangesWithHttpInfo() + public ApiResponse listBackupsWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { - okhttp3.Call localVarCall = listPublicIPRangesValidateBeforeCall(null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + listBackupsValidateBeforeCall(projectId, region, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all public IP ranges. (asynchronously) Get a list of all public IP ranges that STACKIT - * uses. + * List all backups inside a project. (asynchronously) Get a list of all backups inside a + * project. * + * @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 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 @@ -16215,7 +17938,7 @@ public ApiResponse listPublicIPRangesWithHttpInfo() * * * - * + * * * * @@ -16223,19 +17946,26 @@ public ApiResponse listPublicIPRangesWithHttpInfo() * *
Response Details
Status Code Description Response Headers
200 List public IP ranges. -
200 List project backups. -
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 listPublicIPRangesAsync( - final ApiCallback _callback) throws ApiException { + public okhttp3.Call listBackupsAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = listPublicIPRangesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + listBackupsValidateBeforeCall(projectId, region, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listPublicIPs + * Build call for listImages * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param all List all Images. (optional, default to false) * @param labelSelector Filter resources by labels. (optional) * @param _callback Callback for upload/download progress * @return Call to execute @@ -16244,7 +17974,7 @@ public okhttp3.Call listPublicIPRangesAsync( * * * - * + * * * * @@ -16252,8 +17982,10 @@ public okhttp3.Call listPublicIPRangesAsync( * *
Response Details
Status Code Description Response Headers
200 List project public IPs. -
200 List project images. -
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 listPublicIPsCall( + public okhttp3.Call listImagesCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable Boolean all, @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { @@ -16274,10 +18006,13 @@ public okhttp3.Call listPublicIPsCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/public-ips" + "/v2/projects/{projectId}/regions/{region}/images" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -16285,6 +18020,10 @@ public okhttp3.Call listPublicIPsCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (all != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("all", all)); + } + if (labelSelector != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("label_selector", labelSelector)); @@ -16319,33 +18058,43 @@ public okhttp3.Call listPublicIPsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listPublicIPsValidateBeforeCall( + private okhttp3.Call listImagesValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable Boolean all, @javax.annotation.Nullable String labelSelector, 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 listPublicIPs(Async)"); + "Missing the required parameter 'projectId' when calling listImages(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling listImages(Async)"); } - return listPublicIPsCall(projectId, labelSelector, _callback); + return listImagesCall(projectId, region, all, labelSelector, _callback); } /** - * List all public IPs inside a project. Get a list of all public IPs inside a project. + * List all Images inside a project. Get a list of all images inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param all List all Images. (optional, default to false) * @param labelSelector Filter resources by labels. (optional) - * @return PublicIpListResponse + * @return ImageListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16353,28 +18102,32 @@ private okhttp3.Call listPublicIPsValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List project public IPs. -
200 List project images. -
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 PublicIpListResponse listPublicIPs( + public ImageListResponse listImages( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable Boolean all, @javax.annotation.Nullable String labelSelector) throws ApiException { - ApiResponse localVarResp = - listPublicIPsWithHttpInfo(projectId, labelSelector); + ApiResponse localVarResp = + listImagesWithHttpInfo(projectId, region, all, labelSelector); return localVarResp.getData(); } /** - * List all public IPs inside a project. Get a list of all public IPs inside a project. + * List all Images inside a project. Get a list of all images inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param all List all Images. (optional, default to false) * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<PublicIpListResponse> + * @return ApiResponse<ImageListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16382,20 +18135,24 @@ public PublicIpListResponse listPublicIPs( * *
Response Details
Status Code Description Response Headers
200 List project public IPs. -
200 List project images. -
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 listPublicIPsWithHttpInfo( + public ApiResponse listImagesWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable Boolean all, @javax.annotation.Nullable String labelSelector) throws ApiException { - okhttp3.Call localVarCall = listPublicIPsValidateBeforeCall(projectId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + listImagesValidateBeforeCall(projectId, region, all, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all public IPs inside a project. (asynchronously) Get a list of all public IPs inside a - * project. + * List all Images inside a project. (asynchronously) Get a list of all images inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param all List all Images. (optional, default to false) * @param labelSelector Filter resources by labels. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -16405,7 +18162,7 @@ public ApiResponse listPublicIPsWithHttpInfo( * * * - * + * * * * @@ -16413,23 +18170,25 @@ public ApiResponse listPublicIPsWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List project public IPs. -
200 List project images. -
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 listPublicIPsAsync( + public okhttp3.Call listImagesAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable Boolean all, @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listPublicIPsValidateBeforeCall(projectId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listImagesValidateBeforeCall(projectId, region, all, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listQuotas + * Build call for listKeyPairs * - * @param projectId The identifier (ID) of a STACKIT Project. (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 @@ -16437,7 +18196,7 @@ public okhttp3.Call listPublicIPsAsync( * * * - * + * * * * @@ -16445,8 +18204,8 @@ public okhttp3.Call listPublicIPsAsync( * *
Response Details
Status Code Description Response Headers
200 List quotas. -
200 List SSH keypairs. -
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 listQuotasCall( - @javax.annotation.Nonnull UUID projectId, final ApiCallback _callback) + public okhttp3.Call listKeyPairsCall( + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -16464,11 +18223,7 @@ public okhttp3.Call listQuotasCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = - "/v1/projects/{projectId}/quotas" - .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + String localVarPath = "/v2/keypairs"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -16476,6 +18231,11 @@ public okhttp3.Call listQuotasCall( 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) { @@ -16505,30 +18265,25 @@ public okhttp3.Call listQuotasCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listQuotasValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, final ApiCallback _callback) + private okhttp3.Call listKeyPairsValidateBeforeCall( + @javax.annotation.Nullable String labelSelector, 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 listQuotas(Async)"); - } - - return listQuotasCall(projectId, _callback); + return listKeyPairsCall(labelSelector, _callback); } /** - * List project quotas. List quota limits and usage for project resources. + * List all SSH keypairs for the requesting user. Get a list of all SSH keypairs assigned to the + * requesting user. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @return QuotaListResponse + * @param labelSelector Filter resources by labels. (optional) + * @return KeyPairListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16536,24 +18291,25 @@ private okhttp3.Call listQuotasValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List quotas. -
200 List SSH keypairs. -
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 QuotaListResponse listQuotas(@javax.annotation.Nonnull UUID projectId) + public KeyPairListResponse listKeyPairs(@javax.annotation.Nullable String labelSelector) throws ApiException { - ApiResponse localVarResp = listQuotasWithHttpInfo(projectId); + ApiResponse localVarResp = listKeyPairsWithHttpInfo(labelSelector); return localVarResp.getData(); } /** - * List project quotas. List quota limits and usage for project resources. + * List all SSH keypairs for the requesting user. Get a list of all SSH keypairs assigned to the + * requesting user. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @return ApiResponse<QuotaListResponse> + * @param labelSelector Filter resources by labels. (optional) + * @return ApiResponse<KeyPairListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16561,17 +18317,18 @@ public QuotaListResponse listQuotas(@javax.annotation.Nonnull UUID projectId) * *
Response Details
Status Code Description Response Headers
200 List quotas. -
200 List SSH keypairs. -
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 listQuotasWithHttpInfo( - @javax.annotation.Nonnull UUID projectId) throws ApiException { - okhttp3.Call localVarCall = listQuotasValidateBeforeCall(projectId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse listKeyPairsWithHttpInfo( + @javax.annotation.Nullable String labelSelector) throws ApiException { + okhttp3.Call localVarCall = listKeyPairsValidateBeforeCall(labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List project quotas. (asynchronously) List quota limits and usage for project resources. + * List all SSH keypairs for the requesting user. (asynchronously) Get a list of all SSH + * keypairs assigned to the requesting user. * - * @param projectId The identifier (ID) of a STACKIT Project. (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 @@ -16580,7 +18337,7 @@ public ApiResponse listQuotasWithHttpInfo( * * * - * + * * * * @@ -16588,22 +18345,24 @@ public ApiResponse listQuotasWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List quotas. -
200 List SSH keypairs. -
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 listQuotasAsync( - @javax.annotation.Nonnull UUID projectId, - final ApiCallback _callback) + public okhttp3.Call listKeyPairsAsync( + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listQuotasValidateBeforeCall(projectId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = listKeyPairsValidateBeforeCall(labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listSecurityGroupRules + * Build call for listMachineTypes * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param region The STACKIT Region of the resources. (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 @@ -16611,7 +18370,7 @@ public okhttp3.Call listQuotasAsync( * * * - * + * * * * @@ -16619,9 +18378,10 @@ public okhttp3.Call listQuotasAsync( * *
Response Details
Status Code Description Response Headers
200 List all rules of a security group. -
200 List of machine types. -
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 listSecurityGroupRulesCall( + public okhttp3.Call listMachineTypesCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String filter, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -16641,13 +18401,13 @@ public okhttp3.Call listSecurityGroupRulesCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules" + "/v2/projects/{projectId}/regions/{region}/machine-types" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "securityGroupId" + "}", - localVarApiClient.escapeString(securityGroupId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -16655,6 +18415,10 @@ public okhttp3.Call listSecurityGroupRulesCall( 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) { @@ -16684,39 +18448,43 @@ public okhttp3.Call listSecurityGroupRulesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listSecurityGroupRulesValidateBeforeCall( + private okhttp3.Call listMachineTypesValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String filter, 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 listSecurityGroupRules(Async)"); + "Missing the required parameter 'projectId' when calling listMachineTypes(Async)"); } - // verify the required parameter 'securityGroupId' is set - if (securityGroupId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'securityGroupId' when calling listSecurityGroupRules(Async)"); + "Missing the required parameter 'region' when calling listMachineTypes(Async)"); } - return listSecurityGroupRulesCall(projectId, securityGroupId, _callback); + return listMachineTypesCall(projectId, region, filter, _callback); } /** - * List all rules for a security group. Get a list of all rules inside a security group. + * List all machine types available for a project. Get a list of all machine type available in a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @return SecurityGroupRuleListResponse + * @param region The STACKIT Region of the resources. (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 MachineTypeListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16724,28 +18492,32 @@ private okhttp3.Call listSecurityGroupRulesValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List all rules of a security group. -
200 List of machine types. -
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 SecurityGroupRuleListResponse listSecurityGroupRules( + public MachineTypeListResponse listMachineTypes( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String filter) throws ApiException { - ApiResponse localVarResp = - listSecurityGroupRulesWithHttpInfo(projectId, securityGroupId); + ApiResponse localVarResp = + listMachineTypesWithHttpInfo(projectId, region, filter); return localVarResp.getData(); } /** - * List all rules for a security group. Get a list of all rules inside a security group. + * List all machine types available for a project. Get a list of all machine type available in a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @return ApiResponse<SecurityGroupRuleListResponse> + * @param region The STACKIT Region of the resources. (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<MachineTypeListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16753,22 +18525,25 @@ public SecurityGroupRuleListResponse listSecurityGroupRules( * *
Response Details
Status Code Description Response Headers
200 List all rules of a security group. -
200 List of machine types. -
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 listSecurityGroupRulesWithHttpInfo( + public ApiResponse listMachineTypesWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String filter) throws ApiException { okhttp3.Call localVarCall = - listSecurityGroupRulesValidateBeforeCall(projectId, securityGroupId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + listMachineTypesValidateBeforeCall(projectId, region, filter, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all rules for a security group. (asynchronously) Get a list of all rules inside a - * security group. + * List all machine types available for a project. (asynchronously) Get a list of all machine + * type available in a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param region The STACKIT Region of the resources. (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 @@ -16777,7 +18552,7 @@ public ApiResponse listSecurityGroupRulesWithHttp * * * - * + * * * * @@ -16785,24 +18560,25 @@ public ApiResponse listSecurityGroupRulesWithHttp * *
Response Details
Status Code Description Response Headers
200 List all rules of a security group. -
200 List of machine types. -
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 listSecurityGroupRulesAsync( + public okhttp3.Call listMachineTypesAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID securityGroupId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String filter, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listSecurityGroupRulesValidateBeforeCall(projectId, securityGroupId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listMachineTypesValidateBeforeCall(projectId, region, filter, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listSecurityGroups + * Build call for listNetworkAreaProjects * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -16810,7 +18586,7 @@ public okhttp3.Call listSecurityGroupRulesAsync( * * * - * + * * * * @@ -16818,9 +18594,9 @@ public okhttp3.Call listSecurityGroupRulesAsync( * *
Response Details
Status Code Description Response Headers
200 List all security groups of a project. -
200 List projects for a network area. -
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 listSecurityGroupsCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, + public okhttp3.Call listNetworkAreaProjectsCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -16840,10 +18616,13 @@ public okhttp3.Call listSecurityGroupsCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/security-groups" + "/v2/organizations/{organizationId}/network-areas/{areaId}/projects" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -16851,11 +18630,6 @@ public okhttp3.Call listSecurityGroupsCall( 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) { @@ -16885,34 +18659,39 @@ public okhttp3.Call listSecurityGroupsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listSecurityGroupsValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, + private okhttp3.Call listNetworkAreaProjectsValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling listSecurityGroups(Async)"); + "Missing the required parameter 'organizationId' when calling listNetworkAreaProjects(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling listNetworkAreaProjects(Async)"); } - return listSecurityGroupsCall(projectId, labelSelector, _callback); + return listNetworkAreaProjectsCall(organizationId, areaId, _callback); } /** - * List all security groups inside a project. Get a list of all security groups inside a - * project. + * List all projects using a network area. Get a list of all projects using a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return SecurityGroupListResponse + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @return ProjectListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16920,29 +18699,27 @@ private okhttp3.Call listSecurityGroupsValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List all security groups of a project. -
200 List projects for a network area. -
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 SecurityGroupListResponse listSecurityGroups( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector) + public ProjectListResponse listNetworkAreaProjects( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) throws ApiException { - ApiResponse localVarResp = - listSecurityGroupsWithHttpInfo(projectId, labelSelector); + ApiResponse localVarResp = + listNetworkAreaProjectsWithHttpInfo(organizationId, areaId); return localVarResp.getData(); } /** - * List all security groups inside a project. Get a list of all security groups inside a - * project. + * List all projects using a network area. Get a list of all projects using a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<SecurityGroupListResponse> + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @return ApiResponse<ProjectListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -16950,22 +18727,21 @@ public SecurityGroupListResponse listSecurityGroups( * *
Response Details
Status Code Description Response Headers
200 List all security groups of a project. -
200 List projects for a network area. -
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 listSecurityGroupsWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector) + public ApiResponse listNetworkAreaProjectsWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) throws ApiException { okhttp3.Call localVarCall = - listSecurityGroupsValidateBeforeCall(projectId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + listNetworkAreaProjectsValidateBeforeCall(organizationId, areaId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all security groups inside a project. (asynchronously) Get a list of all security groups - * inside a project. + * List all projects using a network area. (asynchronously) Get a list of all projects using a + * network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param labelSelector Filter resources by labels. (optional) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (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 @@ -16974,7 +18750,7 @@ public ApiResponse listSecurityGroupsWithHttpInfo( * * * - * + * * * * @@ -16982,24 +18758,25 @@ public ApiResponse listSecurityGroupsWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List all security groups of a project. -
200 List projects for a network area. -
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 listSecurityGroupsAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + public okhttp3.Call listNetworkAreaProjectsAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listSecurityGroupsValidateBeforeCall(projectId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listNetworkAreaProjectsValidateBeforeCall(organizationId, areaId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listServerNics + * Build call for listNetworkAreaRanges * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (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 _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -17007,7 +18784,7 @@ public okhttp3.Call listSecurityGroupsAsync( * * * - * + * * * * @@ -17015,9 +18792,10 @@ public okhttp3.Call listSecurityGroupsAsync( * *
Response Details
Status Code Description Response Headers
200 List network interfaces. -
200 List all network ranges. -
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 listServerNicsCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + public okhttp3.Call listNetworkAreaRangesCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -17037,13 +18815,16 @@ public okhttp3.Call listServerNicsCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/nics" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -17080,39 +18861,48 @@ public okhttp3.Call listServerNicsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listServerNicsValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + private okhttp3.Call listNetworkAreaRangesValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling listServerNics(Async)"); + "Missing the required parameter 'organizationId' when calling listNetworkAreaRanges(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling listNetworkAreaRanges(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling listServerNics(Async)"); + "Missing the required parameter 'region' when calling listNetworkAreaRanges(Async)"); } - return listServerNicsCall(projectId, serverId, _callback); + return listNetworkAreaRangesCall(organizationId, areaId, region, _callback); } /** - * Get all network interfaces. Get all network interfaces attached to the server. + * List all network ranges in a network area. Get a list of all network ranges in a network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @return NICListResponse + * @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) + * @return NetworkRangeListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -17120,26 +18910,31 @@ private okhttp3.Call listServerNicsValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List network interfaces. -
200 List all network ranges. -
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 NICListResponse listServerNics( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public NetworkRangeListResponse listNetworkAreaRanges( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region) throws ApiException { - ApiResponse localVarResp = listServerNicsWithHttpInfo(projectId, serverId); + ApiResponse localVarResp = + listNetworkAreaRangesWithHttpInfo(organizationId, areaId, region); return localVarResp.getData(); } /** - * Get all network interfaces. Get all network interfaces attached to the server. + * List all network ranges in a network area. Get a list of all network ranges in a network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @return ApiResponse<NICListResponse> + * @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) + * @return ApiResponse<NetworkRangeListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -17147,20 +18942,24 @@ public NICListResponse listServerNics( * *
Response Details
Status Code Description Response Headers
200 List network interfaces. -
200 List all network ranges. -
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 listServerNicsWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public ApiResponse listNetworkAreaRangesWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region) throws ApiException { - okhttp3.Call localVarCall = listServerNicsValidateBeforeCall(projectId, serverId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + listNetworkAreaRangesValidateBeforeCall(organizationId, areaId, region, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get all network interfaces. (asynchronously) Get all network interfaces attached to the - * server. + * List all network ranges in a network area. (asynchronously) Get a list of all network ranges + * in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (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 _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 @@ -17169,7 +18968,7 @@ public ApiResponse listServerNicsWithHttpInfo( * * * - * + * * * * @@ -17177,24 +18976,25 @@ public ApiResponse listServerNicsWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List network interfaces. -
200 List all network ranges. -
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 listServerNicsAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - final ApiCallback _callback) + public okhttp3.Call listNetworkAreaRangesAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listServerNicsValidateBeforeCall(projectId, serverId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listNetworkAreaRangesValidateBeforeCall(organizationId, areaId, region, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listServerServiceAccounts + * Build call for listNetworkAreaRegions * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -17202,7 +19002,7 @@ public okhttp3.Call listServerNicsAsync( * * * - * + * * * * @@ -17210,9 +19010,9 @@ public okhttp3.Call listServerNicsAsync( * *
Response Details
Status Code Description Response Headers
200 List service accounts. -
200 List all configured area regions. -
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 listServerServiceAccountsCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + public okhttp3.Call listNetworkAreaRegionsCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -17232,13 +19032,13 @@ public okhttp3.Call listServerServiceAccountsCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/service-accounts" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -17275,39 +19075,39 @@ public okhttp3.Call listServerServiceAccountsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listServerServiceAccountsValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + private okhttp3.Call listNetworkAreaRegionsValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling listServerServiceAccounts(Async)"); + "Missing the required parameter 'organizationId' when calling listNetworkAreaRegions(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling listServerServiceAccounts(Async)"); + "Missing the required parameter 'areaId' when calling listNetworkAreaRegions(Async)"); } - return listServerServiceAccountsCall(projectId, serverId, _callback); + return listNetworkAreaRegionsCall(organizationId, areaId, _callback); } /** - * List all service accounts of the Server. Get the list of the service accounts of the server. + * List all configured regions in a network area. Get a list of all configured regions. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @return ServiceAccountMailListResponse + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @return RegionalAreaListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -17315,27 +19115,27 @@ private okhttp3.Call listServerServiceAccountsValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List service accounts. -
200 List all configured area regions. -
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 ServiceAccountMailListResponse listServerServiceAccounts( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public RegionalAreaListResponse listNetworkAreaRegions( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) throws ApiException { - ApiResponse localVarResp = - listServerServiceAccountsWithHttpInfo(projectId, serverId); + ApiResponse localVarResp = + listNetworkAreaRegionsWithHttpInfo(organizationId, areaId); return localVarResp.getData(); } /** - * List all service accounts of the Server. Get the list of the service accounts of the server. + * List all configured regions in a network area. Get a list of all configured regions. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @return ApiResponse<ServiceAccountMailListResponse> + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @return ApiResponse<RegionalAreaListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -17343,21 +19143,21 @@ public ServiceAccountMailListResponse listServerServiceAccounts( * *
Response Details
Status Code Description Response Headers
200 List service accounts. -
200 List all configured area regions. -
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 listServerServiceAccountsWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public ApiResponse listNetworkAreaRegionsWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) throws ApiException { okhttp3.Call localVarCall = - listServerServiceAccountsValidateBeforeCall(projectId, serverId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + listNetworkAreaRegionsValidateBeforeCall(organizationId, areaId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all service accounts of the Server. (asynchronously) Get the list of the service - * accounts of the server. + * List all configured regions in a network area. (asynchronously) Get a list of all configured + * regions. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (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 @@ -17366,7 +19166,7 @@ public ApiResponse listServerServiceAccountsWith * * * - * + * * * * @@ -17374,24 +19174,25 @@ public ApiResponse listServerServiceAccountsWith * *
Response Details
Status Code Description Response Headers
200 List service accounts. -
200 List all configured area regions. -
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 listServerServiceAccountsAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - final ApiCallback _callback) + public okhttp3.Call listNetworkAreaRegionsAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listServerServiceAccountsValidateBeforeCall(projectId, serverId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listNetworkAreaRegionsValidateBeforeCall(organizationId, areaId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listServers + * Build call for listNetworkAreaRoutes * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param details Show detailed information about server. (optional, default to false) + * @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 labelSelector Filter resources by labels. (optional) * @param _callback Callback for upload/download progress * @return Call to execute @@ -17400,7 +19201,7 @@ public okhttp3.Call listServerServiceAccountsAsync( * * * - * + * * * * @@ -17408,9 +19209,10 @@ public okhttp3.Call listServerServiceAccountsAsync( * *
Response Details
Status Code Description Response Headers
200 List all servers of a project. -
200 List network routes. -
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 listServersCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable Boolean details, + public okhttp3.Call listNetworkAreaRoutesCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { @@ -17431,10 +19233,16 @@ public okhttp3.Call listServersCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -17442,10 +19250,6 @@ public okhttp3.Call listServersCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (details != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("details", details)); - } - if (labelSelector != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("label_selector", labelSelector)); @@ -17480,35 +19284,50 @@ public okhttp3.Call listServersCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listServersValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable Boolean details, + private okhttp3.Call listNetworkAreaRoutesValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling listServers(Async)"); + "Missing the required parameter 'organizationId' when calling listNetworkAreaRoutes(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling listNetworkAreaRoutes(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling listNetworkAreaRoutes(Async)"); } - return listServersCall(projectId, details, labelSelector, _callback); + return listNetworkAreaRoutesCall(organizationId, areaId, region, labelSelector, _callback); } /** - * List all servers inside a project. Get a list of all servers inside a project. + * List all network routes in a network area. Get a list of all network routes defined in a + * network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param details Show detailed information about server. (optional, default to false) + * @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 labelSelector Filter resources by labels. (optional) - * @return ServerListResponse + * @return RouteListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -17516,30 +19335,33 @@ private okhttp3.Call listServersValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List all servers of a project. -
200 List network routes. -
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 ServerListResponse listServers( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable Boolean details, + public RouteListResponse listNetworkAreaRoutes( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, @javax.annotation.Nullable String labelSelector) throws ApiException { - ApiResponse localVarResp = - listServersWithHttpInfo(projectId, details, labelSelector); + ApiResponse localVarResp = + listNetworkAreaRoutesWithHttpInfo(organizationId, areaId, region, labelSelector); return localVarResp.getData(); } /** - * List all servers inside a project. Get a list of all servers inside a project. + * List all network routes in a network area. Get a list of all network routes defined in a + * network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param details Show detailed information about server. (optional, default to false) + * @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 labelSelector Filter resources by labels. (optional) - * @return ApiResponse<ServerListResponse> + * @return ApiResponse<RouteListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -17547,23 +19369,26 @@ public ServerListResponse listServers( * *
Response Details
Status Code Description Response Headers
200 List all servers of a project. -
200 List network routes. -
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 listServersWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable Boolean details, + public ApiResponse listNetworkAreaRoutesWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, @javax.annotation.Nullable String labelSelector) throws ApiException { okhttp3.Call localVarCall = - listServersValidateBeforeCall(projectId, details, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + listNetworkAreaRoutesValidateBeforeCall( + organizationId, areaId, region, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all servers inside a project. (asynchronously) Get a list of all servers inside a - * project. + * List all network routes in a network area. (asynchronously) Get a list of all network routes + * defined in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param details Show detailed information about server. (optional, default to false) + * @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 labelSelector Filter resources by labels. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -17573,7 +19398,7 @@ public ApiResponse listServersWithHttpInfo( * * * - * + * * * * @@ -17581,24 +19406,26 @@ public ApiResponse listServersWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List all servers of a project. -
200 List network routes. -
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 listServersAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nullable Boolean details, + public okhttp3.Call listNetworkAreaRoutesAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listServersValidateBeforeCall(projectId, details, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listNetworkAreaRoutesValidateBeforeCall( + organizationId, areaId, region, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listSnapshots + * Build call for listNetworkAreas * - * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) * @param labelSelector Filter resources by labels. (optional) * @param _callback Callback for upload/download progress * @return Call to execute @@ -17607,7 +19434,7 @@ public okhttp3.Call listServersAsync( * * * - * + * * * * @@ -17615,8 +19442,8 @@ public okhttp3.Call listServersAsync( * *
Response Details
Status Code Description Response Headers
200 List project snapshots. -
200 Get a list of all network areas. -
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 listSnapshotsCall( - @javax.annotation.Nonnull UUID projectId, + public okhttp3.Call listNetworkAreasCall( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { @@ -17637,10 +19464,10 @@ public okhttp3.Call listSnapshotsCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/snapshots" + "/v2/organizations/{organizationId}/network-areas" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -17682,33 +19509,34 @@ public okhttp3.Call listSnapshotsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listSnapshotsValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, + private okhttp3.Call listNetworkAreasValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling listSnapshots(Async)"); + "Missing the required parameter 'organizationId' when calling listNetworkAreas(Async)"); } - return listSnapshotsCall(projectId, labelSelector, _callback); + return listNetworkAreasCall(organizationId, labelSelector, _callback); } /** - * List all snapshots inside a project. Get a list of all snapshots inside a project. + * List all network areas in an organization. Get a list of all visible network areas defined in + * an organization. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) * @param labelSelector Filter resources by labels. (optional) - * @return SnapshotListResponse + * @return NetworkAreaListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -17716,28 +19544,29 @@ private okhttp3.Call listSnapshotsValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List project snapshots. -
200 Get a list of all network areas. -
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 SnapshotListResponse listSnapshots( - @javax.annotation.Nonnull UUID projectId, + public NetworkAreaListResponse listNetworkAreas( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nullable String labelSelector) throws ApiException { - ApiResponse localVarResp = - listSnapshotsWithHttpInfo(projectId, labelSelector); + ApiResponse localVarResp = + listNetworkAreasWithHttpInfo(organizationId, labelSelector); return localVarResp.getData(); } /** - * List all snapshots inside a project. Get a list of all snapshots inside a project. + * List all network areas in an organization. Get a list of all visible network areas defined in + * an organization. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<SnapshotListResponse> + * @return ApiResponse<NetworkAreaListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -17745,20 +19574,21 @@ public SnapshotListResponse listSnapshots( * *
Response Details
Status Code Description Response Headers
200 List project snapshots. -
200 Get a list of all network areas. -
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 listSnapshotsWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, + public ApiResponse listNetworkAreasWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nullable String labelSelector) throws ApiException { - okhttp3.Call localVarCall = listSnapshotsValidateBeforeCall(projectId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + listNetworkAreasValidateBeforeCall(organizationId, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all snapshots inside a project. (asynchronously) Get a list of all snapshots inside a - * project. - * - * @param projectId The identifier (ID) of a STACKIT Project. (required) + * List all network areas in an organization. (asynchronously) Get a list of all visible network + * areas defined in an organization. + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) * @param labelSelector Filter resources by labels. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -17768,7 +19598,7 @@ public ApiResponse listSnapshotsWithHttpInfo( * * * - * + * * * * @@ -17776,23 +19606,24 @@ public ApiResponse listSnapshotsWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List project snapshots. -
200 Get a list of all network areas. -
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 listSnapshotsAsync( - @javax.annotation.Nonnull UUID projectId, + public okhttp3.Call listNetworkAreasAsync( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listSnapshotsValidateBeforeCall(projectId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listNetworkAreasValidateBeforeCall(organizationId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listVolumePerformanceClasses + * Build call for listNetworks * * @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 @@ -17801,7 +19632,7 @@ public okhttp3.Call listSnapshotsAsync( * * * - * + * * * * @@ -17809,8 +19640,9 @@ public okhttp3.Call listSnapshotsAsync( * *
Response Details
Status Code Description Response Headers
200 List volume performance classes. -
200 List all networks 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 listVolumePerformanceClassesCall( + public okhttp3.Call listNetworksCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { @@ -17831,10 +19663,13 @@ public okhttp3.Call listVolumePerformanceClassesCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/volume-performance-classes" + "/v2/projects/{projectId}/regions/{region}/networks" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -17876,34 +19711,41 @@ public okhttp3.Call listVolumePerformanceClassesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listVolumePerformanceClassesValidateBeforeCall( + private okhttp3.Call listNetworksValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nullable String labelSelector, 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 listVolumePerformanceClasses(Async)"); + "Missing the required parameter 'projectId' when calling listNetworks(Async)"); } - return listVolumePerformanceClassesCall(projectId, labelSelector, _callback); + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling listNetworks(Async)"); + } + + return listNetworksCall(projectId, region, labelSelector, _callback); } /** - * List all volume performance classes available for a project. Get a list of all volume - * performance classes available inside a project. + * List all networks inside a project. Get a list of all networks inside a project. * * @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) - * @return VolumePerformanceClassListResponse + * @return NetworkListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -17911,29 +19753,30 @@ private okhttp3.Call listVolumePerformanceClassesValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List volume performance classes. -
200 List all networks 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 VolumePerformanceClassListResponse listVolumePerformanceClasses( + public NetworkListResponse listNetworks( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nullable String labelSelector) throws ApiException { - ApiResponse localVarResp = - listVolumePerformanceClassesWithHttpInfo(projectId, labelSelector); + ApiResponse localVarResp = + listNetworksWithHttpInfo(projectId, region, labelSelector); return localVarResp.getData(); } /** - * List all volume performance classes available for a project. Get a list of all volume - * performance classes available inside a project. + * List all networks inside a project. Get a list of all networks inside a project. * * @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) - * @return ApiResponse<VolumePerformanceClassListResponse> + * @return ApiResponse<NetworkListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -17941,21 +19784,23 @@ public VolumePerformanceClassListResponse listVolumePerformanceClasses( * *
Response Details
Status Code Description Response Headers
200 List volume performance classes. -
200 List all networks 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 listVolumePerformanceClassesWithHttpInfo( + public ApiResponse listNetworksWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nullable String labelSelector) throws ApiException { okhttp3.Call localVarCall = - listVolumePerformanceClassesValidateBeforeCall(projectId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + listNetworksValidateBeforeCall(projectId, region, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all volume performance classes available for a project. (asynchronously) Get a list of - * all volume performance classes available inside a project. + * List all networks inside a project. (asynchronously) Get a list of all networks inside a + * project. * * @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 The callback to be executed when the API call finishes * @return The request call @@ -17965,7 +19810,7 @@ public ApiResponse listVolumePerformanceClas * * * - * + * * * * @@ -17973,23 +19818,26 @@ public ApiResponse listVolumePerformanceClas * *
Response Details
Status Code Description Response Headers
200 List volume performance classes. -
200 List all networks 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 listVolumePerformanceClassesAsync( + public okhttp3.Call listNetworksAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listVolumePerformanceClassesValidateBeforeCall(projectId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listNetworksValidateBeforeCall(projectId, region, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listVolumes + * Build call for listNics * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) * @param labelSelector Filter resources by labels. (optional) * @param _callback Callback for upload/download progress * @return Call to execute @@ -17998,7 +19846,7 @@ public okhttp3.Call listVolumePerformanceClassesAsync( * * * - * + * * * * @@ -18006,8 +19854,10 @@ public okhttp3.Call listVolumePerformanceClassesAsync( * *
Response Details
Status Code Description Response Headers
200 List project volumes. -
200 List project network interfaces. -
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 listVolumesCall( + public okhttp3.Call listNicsCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { @@ -18028,10 +19878,16 @@ public okhttp3.Call listVolumesCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/volumes" + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics" .replace( "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())); + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -18073,33 +19929,50 @@ public okhttp3.Call listVolumesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listVolumesValidateBeforeCall( + private okhttp3.Call listNicsValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, @javax.annotation.Nullable String labelSelector, 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 listVolumes(Async)"); + "Missing the required parameter 'projectId' when calling listNics(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling listNics(Async)"); + } + + // verify the required parameter 'networkId' is set + if (networkId == null) { + throw new ApiException( + "Missing the required parameter 'networkId' when calling listNics(Async)"); } - return listVolumesCall(projectId, labelSelector, _callback); + return listNicsCall(projectId, region, networkId, labelSelector, _callback); } /** - * List all volumes inside a project. Get a list of all volumes inside a project. + * List all network interfaces inside a network. Get a list of all network interfaces inside a + * network. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) * @param labelSelector Filter resources by labels. (optional) - * @return VolumeListResponse + * @return NICListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -18107,28 +19980,33 @@ private okhttp3.Call listVolumesValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 List project volumes. -
200 List project network interfaces. -
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 VolumeListResponse listVolumes( + public NICListResponse listNics( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, @javax.annotation.Nullable String labelSelector) throws ApiException { - ApiResponse localVarResp = - listVolumesWithHttpInfo(projectId, labelSelector); + ApiResponse localVarResp = + listNicsWithHttpInfo(projectId, region, networkId, labelSelector); return localVarResp.getData(); } /** - * List all volumes inside a project. Get a list of all volumes inside a project. + * List all network interfaces inside a network. Get a list of all network interfaces inside a + * network. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) * @param labelSelector Filter resources by labels. (optional) - * @return ApiResponse<VolumeListResponse> + * @return ApiResponse<NICListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -18136,20 +20014,25 @@ public VolumeListResponse listVolumes( * *
Response Details
Status Code Description Response Headers
200 List project volumes. -
200 List project network interfaces. -
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 listVolumesWithHttpInfo( + public ApiResponse listNicsWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, @javax.annotation.Nullable String labelSelector) throws ApiException { - okhttp3.Call localVarCall = listVolumesValidateBeforeCall(projectId, labelSelector, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + listNicsValidateBeforeCall(projectId, region, networkId, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List all volumes inside a project. (asynchronously) Get a list of all volumes inside a - * project. + * List all network interfaces inside a network. (asynchronously) Get a list of all network + * interfaces inside a network. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) * @param labelSelector Filter resources by labels. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -18159,7 +20042,7 @@ public ApiResponse listVolumesWithHttpInfo( * * * - * + * * * * @@ -18167,25 +20050,27 @@ public ApiResponse listVolumesWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 List project volumes. -
200 List project network interfaces. -
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 listVolumesAsync( + public okhttp3.Call listNicsAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, @javax.annotation.Nullable String labelSelector, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listVolumesValidateBeforeCall(projectId, labelSelector, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listNicsValidateBeforeCall(projectId, region, networkId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for partialUpdateNetwork + * Build call for listProjectNICs * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param partialUpdateNetworkPayload Request an update of a network. (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 @@ -18193,7 +20078,7 @@ public okhttp3.Call listVolumesAsync( * * * - * + * * * * @@ -18201,10 +20086,10 @@ public okhttp3.Call listVolumesAsync( * *
Response Details
Status Code Description Response Headers
202 An update was accepted. -
200 List network interfaces of the 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 partialUpdateNetworkCall( + public okhttp3.Call listProjectNICsCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -18220,17 +20105,17 @@ public okhttp3.Call partialUpdateNetworkCall( basePath = null; } - Object localVarPostBody = partialUpdateNetworkPayload; + Object localVarPostBody = null; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/networks/{networkId}" + "/v2/projects/{projectId}/regions/{region}/nics" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -18238,13 +20123,18 @@ public okhttp3.Call partialUpdateNetworkCall( 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 = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -18255,7 +20145,7 @@ public okhttp3.Call partialUpdateNetworkCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PATCH", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -18267,47 +20157,42 @@ public okhttp3.Call partialUpdateNetworkCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call partialUpdateNetworkValidateBeforeCall( + private okhttp3.Call listProjectNICsValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, 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 partialUpdateNetwork(Async)"); - } - - // verify the required parameter 'networkId' is set - if (networkId == null) { - throw new ApiException( - "Missing the required parameter 'networkId' when calling partialUpdateNetwork(Async)"); + "Missing the required parameter 'projectId' when calling listProjectNICs(Async)"); } - // verify the required parameter 'partialUpdateNetworkPayload' is set - if (partialUpdateNetworkPayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'partialUpdateNetworkPayload' when calling partialUpdateNetwork(Async)"); + "Missing the required parameter 'region' when calling listProjectNICs(Async)"); } - return partialUpdateNetworkCall( - projectId, networkId, partialUpdateNetworkPayload, _callback); + return listProjectNICsCall(projectId, region, labelSelector, _callback); } /** - * Update network settings. Update the settings of a network inside a project. + * List all network interfaces inside a project. Get a list of all network interfaces inside a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param partialUpdateNetworkPayload Request an update of a network. (required) + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return NICListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -18315,28 +20200,31 @@ private okhttp3.Call partialUpdateNetworkValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
202 An update was accepted. -
200 List network interfaces of the 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 void partialUpdateNetwork( + public NICListResponse listProjectNICs( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { - partialUpdateNetworkWithHttpInfo(projectId, networkId, partialUpdateNetworkPayload); + ApiResponse localVarResp = + listProjectNICsWithHttpInfo(projectId, region, labelSelector); + return localVarResp.getData(); } /** - * Update network settings. Update the settings of a network inside a project. + * List all network interfaces inside a project. Get a list of all network interfaces inside a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param partialUpdateNetworkPayload Request an update of a network. (required) - * @return ApiResponse<Void> + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return ApiResponse<NICListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -18344,23 +20232,24 @@ public void partialUpdateNetwork( * *
Response Details
Status Code Description Response Headers
202 An update was accepted. -
200 List network interfaces of the 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 partialUpdateNetworkWithHttpInfo( + public ApiResponse listProjectNICsWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { okhttp3.Call localVarCall = - partialUpdateNetworkValidateBeforeCall( - projectId, networkId, partialUpdateNetworkPayload, null); - return localVarApiClient.execute(localVarCall); + listProjectNICsValidateBeforeCall(projectId, region, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update network settings. (asynchronously) Update the settings of a network inside a project. + * List all network interfaces inside a project. (asynchronously) Get a list of all network + * interfaces inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param partialUpdateNetworkPayload Request an update of a network. (required) + * @param region The STACKIT Region of the resources. (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 @@ -18369,7 +20258,7 @@ public ApiResponse partialUpdateNetworkWithHttpInfo( * * * - * + * * * * @@ -18377,26 +20266,23 @@ public ApiResponse partialUpdateNetworkWithHttpInfo( * *
Response Details
Status Code Description Response Headers
202 An update was accepted. -
200 List network interfaces of the 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 partialUpdateNetworkAsync( + public okhttp3.Call listProjectNICsAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - partialUpdateNetworkValidateBeforeCall( - projectId, networkId, partialUpdateNetworkPayload, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + listProjectNICsValidateBeforeCall(projectId, region, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for partialUpdateNetworkArea + * Build call for listPublicIPRanges * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param partialUpdateNetworkAreaPayload Request to update an area. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -18404,7 +20290,7 @@ public okhttp3.Call partialUpdateNetworkAsync( * * * - * + * * * * @@ -18412,13 +20298,7 @@ public okhttp3.Call partialUpdateNetworkAsync( * *
Response Details
Status Code Description Response Headers
200 Area has been updated. -
200 List public IP ranges. -
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 partialUpdateNetworkAreaCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull - PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload, - final ApiCallback _callback) - throws ApiException { + public okhttp3.Call listPublicIPRangesCall(final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -18432,17 +20312,10 @@ public okhttp3.Call partialUpdateNetworkAreaCall( basePath = null; } - Object localVarPostBody = partialUpdateNetworkAreaPayload; + Object localVarPostBody = null; // create path and map variables - String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}" - .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) - .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())); + String localVarPath = "/v2/networks/public-ip-ranges"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -18456,7 +20329,7 @@ public okhttp3.Call partialUpdateNetworkAreaCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -18467,7 +20340,7 @@ public okhttp3.Call partialUpdateNetworkAreaCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PATCH", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -18479,49 +20352,22 @@ public okhttp3.Call partialUpdateNetworkAreaCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call partialUpdateNetworkAreaValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull - PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload, - final ApiCallback _callback) + private okhttp3.Call listPublicIPRangesValidateBeforeCall(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 partialUpdateNetworkArea(Async)"); - } - - // verify the required parameter 'areaId' is set - if (areaId == null) { - throw new ApiException( - "Missing the required parameter 'areaId' when calling partialUpdateNetworkArea(Async)"); - } - - // verify the required parameter 'partialUpdateNetworkAreaPayload' is set - if (partialUpdateNetworkAreaPayload == null) { - throw new ApiException( - "Missing the required parameter 'partialUpdateNetworkAreaPayload' when calling partialUpdateNetworkArea(Async)"); - } - - return partialUpdateNetworkAreaCall( - organizationId, areaId, partialUpdateNetworkAreaPayload, _callback); + return listPublicIPRangesCall(_callback); } /** - * Update network area settings. Update the settings of a network area in an organization. + * List all public IP ranges. Get a list of all public IP ranges that STACKIT uses. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param partialUpdateNetworkAreaPayload Request to update an area. (required) - * @return NetworkArea + * @return PublicNetworkListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -18529,32 +20375,22 @@ private okhttp3.Call partialUpdateNetworkAreaValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Area has been updated. -
200 List public IP ranges. -
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 NetworkArea partialUpdateNetworkArea( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull - PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload) - throws ApiException { - ApiResponse localVarResp = - partialUpdateNetworkAreaWithHttpInfo( - organizationId, areaId, partialUpdateNetworkAreaPayload); + public PublicNetworkListResponse listPublicIPRanges() throws ApiException { + ApiResponse localVarResp = listPublicIPRangesWithHttpInfo(); return localVarResp.getData(); } /** - * Update network area settings. Update the settings of a network area in an organization. + * List all public IP ranges. Get a list of all public IP ranges that STACKIT uses. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param partialUpdateNetworkAreaPayload Request to update an area. (required) - * @return ApiResponse<NetworkArea> + * @return ApiResponse<PublicNetworkListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -18562,26 +20398,17 @@ public NetworkArea partialUpdateNetworkArea( * *
Response Details
Status Code Description Response Headers
200 Area has been updated. -
200 List public IP ranges. -
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 partialUpdateNetworkAreaWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull - PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload) + public ApiResponse listPublicIPRangesWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = - partialUpdateNetworkAreaValidateBeforeCall( - organizationId, areaId, partialUpdateNetworkAreaPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = listPublicIPRangesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update network area settings. (asynchronously) Update the settings of a network area in an - * organization. + * List all public IP ranges. (asynchronously) Get a list of all public IP ranges that STACKIT + * uses. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param partialUpdateNetworkAreaPayload Request to update an area. (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 @@ -18590,7 +20417,7 @@ public ApiResponse partialUpdateNetworkAreaWithHttpInfo( * * * - * + * * * * @@ -18598,28 +20425,21 @@ public ApiResponse partialUpdateNetworkAreaWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Area has been updated. -
200 List public IP ranges. -
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 partialUpdateNetworkAreaAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull - PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload, - final ApiCallback _callback) - throws ApiException { + public okhttp3.Call listPublicIPRangesAsync( + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = - partialUpdateNetworkAreaValidateBeforeCall( - organizationId, areaId, partialUpdateNetworkAreaPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = listPublicIPRangesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for rebootServer + * Build call for listPublicIPs * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param action Defines if it is a soft or a hard reboot. (optional, default to soft) + * @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 @@ -18627,19 +20447,18 @@ public okhttp3.Call partialUpdateNetworkAreaAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server reboot request accepted. -
200 List project public IPs. -
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 rebootServerCall( + public okhttp3.Call listPublicIPsCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable String action, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -18659,13 +20478,13 @@ public okhttp3.Call rebootServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/reboot" + "/v2/projects/{projectId}/regions/{region}/public-ips" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -18673,8 +20492,9 @@ public okhttp3.Call rebootServerCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (action != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("action", action)); + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); } final String[] localVarAccepts = {"application/json"}; @@ -18694,7 +20514,7 @@ public okhttp3.Call rebootServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -18706,100 +20526,97 @@ public okhttp3.Call rebootServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call rebootServerValidateBeforeCall( + private okhttp3.Call listPublicIPsValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable String action, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, 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 rebootServer(Async)"); + "Missing the required parameter 'projectId' when calling listPublicIPs(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling rebootServer(Async)"); + "Missing the required parameter 'region' when calling listPublicIPs(Async)"); } - return rebootServerCall(projectId, serverId, action, _callback); + return listPublicIPsCall(projectId, region, labelSelector, _callback); } /** - * Reboot the server. Reboot the server. A soft reboot will attempt to gracefully shut down the - * server by passing the command to the operating system. A hard reboot will power cycle the - * server without waiting for the operating system to shutdown properly. + * List all public IPs inside a project. Get a list of all public IPs inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param action Defines if it is a soft or a hard reboot. (optional, default to soft) + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return PublicIpListResponse * @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 Server reboot request accepted. -
200 List project public IPs. -
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 rebootServer( + public PublicIpListResponse listPublicIPs( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable String action) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { - rebootServerWithHttpInfo(projectId, serverId, action); + ApiResponse localVarResp = + listPublicIPsWithHttpInfo(projectId, region, labelSelector); + return localVarResp.getData(); } /** - * Reboot the server. Reboot the server. A soft reboot will attempt to gracefully shut down the - * server by passing the command to the operating system. A hard reboot will power cycle the - * server without waiting for the operating system to shutdown properly. + * List all public IPs inside a project. Get a list of all public IPs inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param action Defines if it is a soft or a hard reboot. (optional, default to soft) - * @return ApiResponse<Void> + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return ApiResponse<PublicIpListResponse> * @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 Server reboot request accepted. -
200 List project public IPs. -
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 rebootServerWithHttpInfo( + public ApiResponse listPublicIPsWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable String action) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { okhttp3.Call localVarCall = - rebootServerValidateBeforeCall(projectId, serverId, action, null); - return localVarApiClient.execute(localVarCall); + listPublicIPsValidateBeforeCall(projectId, region, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Reboot the server. (asynchronously) Reboot the server. A soft reboot will attempt to - * gracefully shut down the server by passing the command to the operating system. A hard reboot - * will power cycle the server without waiting for the operating system to shutdown properly. + * List all public IPs inside a project. (asynchronously) Get a list of all public IPs inside a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param action Defines if it is a soft or a hard reboot. (optional, default to soft) + * @param region The STACKIT Region of the resources. (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 @@ -18808,34 +20625,33 @@ public ApiResponse rebootServerWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server reboot request accepted. -
200 List project public IPs. -
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 rebootServerAsync( + public okhttp3.Call listPublicIPsAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nullable String action, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - rebootServerValidateBeforeCall(projectId, serverId, action, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + listPublicIPsValidateBeforeCall(projectId, region, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for removeNetworkFromServer + * Build call for listQuotas * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param region The STACKIT Region of the resources. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -18843,7 +20659,7 @@ public okhttp3.Call rebootServerAsync( * * * - * + * * * * @@ -18851,10 +20667,9 @@ public okhttp3.Call rebootServerAsync( * *
Response Details
Status Code Description Response Headers
204 Detach and delete network interface was accepted. -
200 List quotas. -
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 removeNetworkFromServerCall( + public okhttp3.Call listQuotasCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -18874,16 +20689,13 @@ public okhttp3.Call removeNetworkFromServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + "/v2/projects/{projectId}/regions/{region}/quotas" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())) - .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -18908,7 +20720,7 @@ public okhttp3.Call removeNetworkFromServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "DELETE", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -18920,47 +20732,39 @@ public okhttp3.Call removeNetworkFromServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call removeNetworkFromServerValidateBeforeCall( + private okhttp3.Call listQuotasValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull String region, final ApiCallback _callback) throws ApiException { // verify the required parameter 'projectId' is set if (projectId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling removeNetworkFromServer(Async)"); - } - - // verify the required parameter 'serverId' is set - if (serverId == null) { - throw new ApiException( - "Missing the required parameter 'serverId' when calling removeNetworkFromServer(Async)"); + "Missing the required parameter 'projectId' when calling listQuotas(Async)"); } - // verify the required parameter 'networkId' is set - if (networkId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'networkId' when calling removeNetworkFromServer(Async)"); + "Missing the required parameter 'region' when calling listQuotas(Async)"); } - return removeNetworkFromServerCall(projectId, serverId, networkId, _callback); + return listQuotasCall(projectId, region, _callback); } /** - * Detach and delete all network interfaces associated with the specified network. Detach and - * delete all network interfaces associated with the specified network from the server. + * List project quotas. List quota limits and usage for project resources. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param region The STACKIT Region of the resources. (required) + * @return QuotaListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -18968,29 +20772,26 @@ private okhttp3.Call removeNetworkFromServerValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
204 Detach and delete network interface was accepted. -
200 List quotas. -
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 void removeNetworkFromServer( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID networkId) + public QuotaListResponse listQuotas( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String region) throws ApiException { - removeNetworkFromServerWithHttpInfo(projectId, serverId, networkId); + ApiResponse localVarResp = listQuotasWithHttpInfo(projectId, region); + return localVarResp.getData(); } /** - * Detach and delete all network interfaces associated with the specified network. Detach and - * delete all network interfaces associated with the specified network from the server. + * List project quotas. List quota limits and usage for project resources. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @return ApiResponse<Void> + * @param region The STACKIT Region of the resources. (required) + * @return ApiResponse<QuotaListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -18998,24 +20799,19 @@ public void removeNetworkFromServer( * *
Response Details
Status Code Description Response Headers
204 Detach and delete network interface was accepted. -
200 List quotas. -
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 removeNetworkFromServerWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID networkId) + public ApiResponse listQuotasWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String region) throws ApiException { - okhttp3.Call localVarCall = - removeNetworkFromServerValidateBeforeCall(projectId, serverId, networkId, null); - return localVarApiClient.execute(localVarCall); + okhttp3.Call localVarCall = listQuotasValidateBeforeCall(projectId, region, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Detach and delete all network interfaces associated with the specified network. - * (asynchronously) Detach and delete all network interfaces associated with the specified - * network from the server. + * List project quotas. (asynchronously) List quota limits and usage for project resources. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param region The STACKIT Region of the resources. (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 @@ -19024,7 +20820,7 @@ public ApiResponse removeNetworkFromServerWithHttpInfo( * * * - * + * * * * @@ -19032,26 +20828,26 @@ public ApiResponse removeNetworkFromServerWithHttpInfo( * *
Response Details
Status Code Description Response Headers
204 Detach and delete network interface was accepted. -
200 List quotas. -
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 removeNetworkFromServerAsync( + public okhttp3.Call listQuotasAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID networkId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = - removeNetworkFromServerValidateBeforeCall( - projectId, serverId, networkId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = listQuotasValidateBeforeCall(projectId, region, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for removeNicFromServer + * Build call for listRoutesOfRoutingTable * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param nicId The identifier (ID) of a network interface. (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 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 @@ -19059,7 +20855,7 @@ public okhttp3.Call removeNetworkFromServerAsync( * * * - * + * * * * @@ -19067,10 +20863,12 @@ public okhttp3.Call removeNetworkFromServerAsync( * *
Response Details
Status Code Description Response Headers
204 Network interface detachment request was accepted. -
200 List all routing table routes. -
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 removeNicFromServerCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID nicId, + public okhttp3.Call listRoutesOfRoutingTableCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -19090,16 +20888,19 @@ public okhttp3.Call removeNicFromServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())) + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) .replace( - "{" + "nicId" + "}", - localVarApiClient.escapeString(nicId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "routingTableId" + "}", + localVarApiClient.escapeString(routingTableId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -19107,6 +20908,11 @@ public okhttp3.Call removeNicFromServerCall( 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) { @@ -19124,7 +20930,7 @@ public okhttp3.Call removeNicFromServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "DELETE", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -19136,46 +20942,58 @@ public okhttp3.Call removeNicFromServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call removeNicFromServerValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID nicId, + private okhttp3.Call listRoutesOfRoutingTableValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling removeNicFromServer(Async)"); + "Missing the required parameter 'organizationId' when calling listRoutesOfRoutingTable(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling removeNicFromServer(Async)"); + "Missing the required parameter 'areaId' when calling listRoutesOfRoutingTable(Async)"); } - // verify the required parameter 'nicId' is set - if (nicId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'nicId' when calling removeNicFromServer(Async)"); + "Missing the required parameter 'region' when calling listRoutesOfRoutingTable(Async)"); + } + + // verify the required parameter 'routingTableId' is set + if (routingTableId == null) { + throw new ApiException( + "Missing the required parameter 'routingTableId' when calling listRoutesOfRoutingTable(Async)"); } - return removeNicFromServerCall(projectId, serverId, nicId, _callback); + return listRoutesOfRoutingTableCall( + organizationId, areaId, region, routingTableId, labelSelector, _callback); } /** - * Detach a network interface. Detach a network interface from a server. + * List all routes in a routing table. Get a list of all routes in a routing table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param nicId The identifier (ID) of a network interface. (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 labelSelector Filter resources by labels. (optional) + * @return RouteListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -19183,28 +21001,35 @@ private okhttp3.Call removeNicFromServerValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
204 Network interface detachment request was accepted. -
200 List all routing table routes. -
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 void removeNicFromServer( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID nicId) + public RouteListResponse listRoutesOfRoutingTable( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nullable String labelSelector) throws ApiException { - removeNicFromServerWithHttpInfo(projectId, serverId, nicId); + ApiResponse localVarResp = + listRoutesOfRoutingTableWithHttpInfo( + organizationId, areaId, region, routingTableId, labelSelector); + return localVarResp.getData(); } /** - * Detach a network interface. Detach a network interface from a server. + * List all routes in a routing table. Get a list of all routes in a routing table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param nicId The identifier (ID) of a network interface. (required) - * @return ApiResponse<Void> + * @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 labelSelector Filter resources by labels. (optional) + * @return ApiResponse<RouteListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -19212,22 +21037,29 @@ public void removeNicFromServer( * *
Response Details
Status Code Description Response Headers
204 Network interface detachment request was accepted. -
200 List all routing table routes. -
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 removeNicFromServerWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID nicId) + public ApiResponse listRoutesOfRoutingTableWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nullable String labelSelector) throws ApiException { okhttp3.Call localVarCall = - removeNicFromServerValidateBeforeCall(projectId, serverId, nicId, null); - return localVarApiClient.execute(localVarCall); + listRoutesOfRoutingTableValidateBeforeCall( + organizationId, areaId, region, routingTableId, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Detach a network interface. (asynchronously) Detach a network interface from a server. + * List all routes in a routing table. (asynchronously) Get a list of all routes in a routing + * table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param nicId The identifier (ID) of a network interface. (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 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 @@ -19236,7 +21068,7 @@ public ApiResponse removeNicFromServerWithHttpInfo( * * * - * + * * * * @@ -19244,25 +21076,30 @@ public ApiResponse removeNicFromServerWithHttpInfo( * *
Response Details
Status Code Description Response Headers
204 Network interface detachment request was accepted. -
200 List all routing table routes. -
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 removeNicFromServerAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID nicId, - final ApiCallback _callback) + public okhttp3.Call listRoutesOfRoutingTableAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - removeNicFromServerValidateBeforeCall(projectId, serverId, nicId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + listRoutesOfRoutingTableValidateBeforeCall( + organizationId, areaId, region, routingTableId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for removePublicIpFromServer + * Build call for listRoutingTablesOfArea * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param publicIpId The identifier (ID) of a Public IP. (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 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 @@ -19270,19 +21107,19 @@ public okhttp3.Call removeNicFromServerAsync( * * * - * + * * * * - * - * + * * *
Response Details
Status Code Description Response Headers
204 Detach Public IP from server was accepted. -
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The server or public IP was not found. -
409 A conflict has occurred. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call removePublicIpFromServerCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID publicIpId, + public okhttp3.Call listRoutingTablesOfAreaCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -19302,16 +21139,16 @@ public okhttp3.Call removePublicIpFromServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())) + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) .replace( - "{" + "publicIpId" + "}", - localVarApiClient.escapeString(publicIpId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -19319,6 +21156,11 @@ public okhttp3.Call removePublicIpFromServerCall( 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) { @@ -19336,7 +21178,7 @@ public okhttp3.Call removePublicIpFromServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "DELETE", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -19348,101 +21190,113 @@ public okhttp3.Call removePublicIpFromServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call removePublicIpFromServerValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID publicIpId, + private okhttp3.Call listRoutingTablesOfAreaValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling removePublicIpFromServer(Async)"); + "Missing the required parameter 'organizationId' when calling listRoutingTablesOfArea(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling removePublicIpFromServer(Async)"); + "Missing the required parameter 'areaId' when calling listRoutingTablesOfArea(Async)"); } - // verify the required parameter 'publicIpId' is set - if (publicIpId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'publicIpId' when calling removePublicIpFromServer(Async)"); + "Missing the required parameter 'region' when calling listRoutingTablesOfArea(Async)"); } - return removePublicIpFromServerCall(projectId, serverId, publicIpId, _callback); + return listRoutingTablesOfAreaCall( + organizationId, areaId, region, labelSelector, _callback); } /** - * Dissociate a public IP from a server. Dissociate a public IP on an existing server. + * List all routing tables in a network area. Get a list of all routing tables in a network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param publicIpId The identifier (ID) of a Public IP. (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 labelSelector Filter resources by labels. (optional) + * @return RoutingTableListResponse * @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 Detach Public IP from server was accepted. -
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The server or public IP was not found. -
409 A conflict has occurred. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public void removePublicIpFromServer( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID publicIpId) + public RoutingTableListResponse listRoutingTablesOfArea( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { - removePublicIpFromServerWithHttpInfo(projectId, serverId, publicIpId); + ApiResponse localVarResp = + listRoutingTablesOfAreaWithHttpInfo(organizationId, areaId, region, labelSelector); + return localVarResp.getData(); } /** - * Dissociate a public IP from a server. Dissociate a public IP on an existing server. + * List all routing tables in a network area. Get a list of all routing tables in a network + * area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param publicIpId The identifier (ID) of a Public IP. (required) - * @return ApiResponse<Void> + * @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 labelSelector Filter resources by labels. (optional) + * @return ApiResponse<RoutingTableListResponse> * @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 Detach Public IP from server was accepted. -
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The server or public IP was not found. -
409 A conflict has occurred. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ApiResponse removePublicIpFromServerWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID publicIpId) + public ApiResponse listRoutingTablesOfAreaWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { okhttp3.Call localVarCall = - removePublicIpFromServerValidateBeforeCall(projectId, serverId, publicIpId, null); - return localVarApiClient.execute(localVarCall); + listRoutingTablesOfAreaValidateBeforeCall( + organizationId, areaId, region, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Dissociate a public IP from a server. (asynchronously) Dissociate a public IP on an existing - * server. + * List all routing tables in a network area. (asynchronously) Get a list of all routing tables + * in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param publicIpId The identifier (ID) of a Public IP. (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 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 @@ -19451,34 +21305,35 @@ public ApiResponse removePublicIpFromServerWithHttpInfo( * * * - * + * * * * - * - * + * * *
Response Details
Status Code Description Response Headers
204 Detach Public IP from server was accepted. -
200 List all routing tables. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The server or public IP was not found. -
409 A conflict has occurred. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call removePublicIpFromServerAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID publicIpId, - final ApiCallback _callback) + public okhttp3.Call listRoutingTablesOfAreaAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - removePublicIpFromServerValidateBeforeCall( - projectId, serverId, publicIpId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + listRoutingTablesOfAreaValidateBeforeCall( + organizationId, areaId, region, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for removeSecurityGroupFromServer + * Build call for listSecurityGroupRules * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param region The STACKIT Region of the resources. (required) * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -19487,18 +21342,17 @@ public okhttp3.Call removePublicIpFromServerAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
204 Security group detachment request was accepted. -
200 List all rules of a security group. -
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 removeSecurityGroupFromServerCall( + public okhttp3.Call listSecurityGroupRulesCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID securityGroupId, final ApiCallback _callback) throws ApiException { @@ -19519,13 +21373,13 @@ public okhttp3.Call removeSecurityGroupFromServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())) + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "securityGroupId" + "}", localVarApiClient.escapeString(securityGroupId.toString())); @@ -19553,7 +21407,7 @@ public okhttp3.Call removeSecurityGroupFromServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "DELETE", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -19565,101 +21419,102 @@ public okhttp3.Call removeSecurityGroupFromServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call removeSecurityGroupFromServerValidateBeforeCall( + private okhttp3.Call listSecurityGroupRulesValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID securityGroupId, 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 removeSecurityGroupFromServer(Async)"); + "Missing the required parameter 'projectId' when calling listSecurityGroupRules(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling removeSecurityGroupFromServer(Async)"); + "Missing the required parameter 'region' when calling listSecurityGroupRules(Async)"); } // verify the required parameter 'securityGroupId' is set if (securityGroupId == null) { throw new ApiException( - "Missing the required parameter 'securityGroupId' when calling removeSecurityGroupFromServer(Async)"); + "Missing the required parameter 'securityGroupId' when calling listSecurityGroupRules(Async)"); } - return removeSecurityGroupFromServerCall(projectId, serverId, securityGroupId, _callback); + return listSecurityGroupRulesCall(projectId, region, securityGroupId, _callback); } /** - * Remove a server from a security group. Remove a server from a attached security group. + * List all rules for a security group. Get a list of all rules inside a security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param region The STACKIT Region of the resources. (required) * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @return SecurityGroupRuleListResponse * @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 Security group detachment request was accepted. -
200 List all rules of a security group. -
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 removeSecurityGroupFromServer( + public SecurityGroupRuleListResponse listSecurityGroupRules( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID securityGroupId) throws ApiException { - removeSecurityGroupFromServerWithHttpInfo(projectId, serverId, securityGroupId); + ApiResponse localVarResp = + listSecurityGroupRulesWithHttpInfo(projectId, region, securityGroupId); + return localVarResp.getData(); } /** - * Remove a server from a security group. Remove a server from a attached security group. + * List all rules for a security group. Get a list of all rules inside a security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param region The STACKIT Region of the resources. (required) * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) - * @return ApiResponse<Void> + * @return ApiResponse<SecurityGroupRuleListResponse> * @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 Security group detachment request was accepted. -
200 List all rules of a security group. -
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 removeSecurityGroupFromServerWithHttpInfo( + public ApiResponse listSecurityGroupRulesWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID securityGroupId) throws ApiException { okhttp3.Call localVarCall = - removeSecurityGroupFromServerValidateBeforeCall( - projectId, serverId, securityGroupId, null); - return localVarApiClient.execute(localVarCall); + listSecurityGroupRulesValidateBeforeCall(projectId, region, securityGroupId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Remove a server from a security group. (asynchronously) Remove a server from a attached + * List all rules for a security group. (asynchronously) Get a list of all rules inside a * security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param region The STACKIT Region of the resources. (required) * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -19669,35 +21524,35 @@ public ApiResponse removeSecurityGroupFromServerWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
204 Security group detachment request was accepted. -
200 List all rules of a security group. -
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 removeSecurityGroupFromServerAsync( + public okhttp3.Call listSecurityGroupRulesAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID securityGroupId, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - removeSecurityGroupFromServerValidateBeforeCall( - projectId, serverId, securityGroupId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + listSecurityGroupRulesValidateBeforeCall( + projectId, region, securityGroupId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for removeServiceAccountFromServer + * Build call for listSecurityGroups * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param serviceAccountMail The e-mail address of a service account. (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 @@ -19705,19 +21560,18 @@ public okhttp3.Call removeSecurityGroupFromServerAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
200 Service account detached from the server. -
200 List all security groups 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call removeServiceAccountFromServerCall( + public okhttp3.Call listSecurityGroupsCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull String serviceAccountMail, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -19737,16 +21591,13 @@ public okhttp3.Call removeServiceAccountFromServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + "/v2/projects/{projectId}/regions/{region}/security-groups" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())) - .replace( - "{" + "serviceAccountMail" + "}", - localVarApiClient.escapeString(serviceAccountMail.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -19754,6 +21605,11 @@ public okhttp3.Call removeServiceAccountFromServerCall( 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) { @@ -19771,7 +21627,7 @@ public okhttp3.Call removeServiceAccountFromServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "DELETE", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -19783,107 +21639,99 @@ public okhttp3.Call removeServiceAccountFromServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call removeServiceAccountFromServerValidateBeforeCall( + private okhttp3.Call listSecurityGroupsValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull String serviceAccountMail, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, 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 removeServiceAccountFromServer(Async)"); - } - - // verify the required parameter 'serverId' is set - if (serverId == null) { - throw new ApiException( - "Missing the required parameter 'serverId' when calling removeServiceAccountFromServer(Async)"); + "Missing the required parameter 'projectId' when calling listSecurityGroups(Async)"); } - // verify the required parameter 'serviceAccountMail' is set - if (serviceAccountMail == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'serviceAccountMail' when calling removeServiceAccountFromServer(Async)"); + "Missing the required parameter 'region' when calling listSecurityGroups(Async)"); } - return removeServiceAccountFromServerCall( - projectId, serverId, serviceAccountMail, _callback); + return listSecurityGroupsCall(projectId, region, labelSelector, _callback); } /** - * Detach a service account from a server. Detach an additional service account from the server. + * List all security groups inside a project. Get a list of all security groups inside a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param serviceAccountMail The e-mail address of a service account. (required) - * @return ServiceAccountMailListResponse + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return SecurityGroupListResponse * @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 Service account detached from the server. -
200 List all security groups 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ServiceAccountMailListResponse removeServiceAccountFromServer( + public SecurityGroupListResponse listSecurityGroups( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull String serviceAccountMail) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { - ApiResponse localVarResp = - removeServiceAccountFromServerWithHttpInfo(projectId, serverId, serviceAccountMail); + ApiResponse localVarResp = + listSecurityGroupsWithHttpInfo(projectId, region, labelSelector); return localVarResp.getData(); } /** - * Detach a service account from a server. Detach an additional service account from the server. + * List all security groups inside a project. Get a list of all security groups inside a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param serviceAccountMail The e-mail address of a service account. (required) - * @return ApiResponse<ServiceAccountMailListResponse> + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return ApiResponse<SecurityGroupListResponse> * @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 Service account detached from the server. -
200 List all security groups 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ApiResponse removeServiceAccountFromServerWithHttpInfo( + public ApiResponse listSecurityGroupsWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull String serviceAccountMail) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { okhttp3.Call localVarCall = - removeServiceAccountFromServerValidateBeforeCall( - projectId, serverId, serviceAccountMail, null); - Type localVarReturnType = new TypeToken() {}.getType(); + listSecurityGroupsValidateBeforeCall(projectId, region, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Detach a service account from a server. (asynchronously) Detach an additional service account - * from the server. + * List all security groups inside a project. (asynchronously) Get a list of all security groups + * inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param serviceAccountMail The e-mail address of a service account. (required) + * @param region The STACKIT Region of the resources. (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 @@ -19892,36 +21740,34 @@ public ApiResponse removeServiceAccountFromServe * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
200 Service account detached from the server. -
200 List all security groups 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call removeServiceAccountFromServerAsync( + public okhttp3.Call listSecurityGroupsAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull String serviceAccountMail, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - removeServiceAccountFromServerValidateBeforeCall( - projectId, serverId, serviceAccountMail, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listSecurityGroupsValidateBeforeCall(projectId, region, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for removeVolumeFromServer + * Build call for listServerNICs * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -19929,19 +21775,18 @@ public okhttp3.Call removeServiceAccountFromServerAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
204 Volume detachment request was accepted. -
200 List network interfaces. -
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 removeVolumeFromServerCall( + public okhttp3.Call listServerNICsCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -19961,16 +21806,16 @@ public okhttp3.Call removeVolumeFromServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())) + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( - "{" + "volumeId" + "}", - localVarApiClient.escapeString(volumeId.toString())); + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -19995,7 +21840,7 @@ public okhttp3.Call removeVolumeFromServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "DELETE", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -20007,101 +21852,103 @@ public okhttp3.Call removeVolumeFromServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call removeVolumeFromServerValidateBeforeCall( + private okhttp3.Call listServerNICsValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, 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 removeVolumeFromServer(Async)"); + "Missing the required parameter 'projectId' when calling listServerNICs(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling removeVolumeFromServer(Async)"); + "Missing the required parameter 'region' when calling listServerNICs(Async)"); } - // verify the required parameter 'volumeId' is set - if (volumeId == null) { + // verify the required parameter 'serverId' is set + if (serverId == null) { throw new ApiException( - "Missing the required parameter 'volumeId' when calling removeVolumeFromServer(Async)"); + "Missing the required parameter 'serverId' when calling listServerNICs(Async)"); } - return removeVolumeFromServerCall(projectId, serverId, volumeId, _callback); + return listServerNICsCall(projectId, region, serverId, _callback); } /** - * Detach a volume from a server. Detach an existing volume from an existing server. + * Get all network interfaces. Get all network interfaces attached to the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @return NICListResponse * @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 Volume detachment request was accepted. -
200 List network interfaces. -
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 removeVolumeFromServer( + public NICListResponse listServerNICs( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) throws ApiException { - removeVolumeFromServerWithHttpInfo(projectId, serverId, volumeId); + ApiResponse localVarResp = + listServerNICsWithHttpInfo(projectId, region, serverId); + return localVarResp.getData(); } /** - * Detach a volume from a server. Detach an existing volume from an existing server. + * Get all network interfaces. Get all network interfaces attached to the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @return ApiResponse<Void> + * @return ApiResponse<NICListResponse> * @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 Volume detachment request was accepted. -
200 List network interfaces. -
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 removeVolumeFromServerWithHttpInfo( + public ApiResponse listServerNICsWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) throws ApiException { okhttp3.Call localVarCall = - removeVolumeFromServerValidateBeforeCall(projectId, serverId, volumeId, null); - return localVarApiClient.execute(localVarCall); + listServerNICsValidateBeforeCall(projectId, region, serverId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Detach a volume from a server. (asynchronously) Detach an existing volume from an existing + * Get all network interfaces. (asynchronously) Get all network interfaces attached to the * server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (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 @@ -20110,34 +21957,34 @@ public ApiResponse removeVolumeFromServerWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
204 Volume detachment request was accepted. -
200 List network interfaces. -
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 removeVolumeFromServerAsync( + public okhttp3.Call listServerNICsAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - removeVolumeFromServerValidateBeforeCall(projectId, serverId, volumeId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + listServerNICsValidateBeforeCall(projectId, region, serverId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for rescueServer + * Build call for listServerServiceAccounts * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param rescueServerPayload Request a server rescue. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -20145,19 +21992,18 @@ public okhttp3.Call removeVolumeFromServerAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server rescue request accepted. -
200 List service accounts. -
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 rescueServerCall( + public okhttp3.Call listServerServiceAccountsCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull RescueServerPayload rescueServerPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -20173,14 +22019,17 @@ public okhttp3.Call rescueServerCall( basePath = null; } - Object localVarPostBody = rescueServerPayload; + Object localVarPostBody = null; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/rescue" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "serverId" + "}", localVarApiClient.escapeString(serverId.toString())); @@ -20197,7 +22046,7 @@ public okhttp3.Call rescueServerCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -20208,7 +22057,7 @@ public okhttp3.Call rescueServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -20220,106 +22069,103 @@ public okhttp3.Call rescueServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call rescueServerValidateBeforeCall( + private okhttp3.Call listServerServiceAccountsValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull RescueServerPayload rescueServerPayload, 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 rescueServer(Async)"); + "Missing the required parameter 'projectId' when calling listServerServiceAccounts(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling rescueServer(Async)"); + "Missing the required parameter 'region' when calling listServerServiceAccounts(Async)"); } - // verify the required parameter 'rescueServerPayload' is set - if (rescueServerPayload == null) { + // verify the required parameter 'serverId' is set + if (serverId == null) { throw new ApiException( - "Missing the required parameter 'rescueServerPayload' when calling rescueServer(Async)"); + "Missing the required parameter 'serverId' when calling listServerServiceAccounts(Async)"); } - return rescueServerCall(projectId, serverId, rescueServerPayload, _callback); + return listServerServiceAccountsCall(projectId, region, serverId, _callback); } /** - * Rescue an existing server. Rescue an existing server. It is shutdown and the initial image is - * attached as the boot volume, while the boot volume is attached as secondary volume and the - * server is booted. + * List all service accounts of the Server. Get the list of the service accounts of the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param rescueServerPayload Request a server rescue. (required) + * @return ServiceAccountMailListResponse * @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 Server rescue request accepted. -
200 List service accounts. -
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 rescueServer( + public ServiceAccountMailListResponse listServerServiceAccounts( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull RescueServerPayload rescueServerPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) throws ApiException { - rescueServerWithHttpInfo(projectId, serverId, rescueServerPayload); - } + ApiResponse localVarResp = + listServerServiceAccountsWithHttpInfo(projectId, region, serverId); + return localVarResp.getData(); + } /** - * Rescue an existing server. Rescue an existing server. It is shutdown and the initial image is - * attached as the boot volume, while the boot volume is attached as secondary volume and the - * server is booted. + * List all service accounts of the Server. Get the list of the service accounts of the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param rescueServerPayload Request a server rescue. (required) - * @return ApiResponse<Void> + * @return ApiResponse<ServiceAccountMailListResponse> * @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 Server rescue request accepted. -
200 List service accounts. -
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 rescueServerWithHttpInfo( + public ApiResponse listServerServiceAccountsWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull RescueServerPayload rescueServerPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) throws ApiException { okhttp3.Call localVarCall = - rescueServerValidateBeforeCall(projectId, serverId, rescueServerPayload, null); - return localVarApiClient.execute(localVarCall); + listServerServiceAccountsValidateBeforeCall(projectId, region, serverId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Rescue an existing server. (asynchronously) Rescue an existing server. It is shutdown and the - * initial image is attached as the boot volume, while the boot volume is attached as secondary - * volume and the server is booted. + * List all service accounts of the Server. (asynchronously) Get the list of the service + * accounts of the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param rescueServerPayload Request a server rescue. (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 @@ -20328,34 +22174,35 @@ public ApiResponse rescueServerWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server rescue request accepted. -
200 List service accounts. -
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 rescueServerAsync( + public okhttp3.Call listServerServiceAccountsAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull RescueServerPayload rescueServerPayload, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - rescueServerValidateBeforeCall(projectId, serverId, rescueServerPayload, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + listServerServiceAccountsValidateBeforeCall(projectId, region, serverId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for resizeServer + * Build call for listServers * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param resizeServerPayload Request a resize of a server. (required) + * @param region The STACKIT Region of the resources. (required) + * @param details Show detailed information about server. (optional, default to false) + * @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 @@ -20363,19 +22210,19 @@ public okhttp3.Call rescueServerAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server resize request is accepted. -
200 List all servers 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call resizeServerCall( + public okhttp3.Call listServersCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable Boolean details, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -20391,17 +22238,17 @@ public okhttp3.Call resizeServerCall( basePath = null; } - Object localVarPostBody = resizeServerPayload; + Object localVarPostBody = null; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/resize" + "/v2/projects/{projectId}/regions/{region}/servers" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -20409,13 +22256,22 @@ public okhttp3.Call resizeServerCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (details != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("details", details)); + } + + 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 = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -20426,7 +22282,7 @@ public okhttp3.Call resizeServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -20438,100 +22294,103 @@ public okhttp3.Call resizeServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call resizeServerValidateBeforeCall( + private okhttp3.Call listServersValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable Boolean details, + @javax.annotation.Nullable String labelSelector, 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 resizeServer(Async)"); - } - - // verify the required parameter 'serverId' is set - if (serverId == null) { - throw new ApiException( - "Missing the required parameter 'serverId' when calling resizeServer(Async)"); + "Missing the required parameter 'projectId' when calling listServers(Async)"); } - // verify the required parameter 'resizeServerPayload' is set - if (resizeServerPayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'resizeServerPayload' when calling resizeServer(Async)"); + "Missing the required parameter 'region' when calling listServers(Async)"); } - return resizeServerCall(projectId, serverId, resizeServerPayload, _callback); + return listServersCall(projectId, region, details, labelSelector, _callback); } /** - * Resize a server. Resize the server to the given machine type. + * List all servers inside a project. Get a list of all servers inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param resizeServerPayload Request a resize of a server. (required) + * @param region The STACKIT Region of the resources. (required) + * @param details Show detailed information about server. (optional, default to false) + * @param labelSelector Filter resources by labels. (optional) + * @return ServerListResponse * @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 Server resize request is accepted. -
200 List all servers 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public void resizeServer( + public ServerListResponse listServers( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable Boolean details, + @javax.annotation.Nullable String labelSelector) throws ApiException { - resizeServerWithHttpInfo(projectId, serverId, resizeServerPayload); + ApiResponse localVarResp = + listServersWithHttpInfo(projectId, region, details, labelSelector); + return localVarResp.getData(); } /** - * Resize a server. Resize the server to the given machine type. + * List all servers inside a project. Get a list of all servers inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param resizeServerPayload Request a resize of a server. (required) - * @return ApiResponse<Void> + * @param region The STACKIT Region of the resources. (required) + * @param details Show detailed information about server. (optional, default to false) + * @param labelSelector Filter resources by labels. (optional) + * @return ApiResponse<ServerListResponse> * @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 Server resize request is accepted. -
200 List all servers 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public ApiResponse resizeServerWithHttpInfo( + public ApiResponse listServersWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable Boolean details, + @javax.annotation.Nullable String labelSelector) throws ApiException { okhttp3.Call localVarCall = - resizeServerValidateBeforeCall(projectId, serverId, resizeServerPayload, null); - return localVarApiClient.execute(localVarCall); + listServersValidateBeforeCall(projectId, region, details, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Resize a server. (asynchronously) Resize the server to the given machine type. + * List all servers inside a project. (asynchronously) Get a list of all servers inside a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param resizeServerPayload Request a resize of a server. (required) + * @param region The STACKIT Region of the resources. (required) + * @param details Show detailed information about server. (optional, default to false) + * @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 @@ -20540,34 +22399,35 @@ public ApiResponse resizeServerWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server resize request is accepted. -
200 List all servers 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public okhttp3.Call resizeServerAsync( + public okhttp3.Call listServersAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable Boolean details, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - resizeServerValidateBeforeCall(projectId, serverId, resizeServerPayload, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + listServersValidateBeforeCall(projectId, region, details, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for resizeVolume + * Build call for listSnapshotsInProject * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param resizeVolumePayload Request a volume resize. (optional) + * @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 @@ -20575,19 +22435,18 @@ public okhttp3.Call resizeServerAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Volume resize request accepted. -
200 List project snapshots. -
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 resizeVolumeCall( + public okhttp3.Call listSnapshotsInProjectCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -20603,17 +22462,17 @@ public okhttp3.Call resizeVolumeCall( basePath = null; } - Object localVarPostBody = resizeVolumePayload; + Object localVarPostBody = null; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/volumes/{volumeId}/resize" + "/v2/projects/{projectId}/regions/{region}/snapshots" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "volumeId" + "}", - localVarApiClient.escapeString(volumeId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -20621,13 +22480,18 @@ public okhttp3.Call resizeVolumeCall( 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 = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -20638,7 +22502,7 @@ public okhttp3.Call resizeVolumeCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -20650,97 +22514,97 @@ public okhttp3.Call resizeVolumeCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call resizeVolumeValidateBeforeCall( + private okhttp3.Call listSnapshotsInProjectValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, 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 resizeVolume(Async)"); + "Missing the required parameter 'projectId' when calling listSnapshotsInProject(Async)"); } - // verify the required parameter 'volumeId' is set - if (volumeId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'volumeId' when calling resizeVolume(Async)"); + "Missing the required parameter 'region' when calling listSnapshotsInProject(Async)"); } - return resizeVolumeCall(projectId, volumeId, resizeVolumePayload, _callback); + return listSnapshotsInProjectCall(projectId, region, labelSelector, _callback); } /** - * Update the size of a volume. Update the size of a block device volume. The new volume size - * must be larger than the current size. + * List all snapshots inside a project. Get a list of all snapshots inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param resizeVolumePayload Request a volume resize. (optional) + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return SnapshotListResponse * @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 resize request accepted. -
200 List project snapshots. -
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 resizeVolume( + public SnapshotListResponse listSnapshotsInProject( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { - resizeVolumeWithHttpInfo(projectId, volumeId, resizeVolumePayload); + ApiResponse localVarResp = + listSnapshotsInProjectWithHttpInfo(projectId, region, labelSelector); + return localVarResp.getData(); } /** - * Update the size of a volume. Update the size of a block device volume. The new volume size - * must be larger than the current size. + * List all snapshots inside a project. Get a list of all snapshots inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param resizeVolumePayload Request a volume resize. (optional) - * @return ApiResponse<Void> + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return ApiResponse<SnapshotListResponse> * @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 resize request accepted. -
200 List project snapshots. -
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 resizeVolumeWithHttpInfo( + public ApiResponse listSnapshotsInProjectWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { okhttp3.Call localVarCall = - resizeVolumeValidateBeforeCall(projectId, volumeId, resizeVolumePayload, null); - return localVarApiClient.execute(localVarCall); + listSnapshotsInProjectValidateBeforeCall(projectId, region, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update the size of a volume. (asynchronously) Update the size of a block device volume. The - * new volume size must be larger than the current size. + * List all snapshots inside a project. (asynchronously) Get a list of all snapshots inside a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param resizeVolumePayload Request a volume resize. (optional) + * @param region The STACKIT Region of the resources. (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 @@ -20749,33 +22613,35 @@ public ApiResponse resizeVolumeWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Volume resize request accepted. -
200 List project snapshots. -
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 resizeVolumeAsync( + public okhttp3.Call listSnapshotsInProjectAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - resizeVolumeValidateBeforeCall(projectId, volumeId, resizeVolumePayload, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + listSnapshotsInProjectValidateBeforeCall( + projectId, region, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for restoreBackup + * Build call for listVolumePerformanceClasses * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (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 @@ -20783,7 +22649,7 @@ public okhttp3.Call resizeVolumeAsync( * * * - * + * * * * @@ -20791,9 +22657,10 @@ public okhttp3.Call resizeVolumeAsync( * *
Response Details
Status Code Description Response Headers
202 Backup restore request has been accepted. -
200 List volume performance classes. -
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 restoreBackupCall( + public okhttp3.Call listVolumePerformanceClassesCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -20813,13 +22680,13 @@ public okhttp3.Call restoreBackupCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/backups/{backupId}/restore" + "/v2/projects/{projectId}/regions/{region}/volume-performance-classes" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "backupId" + "}", - localVarApiClient.escapeString(backupId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -20827,6 +22694,11 @@ public okhttp3.Call restoreBackupCall( 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) { @@ -20844,7 +22716,7 @@ public okhttp3.Call restoreBackupCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -20856,40 +22728,42 @@ public okhttp3.Call restoreBackupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call restoreBackupValidateBeforeCall( + private okhttp3.Call listVolumePerformanceClassesValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, 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 restoreBackup(Async)"); + "Missing the required parameter 'projectId' when calling listVolumePerformanceClasses(Async)"); } - // verify the required parameter 'backupId' is set - if (backupId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'backupId' when calling restoreBackup(Async)"); + "Missing the required parameter 'region' when calling listVolumePerformanceClasses(Async)"); } - return restoreBackupCall(projectId, backupId, _callback); + return listVolumePerformanceClassesCall(projectId, region, labelSelector, _callback); } /** - * Restore Backup to the referenced source Volume. Restores a Backup to the existing Volume it - * references to. The use of this endpoint is disruptive as the volume needs to be detached. If - * a new volume is to be created use the volumes endpoint with the option to create from backup. + * List all volume performance classes available for a project. Get a list of all volume + * performance classes available inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return VolumePerformanceClassListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -20897,27 +22771,31 @@ private okhttp3.Call restoreBackupValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
202 Backup restore request has been accepted. -
200 List volume performance classes. -
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 void restoreBackup( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID backupId) + public VolumePerformanceClassListResponse listVolumePerformanceClasses( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { - restoreBackupWithHttpInfo(projectId, backupId); + ApiResponse localVarResp = + listVolumePerformanceClassesWithHttpInfo(projectId, region, labelSelector); + return localVarResp.getData(); } /** - * Restore Backup to the referenced source Volume. Restores a Backup to the existing Volume it - * references to. The use of this endpoint is disruptive as the volume needs to be detached. If - * a new volume is to be created use the volumes endpoint with the option to create from backup. + * List all volume performance classes available for a project. Get a list of all volume + * performance classes available inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) - * @return ApiResponse<Void> + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return ApiResponse<VolumePerformanceClassListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -20925,21 +22803,25 @@ public void restoreBackup( * *
Response Details
Status Code Description Response Headers
202 Backup restore request has been accepted. -
200 List volume performance classes. -
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 restoreBackupWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID backupId) + public ApiResponse listVolumePerformanceClassesWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { - okhttp3.Call localVarCall = restoreBackupValidateBeforeCall(projectId, backupId, null); - return localVarApiClient.execute(localVarCall); + okhttp3.Call localVarCall = + listVolumePerformanceClassesValidateBeforeCall( + projectId, region, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Restore Backup to the referenced source Volume. (asynchronously) Restores a Backup to the - * existing Volume it references to. The use of this endpoint is disruptive as the volume needs - * to be detached. If a new volume is to be created use the volumes endpoint with the option to - * create from backup. + * List all volume performance classes available for a project. (asynchronously) Get a list of + * all volume performance classes available inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param region The STACKIT Region of the resources. (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 @@ -20948,7 +22830,7 @@ public ApiResponse restoreBackupWithHttpInfo( * * * - * + * * * * @@ -20956,23 +22838,27 @@ public ApiResponse restoreBackupWithHttpInfo( * *
Response Details
Status Code Description Response Headers
202 Backup restore request has been accepted. -
200 List volume performance classes. -
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 restoreBackupAsync( + public okhttp3.Call listVolumePerformanceClassesAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = restoreBackupValidateBeforeCall(projectId, backupId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = + listVolumePerformanceClassesValidateBeforeCall( + projectId, region, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for setImageShare + * Build call for listVolumes * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param setImageSharePayload Settings for an Image Share. (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 @@ -20980,7 +22866,7 @@ public okhttp3.Call restoreBackupAsync( * * * - * + * * * * @@ -20988,10 +22874,10 @@ public okhttp3.Call restoreBackupAsync( * *
Response Details
Status Code Description Response Headers
200 Setting Image share successful. -
200 List project volumes. -
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 setImageShareCall( + public okhttp3.Call listVolumesCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -21007,17 +22893,17 @@ public okhttp3.Call setImageShareCall( basePath = null; } - Object localVarPostBody = setImageSharePayload; + Object localVarPostBody = null; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images/{imageId}/share" + "/v2/projects/{projectId}/regions/{region}/volumes" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "imageId" + "}", - localVarApiClient.escapeString(imageId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -21025,13 +22911,18 @@ public okhttp3.Call setImageShareCall( 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 = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -21042,7 +22933,7 @@ public okhttp3.Call setImageShareCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PUT", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -21054,47 +22945,41 @@ public okhttp3.Call setImageShareCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call setImageShareValidateBeforeCall( + private okhttp3.Call listVolumesValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, 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 setImageShare(Async)"); - } - - // verify the required parameter 'imageId' is set - if (imageId == null) { - throw new ApiException( - "Missing the required parameter 'imageId' when calling setImageShare(Async)"); + "Missing the required parameter 'projectId' when calling listVolumes(Async)"); } - // verify the required parameter 'setImageSharePayload' is set - if (setImageSharePayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'setImageSharePayload' when calling setImageShare(Async)"); + "Missing the required parameter 'region' when calling listVolumes(Async)"); } - return setImageShareCall(projectId, imageId, setImageSharePayload, _callback); + return listVolumesCall(projectId, region, labelSelector, _callback); } /** - * Set image share. Set share of an Image. New Options will replace existing settings. + * List all volumes inside a project. Get a list of all volumes inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param setImageSharePayload Settings for an Image Share. (required) - * @return ImageShare + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return VolumeListResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -21102,30 +22987,30 @@ private okhttp3.Call setImageShareValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Setting Image share successful. -
200 List project volumes. -
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 ImageShare setImageShare( + public VolumeListResponse listVolumes( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { - ApiResponse localVarResp = - setImageShareWithHttpInfo(projectId, imageId, setImageSharePayload); + ApiResponse localVarResp = + listVolumesWithHttpInfo(projectId, region, labelSelector); return localVarResp.getData(); } /** - * Set image share. Set share of an Image. New Options will replace existing settings. + * List all volumes inside a project. Get a list of all volumes inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param setImageSharePayload Settings for an Image Share. (required) - * @return ApiResponse<ImageShare> + * @param region The STACKIT Region of the resources. (required) + * @param labelSelector Filter resources by labels. (optional) + * @return ApiResponse<VolumeListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -21133,24 +23018,24 @@ public ImageShare setImageShare( * *
Response Details
Status Code Description Response Headers
200 Setting Image share successful. -
200 List project volumes. -
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 setImageShareWithHttpInfo( + public ApiResponse listVolumesWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector) throws ApiException { okhttp3.Call localVarCall = - setImageShareValidateBeforeCall(projectId, imageId, setImageSharePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + listVolumesValidateBeforeCall(projectId, region, labelSelector, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Set image share. (asynchronously) Set share of an Image. New Options will replace existing - * settings. + * List all volumes inside a project. (asynchronously) Get a list of all volumes inside a + * project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param setImageSharePayload Settings for an Image Share. (required) + * @param region The STACKIT Region of the resources. (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 @@ -21159,7 +23044,7 @@ public ApiResponse setImageShareWithHttpInfo( * * * - * + * * * * @@ -21167,26 +23052,27 @@ public ApiResponse setImageShareWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Setting Image share successful. -
200 List project volumes. -
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 setImageShareAsync( + public okhttp3.Call listVolumesAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - setImageShareValidateBeforeCall( - projectId, imageId, setImageSharePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listVolumesValidateBeforeCall(projectId, region, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for startServer + * Build call for partialUpdateNetwork * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param partialUpdateNetworkPayload Request an update of a network. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -21194,18 +23080,19 @@ public okhttp3.Call setImageShareAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server start request accepted. -
202 An update was 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 startServerCall( + public okhttp3.Call partialUpdateNetworkCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -21221,17 +23108,20 @@ public okhttp3.Call startServerCall( basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = partialUpdateNetworkPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/start" + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -21245,7 +23135,7 @@ public okhttp3.Call startServerCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -21256,7 +23146,7 @@ public okhttp3.Call startServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -21268,57 +23158,78 @@ public okhttp3.Call startServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call startServerValidateBeforeCall( + private okhttp3.Call partialUpdateNetworkValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload, 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 startServer(Async)"); + "Missing the required parameter 'projectId' when calling partialUpdateNetwork(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling startServer(Async)"); + "Missing the required parameter 'region' when calling partialUpdateNetwork(Async)"); + } + + // verify the required parameter 'networkId' is set + if (networkId == null) { + throw new ApiException( + "Missing the required parameter 'networkId' when calling partialUpdateNetwork(Async)"); + } + + // verify the required parameter 'partialUpdateNetworkPayload' is set + if (partialUpdateNetworkPayload == null) { + throw new ApiException( + "Missing the required parameter 'partialUpdateNetworkPayload' when calling partialUpdateNetwork(Async)"); } - return startServerCall(projectId, serverId, _callback); + return partialUpdateNetworkCall( + projectId, region, networkId, partialUpdateNetworkPayload, _callback); } /** - * Boot up a server. Start an existing server or allocates the server if deallocated. + * Update network settings. Update the settings of a network inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param partialUpdateNetworkPayload Request an update of a network. (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
202 Server start request accepted. -
202 An update was 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 startServer( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public void partialUpdateNetwork( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload) throws ApiException { - startServerWithHttpInfo(projectId, serverId); + partialUpdateNetworkWithHttpInfo(projectId, region, networkId, partialUpdateNetworkPayload); } /** - * Boot up a server. Start an existing server or allocates the server if deallocated. + * Update network settings. Update the settings of a network inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param partialUpdateNetworkPayload Request an update of a network. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -21326,28 +23237,33 @@ public void startServer( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server start request accepted. -
202 An update was 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 startServerWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public ApiResponse partialUpdateNetworkWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload) throws ApiException { - okhttp3.Call localVarCall = startServerValidateBeforeCall(projectId, serverId, null); + okhttp3.Call localVarCall = + partialUpdateNetworkValidateBeforeCall( + projectId, region, networkId, partialUpdateNetworkPayload, null); return localVarApiClient.execute(localVarCall); } /** - * Boot up a server. (asynchronously) Start an existing server or allocates the server if - * deallocated. + * Update network settings. (asynchronously) Update the settings of a network inside a project. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param partialUpdateNetworkPayload Request an update of a network. (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 @@ -21356,31 +23272,35 @@ public ApiResponse startServerWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server start request accepted. -
202 An update was 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 startServerAsync( + public okhttp3.Call partialUpdateNetworkAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = startServerValidateBeforeCall(projectId, serverId, _callback); + okhttp3.Call localVarCall = + partialUpdateNetworkValidateBeforeCall( + projectId, region, networkId, partialUpdateNetworkPayload, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for stopServer + * Build call for partialUpdateNetworkArea * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param partialUpdateNetworkAreaPayload Request to update an Area. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -21388,22 +23308,23 @@ public okhttp3.Call startServerAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server stop request accepted. -
200 Area has been updated. -
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 stopServerCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers + public okhttp3.Call partialUpdateNetworkAreaCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull + PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers String[] localBasePaths = new String[] {}; // Determine Base Path to Use @@ -21415,17 +23336,17 @@ public okhttp3.Call stopServerCall( basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = partialUpdateNetworkAreaPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/stop" + "/v2/organizations/{organizationId}/network-areas/{areaId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "serverId" + "}", - localVarApiClient.escapeString(serverId.toString())); + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -21439,7 +23360,7 @@ public okhttp3.Call stopServerCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -21450,7 +23371,7 @@ public okhttp3.Call stopServerCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -21462,91 +23383,109 @@ public okhttp3.Call stopServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call stopServerValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, + private okhttp3.Call partialUpdateNetworkAreaValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull + PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling stopServer(Async)"); + "Missing the required parameter 'organizationId' when calling partialUpdateNetworkArea(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling stopServer(Async)"); + "Missing the required parameter 'areaId' when calling partialUpdateNetworkArea(Async)"); + } + + // verify the required parameter 'partialUpdateNetworkAreaPayload' is set + if (partialUpdateNetworkAreaPayload == null) { + throw new ApiException( + "Missing the required parameter 'partialUpdateNetworkAreaPayload' when calling partialUpdateNetworkArea(Async)"); } - return stopServerCall(projectId, serverId, _callback); + return partialUpdateNetworkAreaCall( + organizationId, areaId, partialUpdateNetworkAreaPayload, _callback); } /** - * Stop an existing server. Stops an existing server. The server will remain on the Hypervisor - * and will be charged full price for all resources attached to it. The attached resources will - * remain reserved. Useful particularly for vGPU servers. + * Update network area settings. Update the settings of a network area in an organization. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param partialUpdateNetworkAreaPayload Request to update an Area. (required) + * @return NetworkArea * @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 Server stop request accepted. -
200 Area has been updated. -
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 stopServer( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public NetworkArea partialUpdateNetworkArea( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull + PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload) throws ApiException { - stopServerWithHttpInfo(projectId, serverId); + ApiResponse localVarResp = + partialUpdateNetworkAreaWithHttpInfo( + organizationId, areaId, partialUpdateNetworkAreaPayload); + return localVarResp.getData(); } /** - * Stop an existing server. Stops an existing server. The server will remain on the Hypervisor - * and will be charged full price for all resources attached to it. The attached resources will - * remain reserved. Useful particularly for vGPU servers. + * Update network area settings. Update the settings of a network area in an organization. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @return ApiResponse<Void> + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param partialUpdateNetworkAreaPayload Request to update an Area. (required) + * @return ApiResponse<NetworkArea> * @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 Server stop request accepted. -
200 Area has been updated. -
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 stopServerWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public ApiResponse partialUpdateNetworkAreaWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull + PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload) throws ApiException { - okhttp3.Call localVarCall = stopServerValidateBeforeCall(projectId, serverId, null); - return localVarApiClient.execute(localVarCall); + okhttp3.Call localVarCall = + partialUpdateNetworkAreaValidateBeforeCall( + organizationId, areaId, partialUpdateNetworkAreaPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Stop an existing server. (asynchronously) Stops an existing server. The server will remain on - * the Hypervisor and will be charged full price for all resources attached to it. The attached - * resources will remain reserved. Useful particularly for vGPU servers. + * Update network area settings. (asynchronously) Update the settings of a network area in an + * organization. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param partialUpdateNetworkAreaPayload Request to update an Area. (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 @@ -21555,31 +23494,37 @@ public ApiResponse stopServerWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
202 Server stop request accepted. -
200 Area has been updated. -
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 stopServerAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID serverId, - final ApiCallback _callback) + public okhttp3.Call partialUpdateNetworkAreaAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull + PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = stopServerValidateBeforeCall(projectId, serverId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = + partialUpdateNetworkAreaValidateBeforeCall( + organizationId, areaId, partialUpdateNetworkAreaPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for unrescueServer + * Build call for rebootServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param action Defines if it is a soft or a hard reboot. (optional, default to soft) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -21587,7 +23532,7 @@ public okhttp3.Call stopServerAsync( * * * - * + * * * * @@ -21596,9 +23541,11 @@ public okhttp3.Call stopServerAsync( * *
Response Details
Status Code Description Response Headers
202 Server unrescue request accepted. -
202 Server reboot request accepted. -
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 unrescueServerCall( + public okhttp3.Call rebootServerCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable String action, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -21618,10 +23565,13 @@ public okhttp3.Call unrescueServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/unrescue" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/reboot" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "serverId" + "}", localVarApiClient.escapeString(serverId.toString())); @@ -21632,6 +23582,10 @@ public okhttp3.Call unrescueServerCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (action != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("action", action)); + } + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -21661,39 +23615,50 @@ public okhttp3.Call unrescueServerCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call unrescueServerValidateBeforeCall( + private okhttp3.Call rebootServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable String action, 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 unrescueServer(Async)"); + "Missing the required parameter 'projectId' when calling rebootServer(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling rebootServer(Async)"); } // verify the required parameter 'serverId' is set if (serverId == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling unrescueServer(Async)"); + "Missing the required parameter 'serverId' when calling rebootServer(Async)"); } - return unrescueServerCall(projectId, serverId, _callback); + return rebootServerCall(projectId, region, serverId, action, _callback); } /** - * Unrescue an existing server. Unrescue an existing server. The original boot volume is - * attached as boot volume of the server and the server is booted up. + * Reboot the server. Reboot the server. A soft reboot will attempt to gracefully shut down the + * server by passing the command to the operating system. A hard reboot will power cycle the + * server without waiting for the operating system to shutdown properly. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param action Defines if it is a soft or a hard reboot. (optional, default to soft) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -21702,18 +23667,24 @@ private okhttp3.Call unrescueServerValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
202 Server unrescue request accepted. -
202 Server reboot request accepted. -
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 void unrescueServer( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public void rebootServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable String action) throws ApiException { - unrescueServerWithHttpInfo(projectId, serverId); + rebootServerWithHttpInfo(projectId, region, serverId, action); } /** - * Unrescue an existing server. Unrescue an existing server. The original boot volume is - * attached as boot volume of the server and the server is booted up. + * Reboot the server. Reboot the server. A soft reboot will attempt to gracefully shut down the + * server by passing the command to the operating system. A hard reboot will power cycle the + * server without waiting for the operating system to shutdown properly. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param action Defines if it is a soft or a hard reboot. (optional, default to soft) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -21721,7 +23692,7 @@ public void unrescueServer( * * * - * + * * * * @@ -21730,19 +23701,26 @@ public void unrescueServer( * *
Response Details
Status Code Description Response Headers
202 Server unrescue request accepted. -
202 Server reboot request accepted. -
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 unrescueServerWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + public ApiResponse rebootServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable String action) throws ApiException { - okhttp3.Call localVarCall = unrescueServerValidateBeforeCall(projectId, serverId, null); + okhttp3.Call localVarCall = + rebootServerValidateBeforeCall(projectId, region, serverId, action, null); return localVarApiClient.execute(localVarCall); } /** - * Unrescue an existing server. (asynchronously) Unrescue an existing server. The original boot - * volume is attached as boot volume of the server and the server is booted up. + * Reboot the server. (asynchronously) Reboot the server. A soft reboot will attempt to + * gracefully shut down the server by passing the command to the operating system. A hard reboot + * will power cycle the server without waiting for the operating system to shutdown properly. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param action Defines if it is a soft or a hard reboot. (optional, default to soft) * @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 @@ -21751,7 +23729,7 @@ public ApiResponse unrescueServerWithHttpInfo( * * * - * + * * * * @@ -21760,25 +23738,27 @@ public ApiResponse unrescueServerWithHttpInfo( * *
Response Details
Status Code Description Response Headers
202 Server unrescue request accepted. -
202 Server reboot request accepted. -
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 unrescueServerAsync( + public okhttp3.Call rebootServerAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable String action, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - unrescueServerValidateBeforeCall(projectId, serverId, _callback); + rebootServerValidateBeforeCall(projectId, region, serverId, action, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for updateAttachedVolume + * Build call for removeNetworkFromServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param updateAttachedVolumePayload Request a volume attachment update. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -21786,7 +23766,7 @@ public okhttp3.Call unrescueServerAsync( * * * - * + * * * * @@ -21794,11 +23774,11 @@ public okhttp3.Call unrescueServerAsync( * *
Response Details
Status Code Description Response Headers
200 Response to update call. Provide the updated volume attachment object. -
204 Detach and delete network interface was accepted. -
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 updateAttachedVolumeCall( + public okhttp3.Call removeNetworkFromServerCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload, + @javax.annotation.Nonnull UUID networkId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -21814,20 +23794,23 @@ public okhttp3.Call updateAttachedVolumeCall( basePath = null; } - Object localVarPostBody = updateAttachedVolumePayload; + Object localVarPostBody = null; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/networks/{networkId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "serverId" + "}", localVarApiClient.escapeString(serverId.toString())) .replace( - "{" + "volumeId" + "}", - localVarApiClient.escapeString(volumeId.toString())); + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -21841,7 +23824,7 @@ public okhttp3.Call updateAttachedVolumeCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -21852,7 +23835,7 @@ public okhttp3.Call updateAttachedVolumeCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PATCH", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -21864,56 +23847,55 @@ public okhttp3.Call updateAttachedVolumeCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call updateAttachedVolumeValidateBeforeCall( + private okhttp3.Call removeNetworkFromServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload, + @javax.annotation.Nonnull UUID networkId, 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 updateAttachedVolume(Async)"); + "Missing the required parameter 'projectId' when calling removeNetworkFromServer(Async)"); } - // verify the required parameter 'serverId' is set - if (serverId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'serverId' when calling updateAttachedVolume(Async)"); + "Missing the required parameter 'region' when calling removeNetworkFromServer(Async)"); } - // verify the required parameter 'volumeId' is set - if (volumeId == null) { + // verify the required parameter 'serverId' is set + if (serverId == null) { throw new ApiException( - "Missing the required parameter 'volumeId' when calling updateAttachedVolume(Async)"); + "Missing the required parameter 'serverId' when calling removeNetworkFromServer(Async)"); } - // verify the required parameter 'updateAttachedVolumePayload' is set - if (updateAttachedVolumePayload == null) { + // verify the required parameter 'networkId' is set + if (networkId == null) { throw new ApiException( - "Missing the required parameter 'updateAttachedVolumePayload' when calling updateAttachedVolume(Async)"); + "Missing the required parameter 'networkId' when calling removeNetworkFromServer(Async)"); } - return updateAttachedVolumeCall( - projectId, serverId, volumeId, updateAttachedVolumePayload, _callback); + return removeNetworkFromServerCall(projectId, region, serverId, networkId, _callback); } /** - * Update Volume Attachment Parameters. Update the properties of an existing Volume Attachment. + * Detach and delete all network interfaces associated with the specified network. Detach and + * delete all network interfaces associated with the specified network from the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param updateAttachedVolumePayload Request a volume attachment update. (required) - * @return VolumeAttachment + * @param networkId The identifier (ID) of a STACKIT Network. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -21921,33 +23903,31 @@ private okhttp3.Call updateAttachedVolumeValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Response to update call. Provide the updated volume attachment object. -
204 Detach and delete network interface was accepted. -
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 VolumeAttachment updateAttachedVolume( + public void removeNetworkFromServer( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload) + @javax.annotation.Nonnull UUID networkId) throws ApiException { - ApiResponse localVarResp = - updateAttachedVolumeWithHttpInfo( - projectId, serverId, volumeId, updateAttachedVolumePayload); - return localVarResp.getData(); + removeNetworkFromServerWithHttpInfo(projectId, region, serverId, networkId); } /** - * Update Volume Attachment Parameters. Update the properties of an existing Volume Attachment. + * Detach and delete all network interfaces associated with the specified network. Detach and + * delete all network interfaces associated with the specified network from the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param updateAttachedVolumePayload Request a volume attachment update. (required) - * @return ApiResponse<VolumeAttachment> + * @param networkId The identifier (ID) of a STACKIT Network. (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 * * * - * + * * * * @@ -21955,27 +23935,27 @@ public VolumeAttachment updateAttachedVolume( * *
Response Details
Status Code Description Response Headers
200 Response to update call. Provide the updated volume attachment object. -
204 Detach and delete network interface was accepted. -
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 updateAttachedVolumeWithHttpInfo( + public ApiResponse removeNetworkFromServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload) + @javax.annotation.Nonnull UUID networkId) throws ApiException { okhttp3.Call localVarCall = - updateAttachedVolumeValidateBeforeCall( - projectId, serverId, volumeId, updateAttachedVolumePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + removeNetworkFromServerValidateBeforeCall( + projectId, region, serverId, networkId, null); + return localVarApiClient.execute(localVarCall); } /** - * Update Volume Attachment Parameters. (asynchronously) Update the properties of an existing - * Volume Attachment. + * Detach and delete all network interfaces associated with the specified network. + * (asynchronously) Detach and delete all network interfaces associated with the specified + * network from the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) - * @param volumeId The identifier (ID) of a STACKIT Volume. (required) - * @param updateAttachedVolumePayload Request a volume attachment update. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (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 @@ -21984,7 +23964,7 @@ public ApiResponse updateAttachedVolumeWithHttpInfo( * * * - * + * * * * @@ -21992,28 +23972,28 @@ public ApiResponse updateAttachedVolumeWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Response to update call. Provide the updated volume attachment object. -
204 Detach and delete network interface was accepted. -
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 updateAttachedVolumeAsync( + public okhttp3.Call removeNetworkFromServerAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, - @javax.annotation.Nonnull UUID volumeId, - @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload, - final ApiCallback _callback) + @javax.annotation.Nonnull UUID networkId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updateAttachedVolumeValidateBeforeCall( - projectId, serverId, volumeId, updateAttachedVolumePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + removeNetworkFromServerValidateBeforeCall( + projectId, region, serverId, networkId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for updateBackup + * Build call for removeNicFromServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) - * @param updateBackupPayload Request an update of a backup. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param nicId The identifier (ID) of a network interface. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -22021,7 +24001,7 @@ public okhttp3.Call updateAttachedVolumeAsync( * * * - * + * * * * @@ -22029,10 +24009,11 @@ public okhttp3.Call updateAttachedVolumeAsync( * *
Response Details
Status Code Description Response Headers
200 Backup has been updated. -
204 Network interface detachment request was accepted. -
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 updateBackupCall( + public okhttp3.Call removeNicFromServerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID nicId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -22048,17 +24029,23 @@ public okhttp3.Call updateBackupCall( basePath = null; } - Object localVarPostBody = updateBackupPayload; + Object localVarPostBody = null; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/backups/{backupId}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics/{nicId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "backupId" + "}", - localVarApiClient.escapeString(backupId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "nicId" + "}", + localVarApiClient.escapeString(nicId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -22072,7 +24059,7 @@ public okhttp3.Call updateBackupCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -22083,7 +24070,7 @@ public okhttp3.Call updateBackupCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PATCH", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -22095,47 +24082,54 @@ public okhttp3.Call updateBackupCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call updateBackupValidateBeforeCall( + private okhttp3.Call removeNicFromServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID nicId, 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 updateBackup(Async)"); + "Missing the required parameter 'projectId' when calling removeNicFromServer(Async)"); } - // verify the required parameter 'backupId' is set - if (backupId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'backupId' when calling updateBackup(Async)"); + "Missing the required parameter 'region' when calling removeNicFromServer(Async)"); } - // verify the required parameter 'updateBackupPayload' is set - if (updateBackupPayload == null) { + // verify the required parameter 'serverId' is set + if (serverId == null) { throw new ApiException( - "Missing the required parameter 'updateBackupPayload' when calling updateBackup(Async)"); + "Missing the required parameter 'serverId' when calling removeNicFromServer(Async)"); + } + + // verify the required parameter 'nicId' is set + if (nicId == null) { + throw new ApiException( + "Missing the required parameter 'nicId' when calling removeNicFromServer(Async)"); } - return updateBackupCall(projectId, backupId, updateBackupPayload, _callback); + return removeNicFromServerCall(projectId, region, serverId, nicId, _callback); } /** - * Update information of a backup. Update name or labels of the backup. + * Detach a network interface. Detach a network interface from a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) - * @param updateBackupPayload Request an update of a backup. (required) - * @return Backup + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param nicId The identifier (ID) of a network interface. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -22143,30 +24137,30 @@ private okhttp3.Call updateBackupValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Backup has been updated. -
204 Network interface detachment request was accepted. -
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 Backup updateBackup( + public void removeNicFromServer( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID nicId) throws ApiException { - ApiResponse localVarResp = - updateBackupWithHttpInfo(projectId, backupId, updateBackupPayload); - return localVarResp.getData(); + removeNicFromServerWithHttpInfo(projectId, region, serverId, nicId); } /** - * Update information of a backup. Update name or labels of the backup. + * Detach a network interface. Detach a network interface from a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) - * @param updateBackupPayload Request an update of a backup. (required) - * @return ApiResponse<Backup> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param nicId The identifier (ID) of a network interface. (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 * * * - * + * * * * @@ -22174,23 +24168,24 @@ public Backup updateBackup( * *
Response Details
Status Code Description Response Headers
200 Backup has been updated. -
204 Network interface detachment request was accepted. -
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 updateBackupWithHttpInfo( + public ApiResponse removeNicFromServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID nicId) throws ApiException { okhttp3.Call localVarCall = - updateBackupValidateBeforeCall(projectId, backupId, updateBackupPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + removeNicFromServerValidateBeforeCall(projectId, region, serverId, nicId, null); + return localVarApiClient.execute(localVarCall); } /** - * Update information of a backup. (asynchronously) Update name or labels of the backup. + * Detach a network interface. (asynchronously) Detach a network interface from a server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param backupId The identifier (ID) of a STACKIT Backup. (required) - * @param updateBackupPayload Request an update of a backup. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param nicId The identifier (ID) of a network interface. (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 @@ -22199,7 +24194,7 @@ public ApiResponse updateBackupWithHttpInfo( * * * - * + * * * * @@ -22207,26 +24202,28 @@ public ApiResponse updateBackupWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Backup has been updated. -
204 Network interface detachment request was accepted. -
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 updateBackupAsync( + public okhttp3.Call removeNicFromServerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID backupId, - @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID nicId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updateBackupValidateBeforeCall(projectId, backupId, updateBackupPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + removeNicFromServerValidateBeforeCall( + projectId, region, serverId, nicId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for updateImage + * Build call for removePublicIpFromServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param updateImagePayload Request an update of an Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param publicIpId The identifier (ID) of a Public IP. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -22234,18 +24231,20 @@ public okhttp3.Call updateBackupAsync( * * * - * + * * * * - * + * + * * *
Response Details
Status Code Description Response Headers
200 Response to update call. Provide the updated image object. -
204 Detach Public IP from server was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
404 The server or public IP 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 updateImageCall( + public okhttp3.Call removePublicIpFromServerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UpdateImagePayload updateImagePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -22261,17 +24260,23 @@ public okhttp3.Call updateImageCall( basePath = null; } - Object localVarPostBody = updateImagePayload; + Object localVarPostBody = null; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images/{imageId}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/public-ips/{publicIpId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "imageId" + "}", - localVarApiClient.escapeString(imageId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "publicIpId" + "}", + localVarApiClient.escapeString(publicIpId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -22285,7 +24290,7 @@ public okhttp3.Call updateImageCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -22296,7 +24301,7 @@ public okhttp3.Call updateImageCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PATCH", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -22308,103 +24313,114 @@ public okhttp3.Call updateImageCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call updateImageValidateBeforeCall( + private okhttp3.Call removePublicIpFromServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UpdateImagePayload updateImagePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId, 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 updateImage(Async)"); + "Missing the required parameter 'projectId' when calling removePublicIpFromServer(Async)"); } - // verify the required parameter 'imageId' is set - if (imageId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'imageId' when calling updateImage(Async)"); + "Missing the required parameter 'region' when calling removePublicIpFromServer(Async)"); } - // verify the required parameter 'updateImagePayload' is set - if (updateImagePayload == null) { + // verify the required parameter 'serverId' is set + if (serverId == null) { throw new ApiException( - "Missing the required parameter 'updateImagePayload' when calling updateImage(Async)"); + "Missing the required parameter 'serverId' when calling removePublicIpFromServer(Async)"); + } + + // verify the required parameter 'publicIpId' is set + if (publicIpId == null) { + throw new ApiException( + "Missing the required parameter 'publicIpId' when calling removePublicIpFromServer(Async)"); } - return updateImageCall(projectId, imageId, updateImagePayload, _callback); + return removePublicIpFromServerCall(projectId, region, serverId, publicIpId, _callback); } /** - * Update Image Parameters. Update the properties of an existing Image inside a project. + * Dissociate a public IP from a server. Dissociate a public IP on an existing server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param updateImagePayload Request an update of an Image. (required) - * @return Image + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param publicIpId The identifier (ID) of a Public IP. (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
200 Response to update call. Provide the updated image object. -
204 Detach Public IP from server was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
404 The server or public IP was not found. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
*/ - public Image updateImage( + public void removePublicIpFromServer( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UpdateImagePayload updateImagePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId) throws ApiException { - ApiResponse localVarResp = - updateImageWithHttpInfo(projectId, imageId, updateImagePayload); - return localVarResp.getData(); + removePublicIpFromServerWithHttpInfo(projectId, region, serverId, publicIpId); } /** - * Update Image Parameters. Update the properties of an existing Image inside a project. + * Dissociate a public IP from a server. Dissociate a public IP on an existing server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param updateImagePayload Request an update of an Image. (required) - * @return ApiResponse<Image> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param publicIpId The identifier (ID) of a Public IP. (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
200 Response to update call. Provide the updated image object. -
204 Detach Public IP from server was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
404 The server or public IP 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 updateImageWithHttpInfo( + public ApiResponse removePublicIpFromServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UpdateImagePayload updateImagePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId) throws ApiException { okhttp3.Call localVarCall = - updateImageValidateBeforeCall(projectId, imageId, updateImagePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + removePublicIpFromServerValidateBeforeCall( + projectId, region, serverId, publicIpId, null); + return localVarApiClient.execute(localVarCall); } /** - * Update Image Parameters. (asynchronously) Update the properties of an existing Image inside a - * project. + * Dissociate a public IP from a server. (asynchronously) Dissociate a public IP on an existing + * server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param updateImagePayload Request an update of an Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param publicIpId The identifier (ID) of a Public IP. (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 @@ -22413,33 +24429,37 @@ public ApiResponse updateImageWithHttpInfo( * * * - * + * * * * - * + * + * * *
Response Details
Status Code Description Response Headers
200 Response to update call. Provide the updated image object. -
204 Detach Public IP from server was accepted. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
404 The server or public IP 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 updateImageAsync( + public okhttp3.Call removePublicIpFromServerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UpdateImagePayload updateImagePayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updateImageValidateBeforeCall(projectId, imageId, updateImagePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + removePublicIpFromServerValidateBeforeCall( + projectId, region, serverId, publicIpId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for updateImageScopeLocal + * Build call for removeSecurityGroupFromServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -22447,17 +24467,20 @@ public okhttp3.Call updateImageAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to local. Provide the updated image object. -
204 Security group detachment request was 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 updateImageScopeLocalCall( + public okhttp3.Call removeSecurityGroupFromServerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -22477,13 +24500,19 @@ public okhttp3.Call updateImageScopeLocalCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images/{imageId}/publish" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/security-groups/{securityGroupId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "imageId" + "}", - localVarApiClient.escapeString(imageId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -22520,90 +24549,115 @@ public okhttp3.Call updateImageScopeLocalCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call updateImageScopeLocalValidateBeforeCall( + private okhttp3.Call removeSecurityGroupFromServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId, 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 updateImageScopeLocal(Async)"); + "Missing the required parameter 'projectId' when calling removeSecurityGroupFromServer(Async)"); } - // verify the required parameter 'imageId' is set - if (imageId == null) { + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling removeSecurityGroupFromServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling removeSecurityGroupFromServer(Async)"); + } + + // verify the required parameter 'securityGroupId' is set + if (securityGroupId == null) { throw new ApiException( - "Missing the required parameter 'imageId' when calling updateImageScopeLocal(Async)"); + "Missing the required parameter 'securityGroupId' when calling removeSecurityGroupFromServer(Async)"); } - return updateImageScopeLocalCall(projectId, imageId, _callback); + return removeSecurityGroupFromServerCall( + projectId, region, serverId, securityGroupId, _callback); } /** - * Update Image Scope to Local. Update the scope property of an existing Image inside a project - * to local. + * Remove a server from a security group. Remove a server from a attached security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @return Image + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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
200 Response to update image-scope to local. Provide the updated image object. -
204 Security group detachment request was 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 Image updateImageScopeLocal( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public void removeSecurityGroupFromServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId) throws ApiException { - ApiResponse localVarResp = updateImageScopeLocalWithHttpInfo(projectId, imageId); - return localVarResp.getData(); + removeSecurityGroupFromServerWithHttpInfo(projectId, region, serverId, securityGroupId); } /** - * Update Image Scope to Local. Update the scope property of an existing Image inside a project - * to local. + * Remove a server from a security group. Remove a server from a attached security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @return ApiResponse<Image> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (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
200 Response to update image-scope to local. Provide the updated image object. -
204 Security group detachment request was 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 updateImageScopeLocalWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public ApiResponse removeSecurityGroupFromServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId) throws ApiException { okhttp3.Call localVarCall = - updateImageScopeLocalValidateBeforeCall(projectId, imageId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + removeSecurityGroupFromServerValidateBeforeCall( + projectId, region, serverId, securityGroupId, null); + return localVarApiClient.execute(localVarCall); } /** - * Update Image Scope to Local. (asynchronously) Update the scope property of an existing Image - * inside a project to local. + * Remove a server from a security group. (asynchronously) Remove a server from a attached + * security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -22612,32 +24666,37 @@ public ApiResponse updateImageScopeLocalWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to local. Provide the updated image object. -
204 Security group detachment request was 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 updateImageScopeLocalAsync( + public okhttp3.Call removeSecurityGroupFromServerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updateImageScopeLocalValidateBeforeCall(projectId, imageId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + removeSecurityGroupFromServerValidateBeforeCall( + projectId, region, serverId, securityGroupId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for updateImageScopePublic + * Build call for removeServiceAccountFromServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param serviceAccountMail The e-mail address of a service account. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -22645,17 +24704,20 @@ public okhttp3.Call updateImageScopeLocalAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to public. Provide the updated image object. -
200 Service account detached from the server. -
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 updateImageScopePublicCall( + public okhttp3.Call removeServiceAccountFromServerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -22675,13 +24737,19 @@ public okhttp3.Call updateImageScopePublicCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images/{imageId}/publish" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts/{serviceAccountMail}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "imageId" + "}", - localVarApiClient.escapeString(imageId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "serviceAccountMail" + "}", + localVarApiClient.escapeString(serviceAccountMail.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -22706,7 +24774,7 @@ public okhttp3.Call updateImageScopePublicCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PUT", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -22718,90 +24786,120 @@ public okhttp3.Call updateImageScopePublicCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call updateImageScopePublicValidateBeforeCall( + private okhttp3.Call removeServiceAccountFromServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail, 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 updateImageScopePublic(Async)"); + "Missing the required parameter 'projectId' when calling removeServiceAccountFromServer(Async)"); } - // verify the required parameter 'imageId' is set - if (imageId == null) { + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling removeServiceAccountFromServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling removeServiceAccountFromServer(Async)"); + } + + // verify the required parameter 'serviceAccountMail' is set + if (serviceAccountMail == null) { throw new ApiException( - "Missing the required parameter 'imageId' when calling updateImageScopePublic(Async)"); + "Missing the required parameter 'serviceAccountMail' when calling removeServiceAccountFromServer(Async)"); } - return updateImageScopePublicCall(projectId, imageId, _callback); + return removeServiceAccountFromServerCall( + projectId, region, serverId, serviceAccountMail, _callback); } /** - * Update Image Scope to Public. Update the scope property of an existing Image inside a project - * to public. + * Detach a service account from a server. Detach an additional service account from the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @return Image + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param serviceAccountMail The e-mail address of a service account. (required) + * @return ServiceAccountMailListResponse * @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 Response to update image-scope to public. Provide the updated image object. -
200 Service account detached from the server. -
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 Image updateImageScopePublic( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public ServiceAccountMailListResponse removeServiceAccountFromServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail) throws ApiException { - ApiResponse localVarResp = updateImageScopePublicWithHttpInfo(projectId, imageId); + ApiResponse localVarResp = + removeServiceAccountFromServerWithHttpInfo( + projectId, region, serverId, serviceAccountMail); return localVarResp.getData(); } /** - * Update Image Scope to Public. Update the scope property of an existing Image inside a project - * to public. + * Detach a service account from a server. Detach an additional service account from the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @return ApiResponse<Image> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param serviceAccountMail The e-mail address of a service account. (required) + * @return ApiResponse<ServiceAccountMailListResponse> * @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 Response to update image-scope to public. Provide the updated image object. -
200 Service account detached from the server. -
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 updateImageScopePublicWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + public ApiResponse removeServiceAccountFromServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail) throws ApiException { okhttp3.Call localVarCall = - updateImageScopePublicValidateBeforeCall(projectId, imageId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + removeServiceAccountFromServerValidateBeforeCall( + projectId, region, serverId, serviceAccountMail, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Image Scope to Public. (asynchronously) Update the scope property of an existing Image - * inside a project to public. + * Detach a service account from a server. (asynchronously) Detach an additional service account + * from the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param serviceAccountMail The e-mail address of a service account. (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 @@ -22810,33 +24908,38 @@ public ApiResponse updateImageScopePublicWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to public. Provide the updated image object. -
200 Service account detached from the server. -
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 updateImageScopePublicAsync( + public okhttp3.Call removeServiceAccountFromServerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updateImageScopePublicValidateBeforeCall(projectId, imageId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + removeServiceAccountFromServerValidateBeforeCall( + projectId, region, serverId, serviceAccountMail, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateImageShare + * Build call for removeVolumeFromServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param updateImageSharePayload Update an Image Share. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -22844,18 +24947,20 @@ public okhttp3.Call updateImageScopePublicAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Updating Image share successful. -
204 Volume detachment request was 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 updateImageShareCall( + public okhttp3.Call removeVolumeFromServerCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -22871,17 +24976,23 @@ public okhttp3.Call updateImageShareCall( basePath = null; } - Object localVarPostBody = updateImageSharePayload; + Object localVarPostBody = null; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/images/{imageId}/share" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "imageId" + "}", - localVarApiClient.escapeString(imageId.toString())); + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "volumeId" + "}", + localVarApiClient.escapeString(volumeId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -22895,7 +25006,7 @@ public okhttp3.Call updateImageShareCall( localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {"application/json"}; + final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -22906,7 +25017,7 @@ public okhttp3.Call updateImageShareCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PATCH", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -22918,104 +25029,114 @@ public okhttp3.Call updateImageShareCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call updateImageShareValidateBeforeCall( + private okhttp3.Call removeVolumeFromServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, 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 updateImageShare(Async)"); + "Missing the required parameter 'projectId' when calling removeVolumeFromServer(Async)"); } - // verify the required parameter 'imageId' is set - if (imageId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'imageId' when calling updateImageShare(Async)"); + "Missing the required parameter 'region' when calling removeVolumeFromServer(Async)"); } - // verify the required parameter 'updateImageSharePayload' is set - if (updateImageSharePayload == null) { + // verify the required parameter 'serverId' is set + if (serverId == null) { throw new ApiException( - "Missing the required parameter 'updateImageSharePayload' when calling updateImageShare(Async)"); + "Missing the required parameter 'serverId' when calling removeVolumeFromServer(Async)"); + } + + // verify the required parameter 'volumeId' is set + if (volumeId == null) { + throw new ApiException( + "Missing the required parameter 'volumeId' when calling removeVolumeFromServer(Async)"); } - return updateImageShareCall(projectId, imageId, updateImageSharePayload, _callback); + return removeVolumeFromServerCall(projectId, region, serverId, volumeId, _callback); } /** - * Update image share. Update share of an Image. Projects will be appended to existing list. + * Detach a volume from a server. Detach an existing volume from an existing server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param updateImageSharePayload Update an Image Share. (required) - * @return ImageShare + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (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
200 Updating Image share successful. -
204 Volume detachment request was 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 ImageShare updateImageShare( + public void removeVolumeFromServer( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId) throws ApiException { - ApiResponse localVarResp = - updateImageShareWithHttpInfo(projectId, imageId, updateImageSharePayload); - return localVarResp.getData(); + removeVolumeFromServerWithHttpInfo(projectId, region, serverId, volumeId); } /** - * Update image share. Update share of an Image. Projects will be appended to existing list. + * Detach a volume from a server. Detach an existing volume from an existing server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param updateImageSharePayload Update an Image Share. (required) - * @return ApiResponse<ImageShare> + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (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
200 Updating Image share successful. -
204 Volume detachment request was 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 updateImageShareWithHttpInfo( + public ApiResponse removeVolumeFromServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId) throws ApiException { okhttp3.Call localVarCall = - updateImageShareValidateBeforeCall( - projectId, imageId, updateImageSharePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + removeVolumeFromServerValidateBeforeCall( + projectId, region, serverId, volumeId, null); + return localVarApiClient.execute(localVarCall); } /** - * Update image share. (asynchronously) Update share of an Image. Projects will be appended to - * existing list. + * Detach a volume from a server. (asynchronously) Detach an existing volume from an existing + * server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param imageId The identifier (ID) of a STACKIT Image. (required) - * @param updateImageSharePayload Update an Image Share. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (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 @@ -23024,34 +25145,37 @@ public ApiResponse updateImageShareWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Updating Image share successful. -
204 Volume detachment request was 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 updateImageShareAsync( + public okhttp3.Call removeVolumeFromServerAsync( @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID imageId, - @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload, - final ApiCallback _callback) + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updateImageShareValidateBeforeCall( - projectId, imageId, updateImageSharePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + removeVolumeFromServerValidateBeforeCall( + projectId, region, serverId, volumeId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for updateKeyPair + * Build call for rescueServer * - * @param keypairName The name of an SSH keypair. (required) - * @param updateKeyPairPayload Request an update of an SSH keypair. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param rescueServerPayload Request a server rescue. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -23059,17 +25183,20 @@ public okhttp3.Call updateImageShareAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 SSH keypair has been updated. -
202 Server rescue 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 updateKeyPairCall( - @javax.annotation.Nonnull String keypairName, - @javax.annotation.Nonnull UpdateKeyPairPayload updateKeyPairPayload, + public okhttp3.Call rescueServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull RescueServerPayload rescueServerPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -23085,14 +25212,20 @@ public okhttp3.Call updateKeyPairCall( basePath = null; } - Object localVarPostBody = updateKeyPairPayload; + Object localVarPostBody = rescueServerPayload; // create path and map variables String localVarPath = - "/v1/keypairs/{keypairName}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/rescue" .replace( - "{" + "keypairName" + "}", - localVarApiClient.escapeString(keypairName.toString())); + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -23117,7 +25250,7 @@ public okhttp3.Call updateKeyPairCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PATCH", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -23129,90 +25262,119 @@ public okhttp3.Call updateKeyPairCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call updateKeyPairValidateBeforeCall( - @javax.annotation.Nonnull String keypairName, - @javax.annotation.Nonnull UpdateKeyPairPayload updateKeyPairPayload, + private okhttp3.Call rescueServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull RescueServerPayload rescueServerPayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'keypairName' is set - if (keypairName == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'keypairName' when calling updateKeyPair(Async)"); + "Missing the required parameter 'projectId' when calling rescueServer(Async)"); } - // verify the required parameter 'updateKeyPairPayload' is set - if (updateKeyPairPayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'updateKeyPairPayload' when calling updateKeyPair(Async)"); + "Missing the required parameter 'region' when calling rescueServer(Async)"); } - return updateKeyPairCall(keypairName, updateKeyPairPayload, _callback); + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling rescueServer(Async)"); + } + + // verify the required parameter 'rescueServerPayload' is set + if (rescueServerPayload == null) { + throw new ApiException( + "Missing the required parameter 'rescueServerPayload' when calling rescueServer(Async)"); + } + + return rescueServerCall(projectId, region, serverId, rescueServerPayload, _callback); } /** - * Update information of an SSH keypair. Update labels of the SSH keypair. + * Rescue an existing server. Rescue an existing server. It is shutdown and the initial image is + * attached as the boot volume, while the boot volume is attached as secondary volume and the + * server is booted. * - * @param keypairName The name of an SSH keypair. (required) - * @param updateKeyPairPayload Request an update of an SSH keypair. (required) - * @return Keypair + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param rescueServerPayload Request a server rescue. (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
200 SSH keypair has been updated. -
202 Server rescue 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 Keypair updateKeyPair( - @javax.annotation.Nonnull String keypairName, - @javax.annotation.Nonnull UpdateKeyPairPayload updateKeyPairPayload) + public void rescueServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull RescueServerPayload rescueServerPayload) throws ApiException { - ApiResponse localVarResp = - updateKeyPairWithHttpInfo(keypairName, updateKeyPairPayload); - return localVarResp.getData(); + rescueServerWithHttpInfo(projectId, region, serverId, rescueServerPayload); } /** - * Update information of an SSH keypair. Update labels of the SSH keypair. + * Rescue an existing server. Rescue an existing server. It is shutdown and the initial image is + * attached as the boot volume, while the boot volume is attached as secondary volume and the + * server is booted. * - * @param keypairName The name of an SSH keypair. (required) - * @param updateKeyPairPayload Request an update of an SSH keypair. (required) - * @return ApiResponse<Keypair> + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param rescueServerPayload Request a server rescue. (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
200 SSH keypair has been updated. -
202 Server rescue 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 updateKeyPairWithHttpInfo( - @javax.annotation.Nonnull String keypairName, - @javax.annotation.Nonnull UpdateKeyPairPayload updateKeyPairPayload) + public ApiResponse rescueServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull RescueServerPayload rescueServerPayload) throws ApiException { okhttp3.Call localVarCall = - updateKeyPairValidateBeforeCall(keypairName, updateKeyPairPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + rescueServerValidateBeforeCall( + projectId, region, serverId, rescueServerPayload, null); + return localVarApiClient.execute(localVarCall); } /** - * Update information of an SSH keypair. (asynchronously) Update labels of the SSH keypair. + * Rescue an existing server. (asynchronously) Rescue an existing server. It is shutdown and the + * initial image is attached as the boot volume, while the boot volume is attached as secondary + * volume and the server is booted. * - * @param keypairName The name of an SSH keypair. (required) - * @param updateKeyPairPayload Request an update of an SSH keypair. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param rescueServerPayload Request a server rescue. (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 @@ -23221,34 +25383,37 @@ public ApiResponse updateKeyPairWithHttpInfo( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 SSH keypair has been updated. -
202 Server rescue 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 updateKeyPairAsync( - @javax.annotation.Nonnull String keypairName, - @javax.annotation.Nonnull UpdateKeyPairPayload updateKeyPairPayload, - final ApiCallback _callback) + public okhttp3.Call rescueServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull RescueServerPayload rescueServerPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updateKeyPairValidateBeforeCall(keypairName, updateKeyPairPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + rescueServerValidateBeforeCall( + projectId, region, serverId, rescueServerPayload, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for updateNetworkAreaRoute + * Build call for resizeServer * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param updateNetworkAreaRoutePayload Request an update of a network route. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param resizeServerPayload Request a resize of a server. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -23256,19 +25421,20 @@ public okhttp3.Call updateKeyPairAsync( * * * - * + * * * * * + * * *
Response Details
Status Code Description Response Headers
200 Update request for network successful. -
202 Server resize request is 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 updateNetworkAreaRouteCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload, + public okhttp3.Call resizeServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -23284,20 +25450,20 @@ public okhttp3.Call updateNetworkAreaRouteCall( basePath = null; } - Object localVarPostBody = updateNetworkAreaRoutePayload; + Object localVarPostBody = resizeServerPayload; // create path and map variables String localVarPath = - "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/resize" .replace( - "{" + "organizationId" + "}", - localVarApiClient.escapeString(organizationId.toString())) + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) .replace( - "{" + "areaId" + "}", - localVarApiClient.escapeString(areaId.toString())) + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( - "{" + "routeId" + "}", - localVarApiClient.escapeString(routeId.toString())); + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -23322,7 +25488,7 @@ public okhttp3.Call updateNetworkAreaRouteCall( return localVarApiClient.buildCall( basePath, localVarPath, - "PATCH", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -23334,80 +25500,3058 @@ public okhttp3.Call updateNetworkAreaRouteCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call updateNetworkAreaRouteValidateBeforeCall( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload, + private okhttp3.Call resizeServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'organizationId' is set - if (organizationId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - "Missing the required parameter 'organizationId' when calling updateNetworkAreaRoute(Async)"); + "Missing the required parameter 'projectId' when calling resizeServer(Async)"); } - // verify the required parameter 'areaId' is set - if (areaId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'areaId' when calling updateNetworkAreaRoute(Async)"); + "Missing the required parameter 'region' when calling resizeServer(Async)"); } - // verify the required parameter 'routeId' is set - if (routeId == null) { + // verify the required parameter 'serverId' is set + if (serverId == null) { throw new ApiException( - "Missing the required parameter 'routeId' when calling updateNetworkAreaRoute(Async)"); + "Missing the required parameter 'serverId' when calling resizeServer(Async)"); } - // verify the required parameter 'updateNetworkAreaRoutePayload' is set - if (updateNetworkAreaRoutePayload == null) { + // verify the required parameter 'resizeServerPayload' is set + if (resizeServerPayload == null) { throw new ApiException( - "Missing the required parameter 'updateNetworkAreaRoutePayload' when calling updateNetworkAreaRoute(Async)"); + "Missing the required parameter 'resizeServerPayload' when calling resizeServer(Async)"); } - return updateNetworkAreaRouteCall( - organizationId, areaId, routeId, updateNetworkAreaRoutePayload, _callback); + return resizeServerCall(projectId, region, serverId, resizeServerPayload, _callback); } /** - * Update a network route. Update a network route defined in a network area. + * Resize a server. Resize the server to the given machine type. * - * @param organizationId The identifier (ID) of a STACKIT Organization. (required) - * @param areaId The identifier (ID) of a STACKIT Network Area. (required) - * @param routeId The identifier (ID) of a STACKIT Route. (required) - * @param updateNetworkAreaRoutePayload Request an update of a network route. (required) - * @return Route + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param resizeServerPayload Request a resize of a server. (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
200 Update request for network successful. -
202 Server resize request is 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 Route updateNetworkAreaRoute( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload) + public void resizeServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload) throws ApiException { - ApiResponse localVarResp = - updateNetworkAreaRouteWithHttpInfo( - organizationId, areaId, routeId, updateNetworkAreaRoutePayload); - return localVarResp.getData(); + resizeServerWithHttpInfo(projectId, region, serverId, resizeServerPayload); } /** - * Update a network route. Update a network route defined in a network area. + * Resize a server. Resize the server to the given machine type. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param resizeServerPayload Request a resize of a server. (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
202 Server resize request is 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 resizeServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload) + throws ApiException { + okhttp3.Call localVarCall = + resizeServerValidateBeforeCall( + projectId, region, serverId, resizeServerPayload, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Resize a server. (asynchronously) Resize the server to the given machine type. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param resizeServerPayload Request a resize of a server. (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
202 Server resize request is 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 resizeServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + resizeServerValidateBeforeCall( + projectId, region, serverId, resizeServerPayload, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for resizeVolume + * + * @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 resizeVolumePayload Request a volume resize. (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 resize 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 resizeVolumeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload, + 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 = resizeVolumePayload; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}/resize" + .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 resizeVolumeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload, + 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 resizeVolume(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling resizeVolume(Async)"); + } + + // verify the required parameter 'volumeId' is set + if (volumeId == null) { + throw new ApiException( + "Missing the required parameter 'volumeId' when calling resizeVolume(Async)"); + } + + return resizeVolumeCall(projectId, region, volumeId, resizeVolumePayload, _callback); + } + + /** + * Update the size of a volume. Update the size of a block device volume. The new volume size + * must be larger than the current size. + * + * @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 resizeVolumePayload Request a volume resize. (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 resize 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 resizeVolume( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload) + throws ApiException { + resizeVolumeWithHttpInfo(projectId, region, volumeId, resizeVolumePayload); + } + + /** + * Update the size of a volume. Update the size of a block device volume. The new volume size + * must be larger than the current size. + * + * @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 resizeVolumePayload Request a volume resize. (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 resize 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 resizeVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload) + throws ApiException { + okhttp3.Call localVarCall = + resizeVolumeValidateBeforeCall( + projectId, region, volumeId, resizeVolumePayload, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update the size of a volume. (asynchronously) Update the size of a block device volume. The + * new volume size must be larger than the current size. + * + * @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 resizeVolumePayload Request a volume resize. (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 resize 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 resizeVolumeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + resizeVolumeValidateBeforeCall( + projectId, region, volumeId, resizeVolumePayload, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for restoreBackup + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (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
202 Backup restore request 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call restoreBackupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}/restore" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "backupId" + "}", + localVarApiClient.escapeString(backupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call restoreBackupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + 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 restoreBackup(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling restoreBackup(Async)"); + } + + // verify the required parameter 'backupId' is set + if (backupId == null) { + throw new ApiException( + "Missing the required parameter 'backupId' when calling restoreBackup(Async)"); + } + + return restoreBackupCall(projectId, region, backupId, _callback); + } + + /** + * Restore Backup to the referenced source Volume. Restores a Backup to the existing Volume it + * references to. The use of this endpoint is disruptive as the volume needs to be detached. If + * a new volume is to be created use the volumes endpoint with the option to create from backup. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (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
202 Backup restore request 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public void restoreBackup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId) + throws ApiException { + restoreBackupWithHttpInfo(projectId, region, backupId); + } + + /** + * Restore Backup to the referenced source Volume. Restores a Backup to the existing Volume it + * references to. The use of this endpoint is disruptive as the volume needs to be detached. If + * a new volume is to be created use the volumes endpoint with the option to create from backup. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (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
202 Backup restore request 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse restoreBackupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId) + throws ApiException { + okhttp3.Call localVarCall = + restoreBackupValidateBeforeCall(projectId, region, backupId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Restore Backup to the referenced source Volume. (asynchronously) Restores a Backup to the + * existing Volume it references to. The use of this endpoint is disruptive as the volume needs + * to be detached. If a new volume is to be created use the volumes endpoint with the option to + * create from backup. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (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
202 Backup restore request 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call restoreBackupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + restoreBackupValidateBeforeCall(projectId, region, backupId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for setImageShare + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param setImageSharePayload Settings for an Image Share. (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 Setting Image share 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 setImageShareCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload, + 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 = setImageSharePayload; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "imageId" + "}", + localVarApiClient.escapeString(imageId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setImageShareValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload, + 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 setImageShare(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling setImageShare(Async)"); + } + + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException( + "Missing the required parameter 'imageId' when calling setImageShare(Async)"); + } + + // verify the required parameter 'setImageSharePayload' is set + if (setImageSharePayload == null) { + throw new ApiException( + "Missing the required parameter 'setImageSharePayload' when calling setImageShare(Async)"); + } + + return setImageShareCall(projectId, region, imageId, setImageSharePayload, _callback); + } + + /** + * Set image share. Set share of an Image. New Options will replace existing settings. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param setImageSharePayload Settings for an Image Share. (required) + * @return ImageShare + * @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 Setting Image share 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 ImageShare setImageShare( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload) + throws ApiException { + ApiResponse localVarResp = + setImageShareWithHttpInfo(projectId, region, imageId, setImageSharePayload); + return localVarResp.getData(); + } + + /** + * Set image share. Set share of an Image. New Options will replace existing settings. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param setImageSharePayload Settings for an Image Share. (required) + * @return ApiResponse<ImageShare> + * @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 Setting Image share 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 setImageShareWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload) + throws ApiException { + okhttp3.Call localVarCall = + setImageShareValidateBeforeCall( + projectId, region, imageId, setImageSharePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Set image share. (asynchronously) Set share of an Image. New Options will replace existing + * settings. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param setImageSharePayload Settings for an Image Share. (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 Setting Image share 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 setImageShareAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + setImageShareValidateBeforeCall( + projectId, region, imageId, setImageSharePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for startServer + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server start 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 startServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/start" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call startServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + 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 startServer(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling startServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling startServer(Async)"); + } + + return startServerCall(projectId, region, serverId, _callback); + } + + /** + * Boot up a server. Start an existing server or allocates the server if deallocated. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server start 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 startServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) + throws ApiException { + startServerWithHttpInfo(projectId, region, serverId); + } + + /** + * Boot up a server. Start an existing server or allocates the server if deallocated. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server start 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 startServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) + throws ApiException { + okhttp3.Call localVarCall = + startServerValidateBeforeCall(projectId, region, serverId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Boot up a server. (asynchronously) Start an existing server or allocates the server if + * deallocated. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server start 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 startServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + startServerValidateBeforeCall(projectId, region, serverId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for stopServer + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server stop 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 stopServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/stop" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call stopServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + 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 stopServer(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling stopServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling stopServer(Async)"); + } + + return stopServerCall(projectId, region, serverId, _callback); + } + + /** + * Stop an existing server. Stops an existing server. The server will remain on the Hypervisor + * and will be charged full price for all resources attached to it. The attached resources will + * remain reserved. Useful particularly for vGPU servers. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server stop 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 stopServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) + throws ApiException { + stopServerWithHttpInfo(projectId, region, serverId); + } + + /** + * Stop an existing server. Stops an existing server. The server will remain on the Hypervisor + * and will be charged full price for all resources attached to it. The attached resources will + * remain reserved. Useful particularly for vGPU servers. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server stop 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 stopServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) + throws ApiException { + okhttp3.Call localVarCall = stopServerValidateBeforeCall(projectId, region, serverId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Stop an existing server. (asynchronously) Stops an existing server. The server will remain on + * the Hypervisor and will be charged full price for all resources attached to it. The attached + * resources will remain reserved. Useful particularly for vGPU servers. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server stop 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 stopServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + stopServerValidateBeforeCall(projectId, region, serverId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for unrescueServer + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server unrescue 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 unrescueServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/unrescue" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call unrescueServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + 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 unrescueServer(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling unrescueServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling unrescueServer(Async)"); + } + + return unrescueServerCall(projectId, region, serverId, _callback); + } + + /** + * Unrescue an existing server. Unrescue an existing server. The original boot volume is + * attached as boot volume of the server and the server is booted up. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server unrescue 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 unrescueServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) + throws ApiException { + unrescueServerWithHttpInfo(projectId, region, serverId); + } + + /** + * Unrescue an existing server. Unrescue an existing server. The original boot volume is + * attached as boot volume of the server and the server is booted up. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server unrescue 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 unrescueServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId) + throws ApiException { + okhttp3.Call localVarCall = + unrescueServerValidateBeforeCall(projectId, region, serverId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Unrescue an existing server. (asynchronously) Unrescue an existing server. The original boot + * volume is attached as boot volume of the server and the server is booted up. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
202 Server unrescue 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 unrescueServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + unrescueServerValidateBeforeCall(projectId, region, serverId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for updateAttachedVolume + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param updateAttachedVolumePayload Request a volume attachment update. (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 Response to update call. Provide the updated volume attachment object. -
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 updateAttachedVolumeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload, + 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 = updateAttachedVolumePayload; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.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, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateAttachedVolumeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload, + 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 updateAttachedVolume(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateAttachedVolume(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling updateAttachedVolume(Async)"); + } + + // verify the required parameter 'volumeId' is set + if (volumeId == null) { + throw new ApiException( + "Missing the required parameter 'volumeId' when calling updateAttachedVolume(Async)"); + } + + // verify the required parameter 'updateAttachedVolumePayload' is set + if (updateAttachedVolumePayload == null) { + throw new ApiException( + "Missing the required parameter 'updateAttachedVolumePayload' when calling updateAttachedVolume(Async)"); + } + + return updateAttachedVolumeCall( + projectId, region, serverId, volumeId, updateAttachedVolumePayload, _callback); + } + + /** + * Update Volume Attachment Parameters. Update the properties of an existing Volume Attachment. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param updateAttachedVolumePayload Request a volume attachment update. (required) + * @return VolumeAttachment + * @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 Response to update call. Provide the updated volume attachment object. -
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 VolumeAttachment updateAttachedVolume( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload) + throws ApiException { + ApiResponse localVarResp = + updateAttachedVolumeWithHttpInfo( + projectId, region, serverId, volumeId, updateAttachedVolumePayload); + return localVarResp.getData(); + } + + /** + * Update Volume Attachment Parameters. Update the properties of an existing Volume Attachment. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param updateAttachedVolumePayload Request a volume attachment update. (required) + * @return ApiResponse<VolumeAttachment> + * @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 Response to update call. Provide the updated volume attachment object. -
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 updateAttachedVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload) + throws ApiException { + okhttp3.Call localVarCall = + updateAttachedVolumeValidateBeforeCall( + projectId, region, serverId, volumeId, updateAttachedVolumePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Volume Attachment Parameters. (asynchronously) Update the properties of an existing + * Volume Attachment. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param updateAttachedVolumePayload Request a volume attachment update. (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 Response to update call. Provide the updated volume attachment object. -
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 updateAttachedVolumeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateAttachedVolumeValidateBeforeCall( + projectId, + region, + serverId, + volumeId, + updateAttachedVolumePayload, + _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateBackup + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param updateBackupPayload Request an update of a backup. (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 Backup has been updated. -
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 updateBackupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload, + 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 = updateBackupPayload; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "backupId" + "}", + localVarApiClient.escapeString(backupId.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, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateBackupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload, + 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 updateBackup(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateBackup(Async)"); + } + + // verify the required parameter 'backupId' is set + if (backupId == null) { + throw new ApiException( + "Missing the required parameter 'backupId' when calling updateBackup(Async)"); + } + + // verify the required parameter 'updateBackupPayload' is set + if (updateBackupPayload == null) { + throw new ApiException( + "Missing the required parameter 'updateBackupPayload' when calling updateBackup(Async)"); + } + + return updateBackupCall(projectId, region, backupId, updateBackupPayload, _callback); + } + + /** + * Update information of a backup. Update name or labels of the backup. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param updateBackupPayload Request an update of a backup. (required) + * @return Backup + * @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 Backup has been updated. -
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 Backup updateBackup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload) + throws ApiException { + ApiResponse localVarResp = + updateBackupWithHttpInfo(projectId, region, backupId, updateBackupPayload); + return localVarResp.getData(); + } + + /** + * Update information of a backup. Update name or labels of the backup. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param updateBackupPayload Request an update of a backup. (required) + * @return ApiResponse<Backup> + * @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 Backup has been updated. -
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 updateBackupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload) + throws ApiException { + okhttp3.Call localVarCall = + updateBackupValidateBeforeCall( + projectId, region, backupId, updateBackupPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update information of a backup. (asynchronously) Update name or labels of the backup. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param backupId The identifier (ID) of a STACKIT Backup. (required) + * @param updateBackupPayload Request an update of a backup. (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 Backup has been updated. -
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 updateBackupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateBackupValidateBeforeCall( + projectId, region, backupId, updateBackupPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateImage + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param updateImagePayload Request an update of an Image. (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 Response to update call. Provide the updated image object. -
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 updateImageCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UpdateImagePayload updateImagePayload, + 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 = updateImagePayload; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/images/{imageId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "imageId" + "}", + localVarApiClient.escapeString(imageId.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, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateImageValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UpdateImagePayload updateImagePayload, + 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 updateImage(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateImage(Async)"); + } + + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException( + "Missing the required parameter 'imageId' when calling updateImage(Async)"); + } + + // verify the required parameter 'updateImagePayload' is set + if (updateImagePayload == null) { + throw new ApiException( + "Missing the required parameter 'updateImagePayload' when calling updateImage(Async)"); + } + + return updateImageCall(projectId, region, imageId, updateImagePayload, _callback); + } + + /** + * Update Image Parameters. Update the properties of an existing Image inside a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param updateImagePayload Request an update of an Image. (required) + * @return Image + * @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 Response to update call. Provide the updated image object. -
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 Image updateImage( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UpdateImagePayload updateImagePayload) + throws ApiException { + ApiResponse localVarResp = + updateImageWithHttpInfo(projectId, region, imageId, updateImagePayload); + return localVarResp.getData(); + } + + /** + * Update Image Parameters. Update the properties of an existing Image inside a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param updateImagePayload Request an update of an Image. (required) + * @return ApiResponse<Image> + * @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 Response to update call. Provide the updated image object. -
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 updateImageWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UpdateImagePayload updateImagePayload) + throws ApiException { + okhttp3.Call localVarCall = + updateImageValidateBeforeCall(projectId, region, imageId, updateImagePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Image Parameters. (asynchronously) Update the properties of an existing Image inside a + * project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param updateImagePayload Request an update of an Image. (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 Response to update call. Provide the updated image object. -
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 updateImageAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UpdateImagePayload updateImagePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateImageValidateBeforeCall( + projectId, region, imageId, updateImagePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateImageShare + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param updateImageSharePayload Update an Image Share. (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 Updating Image share 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 updateImageShareCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload, + 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 = updateImageSharePayload; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "imageId" + "}", + localVarApiClient.escapeString(imageId.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, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateImageShareValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload, + 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 updateImageShare(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateImageShare(Async)"); + } + + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException( + "Missing the required parameter 'imageId' when calling updateImageShare(Async)"); + } + + // verify the required parameter 'updateImageSharePayload' is set + if (updateImageSharePayload == null) { + throw new ApiException( + "Missing the required parameter 'updateImageSharePayload' when calling updateImageShare(Async)"); + } + + return updateImageShareCall(projectId, region, imageId, updateImageSharePayload, _callback); + } + + /** + * Update image share. Update share of an Image. Projects will be appended to existing list. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param updateImageSharePayload Update an Image Share. (required) + * @return ImageShare + * @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 Updating Image share 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 ImageShare updateImageShare( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload) + throws ApiException { + ApiResponse localVarResp = + updateImageShareWithHttpInfo(projectId, region, imageId, updateImageSharePayload); + return localVarResp.getData(); + } + + /** + * Update image share. Update share of an Image. Projects will be appended to existing list. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param updateImageSharePayload Update an Image Share. (required) + * @return ApiResponse<ImageShare> + * @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 Updating Image share 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 updateImageShareWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload) + throws ApiException { + okhttp3.Call localVarCall = + updateImageShareValidateBeforeCall( + projectId, region, imageId, updateImageSharePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update image share. (asynchronously) Update share of an Image. Projects will be appended to + * existing list. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param imageId The identifier (ID) of a STACKIT Image. (required) + * @param updateImageSharePayload Update an Image Share. (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 Updating Image share 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 updateImageShareAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateImageShareValidateBeforeCall( + projectId, region, imageId, updateImageSharePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateKeyPair + * + * @param keypairName The name of an SSH keypair. (required) + * @param updateKeyPairPayload Request an update of an SSH keypair. (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 SSH keypair has been updated. -
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 updateKeyPairCall( + @javax.annotation.Nonnull String keypairName, + @javax.annotation.Nonnull UpdateKeyPairPayload updateKeyPairPayload, + 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 = updateKeyPairPayload; + + // create path and map variables + String localVarPath = + "/v2/keypairs/{keypairName}" + .replace( + "{" + "keypairName" + "}", + localVarApiClient.escapeString(keypairName.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, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateKeyPairValidateBeforeCall( + @javax.annotation.Nonnull String keypairName, + @javax.annotation.Nonnull UpdateKeyPairPayload updateKeyPairPayload, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'keypairName' is set + if (keypairName == null) { + throw new ApiException( + "Missing the required parameter 'keypairName' when calling updateKeyPair(Async)"); + } + + // verify the required parameter 'updateKeyPairPayload' is set + if (updateKeyPairPayload == null) { + throw new ApiException( + "Missing the required parameter 'updateKeyPairPayload' when calling updateKeyPair(Async)"); + } + + return updateKeyPairCall(keypairName, updateKeyPairPayload, _callback); + } + + /** + * Update information of an SSH keypair. Update labels of the SSH keypair. + * + * @param keypairName The name of an SSH keypair. (required) + * @param updateKeyPairPayload Request an update of an SSH keypair. (required) + * @return Keypair + * @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 SSH keypair has been updated. -
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 Keypair updateKeyPair( + @javax.annotation.Nonnull String keypairName, + @javax.annotation.Nonnull UpdateKeyPairPayload updateKeyPairPayload) + throws ApiException { + ApiResponse localVarResp = + updateKeyPairWithHttpInfo(keypairName, updateKeyPairPayload); + return localVarResp.getData(); + } + + /** + * Update information of an SSH keypair. Update labels of the SSH keypair. + * + * @param keypairName The name of an SSH keypair. (required) + * @param updateKeyPairPayload Request an update of an SSH keypair. (required) + * @return ApiResponse<Keypair> + * @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 SSH keypair has been updated. -
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 updateKeyPairWithHttpInfo( + @javax.annotation.Nonnull String keypairName, + @javax.annotation.Nonnull UpdateKeyPairPayload updateKeyPairPayload) + throws ApiException { + okhttp3.Call localVarCall = + updateKeyPairValidateBeforeCall(keypairName, updateKeyPairPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update information of an SSH keypair. (asynchronously) Update labels of the SSH keypair. + * + * @param keypairName The name of an SSH keypair. (required) + * @param updateKeyPairPayload Request an update of an SSH keypair. (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 SSH keypair has been updated. -
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 updateKeyPairAsync( + @javax.annotation.Nonnull String keypairName, + @javax.annotation.Nonnull UpdateKeyPairPayload updateKeyPairPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateKeyPairValidateBeforeCall(keypairName, updateKeyPairPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateNetworkAreaRegion + * + * @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 updateNetworkAreaRegionPayload Request an update of a regional network area. + * (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 Regional area has been updated. -
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 updateNetworkAreaRegionCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UpdateNetworkAreaRegionPayload updateNetworkAreaRegionPayload, + 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 = updateNetworkAreaRegionPayload; + + // create path and map variables + String localVarPath = + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateNetworkAreaRegionValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UpdateNetworkAreaRegionPayload updateNetworkAreaRegionPayload, + 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 updateNetworkAreaRegion(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling updateNetworkAreaRegion(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateNetworkAreaRegion(Async)"); + } + + // verify the required parameter 'updateNetworkAreaRegionPayload' is set + if (updateNetworkAreaRegionPayload == null) { + throw new ApiException( + "Missing the required parameter 'updateNetworkAreaRegionPayload' when calling updateNetworkAreaRegion(Async)"); + } + + return updateNetworkAreaRegionCall( + organizationId, areaId, region, updateNetworkAreaRegionPayload, _callback); + } + + /** + * Update a region for a network area. Update a new region for 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 updateNetworkAreaRegionPayload Request an update of a regional network area. + * (required) + * @return RegionalArea + * @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 Regional area has been updated. -
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 RegionalArea updateNetworkAreaRegion( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UpdateNetworkAreaRegionPayload updateNetworkAreaRegionPayload) + throws ApiException { + ApiResponse localVarResp = + updateNetworkAreaRegionWithHttpInfo( + organizationId, areaId, region, updateNetworkAreaRegionPayload); + return localVarResp.getData(); + } + + /** + * Update a region for a network area. Update a new region for 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 updateNetworkAreaRegionPayload Request an update of a regional network area. + * (required) + * @return ApiResponse<RegionalArea> + * @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 Regional area has been updated. -
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 updateNetworkAreaRegionWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UpdateNetworkAreaRegionPayload updateNetworkAreaRegionPayload) + throws ApiException { + okhttp3.Call localVarCall = + updateNetworkAreaRegionValidateBeforeCall( + organizationId, areaId, region, updateNetworkAreaRegionPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update a region for a network area. (asynchronously) Update a new region for 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 updateNetworkAreaRegionPayload Request an update of a regional network area. + * (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 Regional area has been updated. -
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 updateNetworkAreaRegionAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UpdateNetworkAreaRegionPayload updateNetworkAreaRegionPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateNetworkAreaRegionValidateBeforeCall( + organizationId, areaId, region, updateNetworkAreaRegionPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateNetworkAreaRoute + * + * @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 routeId The identifier (ID) of a STACKIT Route. (required) + * @param updateNetworkAreaRoutePayload Request an update of a network 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 Update request for network 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 updateNetworkAreaRouteCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId, + @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload, + 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 = updateNetworkAreaRoutePayload; + + // create path and map variables + String localVarPath = + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.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 = {"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, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateNetworkAreaRouteValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId, + @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload, + 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 updateNetworkAreaRoute(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling updateNetworkAreaRoute(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateNetworkAreaRoute(Async)"); + } + + // verify the required parameter 'routeId' is set + if (routeId == null) { + throw new ApiException( + "Missing the required parameter 'routeId' when calling updateNetworkAreaRoute(Async)"); + } + + // verify the required parameter 'updateNetworkAreaRoutePayload' is set + if (updateNetworkAreaRoutePayload == null) { + throw new ApiException( + "Missing the required parameter 'updateNetworkAreaRoutePayload' when calling updateNetworkAreaRoute(Async)"); + } + + return updateNetworkAreaRouteCall( + organizationId, areaId, region, routeId, updateNetworkAreaRoutePayload, _callback); + } + + /** + * Update a network route. Update a network route defined in 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 routeId The identifier (ID) of a STACKIT Route. (required) + * @param updateNetworkAreaRoutePayload Request an update of a network 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 Update request for network 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 Route updateNetworkAreaRoute( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId, + @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload) + throws ApiException { + ApiResponse localVarResp = + updateNetworkAreaRouteWithHttpInfo( + organizationId, areaId, region, routeId, updateNetworkAreaRoutePayload); + return localVarResp.getData(); + } + + /** + * Update a network route. Update a network route defined in 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 routeId The identifier (ID) of a STACKIT Route. (required) * @param updateNetworkAreaRoutePayload Request an update of a network route. (required) * @return ApiResponse<Route> @@ -23417,7 +28561,478 @@ public Route updateNetworkAreaRoute( * * * - * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Update request for network successful. -
200 Update request for network 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 updateNetworkAreaRouteWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId, + @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload) + throws ApiException { + okhttp3.Call localVarCall = + updateNetworkAreaRouteValidateBeforeCall( + organizationId, + areaId, + region, + routeId, + updateNetworkAreaRoutePayload, + null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update a network route. (asynchronously) Update a network route defined in 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 routeId The identifier (ID) of a STACKIT Route. (required) + * @param updateNetworkAreaRoutePayload Request an update of a network 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 Update request for network 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 updateNetworkAreaRouteAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routeId, + @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateNetworkAreaRouteValidateBeforeCall( + organizationId, + areaId, + region, + routeId, + updateNetworkAreaRoutePayload, + _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateNic + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (required) + * @param updateNicPayload Request an update of a network interface. (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 Network interface has been updated. -
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 updateNicCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull UpdateNicPayload updateNicPayload, + 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 = updateNicPayload; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())) + .replace( + "{" + "nicId" + "}", + localVarApiClient.escapeString(nicId.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, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateNicValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull UpdateNicPayload updateNicPayload, + 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 updateNic(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateNic(Async)"); + } + + // verify the required parameter 'networkId' is set + if (networkId == null) { + throw new ApiException( + "Missing the required parameter 'networkId' when calling updateNic(Async)"); + } + + // verify the required parameter 'nicId' is set + if (nicId == null) { + throw new ApiException( + "Missing the required parameter 'nicId' when calling updateNic(Async)"); + } + + // verify the required parameter 'updateNicPayload' is set + if (updateNicPayload == null) { + throw new ApiException( + "Missing the required parameter 'updateNicPayload' when calling updateNic(Async)"); + } + + return updateNicCall(projectId, region, networkId, nicId, updateNicPayload, _callback); + } + + /** + * Update a network interface. Update the properties of an existing network interface inside a + * network. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (required) + * @param updateNicPayload Request an update of a network interface. (required) + * @return NIC + * @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 Network interface has been updated. -
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 NIC updateNic( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull UpdateNicPayload updateNicPayload) + throws ApiException { + ApiResponse localVarResp = + updateNicWithHttpInfo(projectId, region, networkId, nicId, updateNicPayload); + return localVarResp.getData(); + } + + /** + * Update a network interface. Update the properties of an existing network interface inside a + * network. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (required) + * @param updateNicPayload Request an update of a network interface. (required) + * @return ApiResponse<NIC> + * @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 Network interface has been updated. -
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 updateNicWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull UpdateNicPayload updateNicPayload) + throws ApiException { + okhttp3.Call localVarCall = + updateNicValidateBeforeCall( + projectId, region, networkId, nicId, updateNicPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update a network interface. (asynchronously) Update the properties of an existing network + * interface inside a network. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param networkId The identifier (ID) of a STACKIT Network. (required) + * @param nicId The identifier (ID) of a network interface. (required) + * @param updateNicPayload Request an update of a network interface. (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 Network interface has been updated. -
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 updateNicAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull UpdateNicPayload updateNicPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateNicValidateBeforeCall( + projectId, region, networkId, nicId, updateNicPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updatePublicIP + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (required) + * @param updatePublicIPPayload Request an update of a public IP. (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 Public IP has been updated. -
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 updatePublicIPCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId, + @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload, + 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 = updatePublicIPPayload; + + // create path and map variables + String localVarPath = + "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) + .replace( + "{" + "publicIpId" + "}", + localVarApiClient.escapeString(publicIpId.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, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePublicIPValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId, + @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload, + 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 updatePublicIP(Async)"); + } + + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updatePublicIP(Async)"); + } + + // verify the required parameter 'publicIpId' is set + if (publicIpId == null) { + throw new ApiException( + "Missing the required parameter 'publicIpId' when calling updatePublicIP(Async)"); + } + + // verify the required parameter 'updatePublicIPPayload' is set + if (updatePublicIPPayload == null) { + throw new ApiException( + "Missing the required parameter 'updatePublicIPPayload' when calling updatePublicIP(Async)"); + } + + return updatePublicIPCall(projectId, region, publicIpId, updatePublicIPPayload, _callback); + } + + /** + * Update a public IP. Update the properties of an existing public IP inside a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (required) + * @param updatePublicIPPayload Request an update of a public IP. (required) + * @return PublicIp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * * * * @@ -23425,26 +29040,60 @@ public Route updateNetworkAreaRoute( * *
Response Details
Status Code Description Response Headers
200 Public IP has been updated. -
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 updateNetworkAreaRouteWithHttpInfo( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload) + public PublicIp updatePublicIP( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId, + @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload) + throws ApiException { + ApiResponse localVarResp = + updatePublicIPWithHttpInfo(projectId, region, publicIpId, updatePublicIPPayload); + return localVarResp.getData(); + } + + /** + * Update a public IP. Update the properties of an existing public IP inside a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (required) + * @param updatePublicIPPayload Request an update of a public IP. (required) + * @return ApiResponse<PublicIp> + * @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 Public IP has been updated. -
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 updatePublicIPWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId, + @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload) throws ApiException { okhttp3.Call localVarCall = - updateNetworkAreaRouteValidateBeforeCall( - organizationId, areaId, routeId, updateNetworkAreaRoutePayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + updatePublicIPValidateBeforeCall( + projectId, region, publicIpId, updatePublicIPPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update a network route. (asynchronously) Update a network route defined in a network area. + * Update a public IP. (asynchronously) Update the properties of an existing public IP 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 routeId The identifier (ID) of a STACKIT Route. (required) - * @param updateNetworkAreaRoutePayload Request an update of a network route. (required) + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) + * @param publicIpId The identifier (ID) of a Public IP. (required) + * @param updatePublicIPPayload Request an update of a public IP. (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 @@ -23453,7 +29102,7 @@ public ApiResponse updateNetworkAreaRouteWithHttpInfo( * * * - * + * * * * @@ -23461,29 +29110,32 @@ public ApiResponse updateNetworkAreaRouteWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Update request for network successful. -
200 Public IP has been updated. -
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 updateNetworkAreaRouteAsync( - @javax.annotation.Nonnull UUID organizationId, - @javax.annotation.Nonnull UUID areaId, - @javax.annotation.Nonnull UUID routeId, - @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload, - final ApiCallback _callback) + public okhttp3.Call updatePublicIPAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID publicIpId, + @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updateNetworkAreaRouteValidateBeforeCall( - organizationId, areaId, routeId, updateNetworkAreaRoutePayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + updatePublicIPValidateBeforeCall( + projectId, region, publicIpId, updatePublicIPPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updateNic + * Build call for updateRouteOfRoutingTable * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (required) - * @param updateNicPayload Request an update of a network interface. (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 updateRouteOfRoutingTablePayload Request an update of a route in a routing table. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -23491,20 +29143,22 @@ public okhttp3.Call updateNetworkAreaRouteAsync( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
200 Network interface has been updated. -
200 Update request for route successful. -
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 updateNicCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId, - @javax.annotation.Nonnull UpdateNicPayload updateNicPayload, + public okhttp3.Call updateRouteOfRoutingTableCall( + @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, + @javax.annotation.Nonnull + UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -23520,20 +29174,26 @@ public okhttp3.Call updateNicCall( basePath = null; } - Object localVarPostBody = updateNicPayload; + Object localVarPostBody = updateRouteOfRoutingTablePayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "networkId" + "}", - localVarApiClient.escapeString(networkId.toString())) + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) .replace( - "{" + "nicId" + "}", - localVarApiClient.escapeString(nicId.toString())); + "{" + "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(); @@ -23570,119 +29230,165 @@ public okhttp3.Call updateNicCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call updateNicValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId, - @javax.annotation.Nonnull UpdateNicPayload updateNicPayload, + private okhttp3.Call updateRouteOfRoutingTableValidateBeforeCall( + @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, + @javax.annotation.Nonnull + UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling updateNic(Async)"); + "Missing the required parameter 'organizationId' when calling updateRouteOfRoutingTable(Async)"); } - // verify the required parameter 'networkId' is set - if (networkId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'networkId' when calling updateNic(Async)"); + "Missing the required parameter 'areaId' when calling updateRouteOfRoutingTable(Async)"); } - // verify the required parameter 'nicId' is set - if (nicId == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'nicId' when calling updateNic(Async)"); + "Missing the required parameter 'region' when calling updateRouteOfRoutingTable(Async)"); } - // verify the required parameter 'updateNicPayload' is set - if (updateNicPayload == null) { + // verify the required parameter 'routingTableId' is set + if (routingTableId == null) { throw new ApiException( - "Missing the required parameter 'updateNicPayload' when calling updateNic(Async)"); + "Missing the required parameter 'routingTableId' when calling updateRouteOfRoutingTable(Async)"); + } + + // verify the required parameter 'routeId' is set + if (routeId == null) { + throw new ApiException( + "Missing the required parameter 'routeId' when calling updateRouteOfRoutingTable(Async)"); } - return updateNicCall(projectId, networkId, nicId, updateNicPayload, _callback); + // verify the required parameter 'updateRouteOfRoutingTablePayload' is set + if (updateRouteOfRoutingTablePayload == null) { + throw new ApiException( + "Missing the required parameter 'updateRouteOfRoutingTablePayload' when calling updateRouteOfRoutingTable(Async)"); + } + + return updateRouteOfRoutingTableCall( + organizationId, + areaId, + region, + routingTableId, + routeId, + updateRouteOfRoutingTablePayload, + _callback); } /** - * Update a network interface. Update the properties of an existing network interface inside a - * network. + * Update a route of a routing table. Update a route defined in a routing table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (required) - * @param updateNicPayload Request an update of a network interface. (required) - * @return NIC + * @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 updateRouteOfRoutingTablePayload Request an update of a route in a routing table. + * (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 Network interface has been updated. -
200 Update request for route successful. -
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 NIC updateNic( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId, - @javax.annotation.Nonnull UpdateNicPayload updateNicPayload) + public Route updateRouteOfRoutingTable( + @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, + @javax.annotation.Nonnull + UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload) throws ApiException { - ApiResponse localVarResp = - updateNicWithHttpInfo(projectId, networkId, nicId, updateNicPayload); + ApiResponse localVarResp = + updateRouteOfRoutingTableWithHttpInfo( + organizationId, + areaId, + region, + routingTableId, + routeId, + updateRouteOfRoutingTablePayload); return localVarResp.getData(); } /** - * Update a network interface. Update the properties of an existing network interface inside a - * network. + * Update a route of a routing table. Update a route defined in a routing table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (required) - * @param updateNicPayload Request an update of a network interface. (required) - * @return ApiResponse<NIC> + * @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 updateRouteOfRoutingTablePayload Request an update of a route in a routing table. + * (required) + * @return ApiResponse<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 Network interface has been updated. -
200 Update request for route successful. -
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 updateNicWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId, - @javax.annotation.Nonnull UpdateNicPayload updateNicPayload) + public ApiResponse updateRouteOfRoutingTableWithHttpInfo( + @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, + @javax.annotation.Nonnull + UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload) throws ApiException { okhttp3.Call localVarCall = - updateNicValidateBeforeCall(projectId, networkId, nicId, updateNicPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + updateRouteOfRoutingTableValidateBeforeCall( + organizationId, + areaId, + region, + routingTableId, + routeId, + updateRouteOfRoutingTablePayload, + null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update a network interface. (asynchronously) Update the properties of an existing network - * interface inside a network. + * Update a route of a routing table. (asynchronously) Update a route defined in a routing + * table. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param networkId The identifier (ID) of a STACKIT Network. (required) - * @param nicId The identifier (ID) of a network interface. (required) - * @param updateNicPayload Request an update of a network interface. (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 updateRouteOfRoutingTablePayload Request an update of a route in a 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 @@ -23691,37 +29397,47 @@ public ApiResponse updateNicWithHttpInfo( * * * - * + * * * * * - * * *
Response Details
Status Code Description Response Headers
200 Network interface has been updated. -
200 Update request for route successful. -
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 updateNicAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID networkId, - @javax.annotation.Nonnull UUID nicId, - @javax.annotation.Nonnull UpdateNicPayload updateNicPayload, - final ApiCallback _callback) + public okhttp3.Call updateRouteOfRoutingTableAsync( + @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, + @javax.annotation.Nonnull + UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updateNicValidateBeforeCall( - projectId, networkId, nicId, updateNicPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + updateRouteOfRoutingTableValidateBeforeCall( + organizationId, + areaId, + region, + routingTableId, + routeId, + updateRouteOfRoutingTablePayload, + _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for updatePublicIP + * Build call for updateRoutingTableOfArea * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (required) - * @param updatePublicIPPayload Request an update of a public IP. (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 updateRoutingTableOfAreaPayload Request an update of a routing table. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -23729,7 +29445,7 @@ public okhttp3.Call updateNicAsync( * * * - * + * * * * @@ -23737,10 +29453,13 @@ public okhttp3.Call updateNicAsync( * *
Response Details
Status Code Description Response Headers
200 Public IP has been updated. -
200 Update request for routing table successful. -
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 updatePublicIPCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID publicIpId, - @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload, + public okhttp3.Call updateRoutingTableOfAreaCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull + UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -23756,17 +29475,23 @@ public okhttp3.Call updatePublicIPCall( basePath = null; } - Object localVarPostBody = updatePublicIPPayload; + Object localVarPostBody = updateRoutingTableOfAreaPayload; // create path and map variables String localVarPath = - "/v1/projects/{projectId}/public-ips/{publicIpId}" + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" .replace( - "{" + "projectId" + "}", - localVarApiClient.escapeString(projectId.toString())) + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) .replace( - "{" + "publicIpId" + "}", - localVarApiClient.escapeString(publicIpId.toString())); + "{" + "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(); @@ -23803,47 +29528,70 @@ public okhttp3.Call updatePublicIPCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call updatePublicIPValidateBeforeCall( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID publicIpId, - @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload, + private okhttp3.Call updateRoutingTableOfAreaValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull + UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { throw new ApiException( - "Missing the required parameter 'projectId' when calling updatePublicIP(Async)"); + "Missing the required parameter 'organizationId' when calling updateRoutingTableOfArea(Async)"); } - // verify the required parameter 'publicIpId' is set - if (publicIpId == null) { + // verify the required parameter 'areaId' is set + if (areaId == null) { throw new ApiException( - "Missing the required parameter 'publicIpId' when calling updatePublicIP(Async)"); + "Missing the required parameter 'areaId' when calling updateRoutingTableOfArea(Async)"); } - // verify the required parameter 'updatePublicIPPayload' is set - if (updatePublicIPPayload == null) { + // verify the required parameter 'region' is set + if (region == null) { throw new ApiException( - "Missing the required parameter 'updatePublicIPPayload' when calling updatePublicIP(Async)"); + "Missing the required parameter 'region' when calling updateRoutingTableOfArea(Async)"); + } + + // verify the required parameter 'routingTableId' is set + if (routingTableId == null) { + throw new ApiException( + "Missing the required parameter 'routingTableId' when calling updateRoutingTableOfArea(Async)"); } - return updatePublicIPCall(projectId, publicIpId, updatePublicIPPayload, _callback); + // verify the required parameter 'updateRoutingTableOfAreaPayload' is set + if (updateRoutingTableOfAreaPayload == null) { + throw new ApiException( + "Missing the required parameter 'updateRoutingTableOfAreaPayload' when calling updateRoutingTableOfArea(Async)"); + } + + return updateRoutingTableOfAreaCall( + organizationId, + areaId, + region, + routingTableId, + updateRoutingTableOfAreaPayload, + _callback); } /** - * Update a public IP. Update the properties of an existing public IP inside a project. + * Update a routing table. Update a routing table defined in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (required) - * @param updatePublicIPPayload Request an update of a public IP. (required) - * @return PublicIp + * @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 updateRoutingTableOfAreaPayload Request an update of a routing table. (required) + * @return RoutingTable * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -23851,30 +29599,40 @@ private okhttp3.Call updatePublicIPValidateBeforeCall( * *
Response Details
Status Code Description Response Headers
200 Public IP has been updated. -
200 Update request for routing table successful. -
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 PublicIp updatePublicIP( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID publicIpId, - @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload) - throws ApiException { - ApiResponse localVarResp = - updatePublicIPWithHttpInfo(projectId, publicIpId, updatePublicIPPayload); + public RoutingTable updateRoutingTableOfArea( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull + UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload) + throws ApiException { + ApiResponse localVarResp = + updateRoutingTableOfAreaWithHttpInfo( + organizationId, + areaId, + region, + routingTableId, + updateRoutingTableOfAreaPayload); return localVarResp.getData(); } /** - * Update a public IP. Update the properties of an existing public IP inside a project. + * Update a routing table. Update a routing table defined in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (required) - * @param updatePublicIPPayload Request an update of a public IP. (required) - * @return ApiResponse<PublicIp> + * @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 updateRoutingTableOfAreaPayload Request an update of a routing table. (required) + * @return ApiResponse<RoutingTable> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * * * * @@ -23882,25 +29640,34 @@ public PublicIp updatePublicIP( * *
Response Details
Status Code Description Response Headers
200 Public IP has been updated. -
200 Update request for routing table successful. -
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 updatePublicIPWithHttpInfo( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID publicIpId, - @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload) + public ApiResponse updateRoutingTableOfAreaWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull + UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload) throws ApiException { okhttp3.Call localVarCall = - updatePublicIPValidateBeforeCall( - projectId, publicIpId, updatePublicIPPayload, null); - Type localVarReturnType = new TypeToken() {}.getType(); + updateRoutingTableOfAreaValidateBeforeCall( + organizationId, + areaId, + region, + routingTableId, + updateRoutingTableOfAreaPayload, + null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update a public IP. (asynchronously) Update the properties of an existing public IP inside a - * project. + * Update a routing table. (asynchronously) Update a routing table defined in a network area. * - * @param projectId The identifier (ID) of a STACKIT Project. (required) - * @param publicIpId The identifier (ID) of a Public IP. (required) - * @param updatePublicIPPayload Request an update of a public IP. (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 updateRoutingTableOfAreaPayload Request an update of a 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 @@ -23909,7 +29676,7 @@ public ApiResponse updatePublicIPWithHttpInfo( * * * - * + * * * * @@ -23917,17 +29684,25 @@ public ApiResponse updatePublicIPWithHttpInfo( * *
Response Details
Status Code Description Response Headers
200 Public IP has been updated. -
200 Update request for routing table successful. -
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 updatePublicIPAsync( - @javax.annotation.Nonnull UUID projectId, - @javax.annotation.Nonnull UUID publicIpId, - @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload, - final ApiCallback _callback) + public okhttp3.Call updateRoutingTableOfAreaAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull String region, + @javax.annotation.Nonnull UUID routingTableId, + @javax.annotation.Nonnull + UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updatePublicIPValidateBeforeCall( - projectId, publicIpId, updatePublicIPPayload, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + updateRoutingTableOfAreaValidateBeforeCall( + organizationId, + areaId, + region, + routingTableId, + updateRoutingTableOfAreaPayload, + _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -23936,6 +29711,7 @@ public okhttp3.Call updatePublicIPAsync( * Build call for updateSecurityGroup * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param updateSecurityGroupPayload Request an update of a security group. (required) * @param _callback Callback for upload/download progress @@ -23955,6 +29731,7 @@ public okhttp3.Call updatePublicIPAsync( */ public okhttp3.Call updateSecurityGroupCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID securityGroupId, @javax.annotation.Nonnull UpdateSecurityGroupPayload updateSecurityGroupPayload, final ApiCallback _callback) @@ -23976,10 +29753,13 @@ public okhttp3.Call updateSecurityGroupCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/security-groups/{securityGroupId}" + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "securityGroupId" + "}", localVarApiClient.escapeString(securityGroupId.toString())); @@ -24021,6 +29801,7 @@ public okhttp3.Call updateSecurityGroupCall( @SuppressWarnings("rawtypes") private okhttp3.Call updateSecurityGroupValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID securityGroupId, @javax.annotation.Nonnull UpdateSecurityGroupPayload updateSecurityGroupPayload, final ApiCallback _callback) @@ -24031,6 +29812,12 @@ private okhttp3.Call updateSecurityGroupValidateBeforeCall( "Missing the required parameter 'projectId' when calling updateSecurityGroup(Async)"); } + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateSecurityGroup(Async)"); + } + // verify the required parameter 'securityGroupId' is set if (securityGroupId == null) { throw new ApiException( @@ -24044,13 +29831,14 @@ private okhttp3.Call updateSecurityGroupValidateBeforeCall( } return updateSecurityGroupCall( - projectId, securityGroupId, updateSecurityGroupPayload, _callback); + projectId, region, securityGroupId, updateSecurityGroupPayload, _callback); } /** * Update information of a security group. Update labels of the security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param updateSecurityGroupPayload Request an update of a security group. (required) * @return SecurityGroup @@ -24070,12 +29858,13 @@ private okhttp3.Call updateSecurityGroupValidateBeforeCall( */ public SecurityGroup updateSecurityGroup( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID securityGroupId, @javax.annotation.Nonnull UpdateSecurityGroupPayload updateSecurityGroupPayload) throws ApiException { ApiResponse localVarResp = updateSecurityGroupWithHttpInfo( - projectId, securityGroupId, updateSecurityGroupPayload); + projectId, region, securityGroupId, updateSecurityGroupPayload); return localVarResp.getData(); } @@ -24083,6 +29872,7 @@ public SecurityGroup updateSecurityGroup( * Update information of a security group. Update labels of the security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param updateSecurityGroupPayload Request an update of a security group. (required) * @return ApiResponse<SecurityGroup> @@ -24102,12 +29892,13 @@ public SecurityGroup updateSecurityGroup( */ public ApiResponse updateSecurityGroupWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID securityGroupId, @javax.annotation.Nonnull UpdateSecurityGroupPayload updateSecurityGroupPayload) throws ApiException { okhttp3.Call localVarCall = updateSecurityGroupValidateBeforeCall( - projectId, securityGroupId, updateSecurityGroupPayload, null); + projectId, region, securityGroupId, updateSecurityGroupPayload, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -24116,6 +29907,7 @@ public ApiResponse updateSecurityGroupWithHttpInfo( * Update information of a security group. (asynchronously) Update labels of the security group. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param securityGroupId The identifier (ID) of a STACKIT Security Group. (required) * @param updateSecurityGroupPayload Request an update of a security group. (required) * @param _callback The callback to be executed when the API call finishes @@ -24136,6 +29928,7 @@ public ApiResponse updateSecurityGroupWithHttpInfo( */ public okhttp3.Call updateSecurityGroupAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID securityGroupId, @javax.annotation.Nonnull UpdateSecurityGroupPayload updateSecurityGroupPayload, final ApiCallback _callback) @@ -24143,7 +29936,7 @@ public okhttp3.Call updateSecurityGroupAsync( okhttp3.Call localVarCall = updateSecurityGroupValidateBeforeCall( - projectId, securityGroupId, updateSecurityGroupPayload, _callback); + projectId, region, securityGroupId, updateSecurityGroupPayload, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -24153,6 +29946,7 @@ public okhttp3.Call updateSecurityGroupAsync( * Build call for updateServer * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param updateServerPayload Request an update of a server. (required) * @param _callback Callback for upload/download progress @@ -24172,6 +29966,7 @@ public okhttp3.Call updateSecurityGroupAsync( */ public okhttp3.Call updateServerCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UpdateServerPayload updateServerPayload, final ApiCallback _callback) @@ -24193,10 +29988,13 @@ public okhttp3.Call updateServerCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/servers/{serverId}" + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "serverId" + "}", localVarApiClient.escapeString(serverId.toString())); @@ -24238,6 +30036,7 @@ public okhttp3.Call updateServerCall( @SuppressWarnings("rawtypes") private okhttp3.Call updateServerValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UpdateServerPayload updateServerPayload, final ApiCallback _callback) @@ -24248,6 +30047,12 @@ private okhttp3.Call updateServerValidateBeforeCall( "Missing the required parameter 'projectId' when calling updateServer(Async)"); } + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateServer(Async)"); + } + // verify the required parameter 'serverId' is set if (serverId == null) { throw new ApiException( @@ -24260,13 +30065,14 @@ private okhttp3.Call updateServerValidateBeforeCall( "Missing the required parameter 'updateServerPayload' when calling updateServer(Async)"); } - return updateServerCall(projectId, serverId, updateServerPayload, _callback); + return updateServerCall(projectId, region, serverId, updateServerPayload, _callback); } /** * Update information of a server. Update name or labels of the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param updateServerPayload Request an update of a server. (required) * @return Server @@ -24286,11 +30092,12 @@ private okhttp3.Call updateServerValidateBeforeCall( */ public Server updateServer( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UpdateServerPayload updateServerPayload) throws ApiException { ApiResponse localVarResp = - updateServerWithHttpInfo(projectId, serverId, updateServerPayload); + updateServerWithHttpInfo(projectId, region, serverId, updateServerPayload); return localVarResp.getData(); } @@ -24298,6 +30105,7 @@ public Server updateServer( * Update information of a server. Update name or labels of the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param updateServerPayload Request an update of a server. (required) * @return ApiResponse<Server> @@ -24317,11 +30125,13 @@ public Server updateServer( */ public ApiResponse updateServerWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UpdateServerPayload updateServerPayload) throws ApiException { okhttp3.Call localVarCall = - updateServerValidateBeforeCall(projectId, serverId, updateServerPayload, null); + updateServerValidateBeforeCall( + projectId, region, serverId, updateServerPayload, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -24330,6 +30140,7 @@ public ApiResponse updateServerWithHttpInfo( * Update information of a server. (asynchronously) Update name or labels of the server. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param serverId The identifier (ID) of a STACKIT Server. (required) * @param updateServerPayload Request an update of a server. (required) * @param _callback The callback to be executed when the API call finishes @@ -24350,13 +30161,15 @@ public ApiResponse updateServerWithHttpInfo( */ public okhttp3.Call updateServerAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID serverId, @javax.annotation.Nonnull UpdateServerPayload updateServerPayload, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updateServerValidateBeforeCall(projectId, serverId, updateServerPayload, _callback); + updateServerValidateBeforeCall( + projectId, region, serverId, updateServerPayload, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -24366,6 +30179,7 @@ public okhttp3.Call updateServerAsync( * Build call for updateSnapshot * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) * @param updateSnapshotPayload Request an update of a snapshot. (required) * @param _callback Callback for upload/download progress @@ -24385,6 +30199,7 @@ public okhttp3.Call updateServerAsync( */ public okhttp3.Call updateSnapshotCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID snapshotId, @javax.annotation.Nonnull UpdateSnapshotPayload updateSnapshotPayload, final ApiCallback _callback) @@ -24406,10 +30221,13 @@ public okhttp3.Call updateSnapshotCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/snapshots/{snapshotId}" + "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "snapshotId" + "}", localVarApiClient.escapeString(snapshotId.toString())); @@ -24451,6 +30269,7 @@ public okhttp3.Call updateSnapshotCall( @SuppressWarnings("rawtypes") private okhttp3.Call updateSnapshotValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID snapshotId, @javax.annotation.Nonnull UpdateSnapshotPayload updateSnapshotPayload, final ApiCallback _callback) @@ -24461,6 +30280,12 @@ private okhttp3.Call updateSnapshotValidateBeforeCall( "Missing the required parameter 'projectId' when calling updateSnapshot(Async)"); } + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateSnapshot(Async)"); + } + // verify the required parameter 'snapshotId' is set if (snapshotId == null) { throw new ApiException( @@ -24473,13 +30298,14 @@ private okhttp3.Call updateSnapshotValidateBeforeCall( "Missing the required parameter 'updateSnapshotPayload' when calling updateSnapshot(Async)"); } - return updateSnapshotCall(projectId, snapshotId, updateSnapshotPayload, _callback); + return updateSnapshotCall(projectId, region, snapshotId, updateSnapshotPayload, _callback); } /** * Update information of the snapshot. Update information like name or labels of the snapshot. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) * @param updateSnapshotPayload Request an update of a snapshot. (required) * @return Snapshot @@ -24499,11 +30325,12 @@ private okhttp3.Call updateSnapshotValidateBeforeCall( */ public Snapshot updateSnapshot( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID snapshotId, @javax.annotation.Nonnull UpdateSnapshotPayload updateSnapshotPayload) throws ApiException { ApiResponse localVarResp = - updateSnapshotWithHttpInfo(projectId, snapshotId, updateSnapshotPayload); + updateSnapshotWithHttpInfo(projectId, region, snapshotId, updateSnapshotPayload); return localVarResp.getData(); } @@ -24511,6 +30338,7 @@ public Snapshot updateSnapshot( * Update information of the snapshot. Update information like name or labels of the snapshot. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) * @param updateSnapshotPayload Request an update of a snapshot. (required) * @return ApiResponse<Snapshot> @@ -24530,12 +30358,13 @@ public Snapshot updateSnapshot( */ public ApiResponse updateSnapshotWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID snapshotId, @javax.annotation.Nonnull UpdateSnapshotPayload updateSnapshotPayload) throws ApiException { okhttp3.Call localVarCall = updateSnapshotValidateBeforeCall( - projectId, snapshotId, updateSnapshotPayload, null); + projectId, region, snapshotId, updateSnapshotPayload, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -24545,6 +30374,7 @@ public ApiResponse updateSnapshotWithHttpInfo( * of the snapshot. * * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param region The STACKIT Region of the resources. (required) * @param snapshotId The identifier (ID) of a STACKIT Snapshot. (required) * @param updateSnapshotPayload Request an update of a snapshot. (required) * @param _callback The callback to be executed when the API call finishes @@ -24565,6 +30395,7 @@ public ApiResponse updateSnapshotWithHttpInfo( */ public okhttp3.Call updateSnapshotAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID snapshotId, @javax.annotation.Nonnull UpdateSnapshotPayload updateSnapshotPayload, final ApiCallback _callback) @@ -24572,7 +30403,7 @@ public okhttp3.Call updateSnapshotAsync( okhttp3.Call localVarCall = updateSnapshotValidateBeforeCall( - projectId, snapshotId, updateSnapshotPayload, _callback); + projectId, region, snapshotId, updateSnapshotPayload, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -24582,6 +30413,7 @@ public okhttp3.Call updateSnapshotAsync( * Build call for updateVolume * * @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 updateVolumePayload Request an update of a volume. (required) * @param _callback Callback for upload/download progress @@ -24601,6 +30433,7 @@ public okhttp3.Call updateSnapshotAsync( */ public okhttp3.Call updateVolumeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID volumeId, @javax.annotation.Nonnull UpdateVolumePayload updateVolumePayload, final ApiCallback _callback) @@ -24622,10 +30455,13 @@ public okhttp3.Call updateVolumeCall( // create path and map variables String localVarPath = - "/v1/projects/{projectId}/volumes/{volumeId}" + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" .replace( "{" + "projectId" + "}", localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "region" + "}", + localVarApiClient.escapeString(region.toString())) .replace( "{" + "volumeId" + "}", localVarApiClient.escapeString(volumeId.toString())); @@ -24667,6 +30503,7 @@ public okhttp3.Call updateVolumeCall( @SuppressWarnings("rawtypes") private okhttp3.Call updateVolumeValidateBeforeCall( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID volumeId, @javax.annotation.Nonnull UpdateVolumePayload updateVolumePayload, final ApiCallback _callback) @@ -24677,6 +30514,12 @@ private okhttp3.Call updateVolumeValidateBeforeCall( "Missing the required parameter 'projectId' when calling updateVolume(Async)"); } + // verify the required parameter 'region' is set + if (region == null) { + throw new ApiException( + "Missing the required parameter 'region' when calling updateVolume(Async)"); + } + // verify the required parameter 'volumeId' is set if (volumeId == null) { throw new ApiException( @@ -24689,13 +30532,14 @@ private okhttp3.Call updateVolumeValidateBeforeCall( "Missing the required parameter 'updateVolumePayload' when calling updateVolume(Async)"); } - return updateVolumeCall(projectId, volumeId, updateVolumePayload, _callback); + return updateVolumeCall(projectId, region, volumeId, updateVolumePayload, _callback); } /** * Update information of a volume. Update name, description or labels of the volume. * * @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 updateVolumePayload Request an update of a volume. (required) * @return Volume @@ -24715,11 +30559,12 @@ private okhttp3.Call updateVolumeValidateBeforeCall( */ public Volume updateVolume( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID volumeId, @javax.annotation.Nonnull UpdateVolumePayload updateVolumePayload) throws ApiException { ApiResponse localVarResp = - updateVolumeWithHttpInfo(projectId, volumeId, updateVolumePayload); + updateVolumeWithHttpInfo(projectId, region, volumeId, updateVolumePayload); return localVarResp.getData(); } @@ -24727,6 +30572,7 @@ public Volume updateVolume( * Update information of a volume. Update name, description or labels of the volume. * * @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 updateVolumePayload Request an update of a volume. (required) * @return ApiResponse<Volume> @@ -24746,11 +30592,13 @@ public Volume updateVolume( */ public ApiResponse updateVolumeWithHttpInfo( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID volumeId, @javax.annotation.Nonnull UpdateVolumePayload updateVolumePayload) throws ApiException { okhttp3.Call localVarCall = - updateVolumeValidateBeforeCall(projectId, volumeId, updateVolumePayload, null); + updateVolumeValidateBeforeCall( + projectId, region, volumeId, updateVolumePayload, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -24760,6 +30608,7 @@ public ApiResponse updateVolumeWithHttpInfo( * volume. * * @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 updateVolumePayload Request an update of a volume. (required) * @param _callback The callback to be executed when the API call finishes @@ -24780,13 +30629,15 @@ public ApiResponse updateVolumeWithHttpInfo( */ public okhttp3.Call updateVolumeAsync( @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String region, @javax.annotation.Nonnull UUID volumeId, @javax.annotation.Nonnull UpdateVolumePayload updateVolumePayload, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - updateVolumeValidateBeforeCall(projectId, volumeId, updateVolumePayload, _callback); + updateVolumeValidateBeforeCall( + projectId, region, volumeId, updateVolumePayload, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/IaasApi.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/IaasApi.java index c602505e..8646560a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/IaasApi.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/IaasApi.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AbstractOpenApiSchema.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AbstractOpenApiSchema.java index f24c23e1..c41a84a1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AbstractOpenApiSchema.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AbstractOpenApiSchema.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,7 +18,7 @@ /** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddRoutesToRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddRoutesToRoutingTablePayload.java new file mode 100644 index 00000000..7c7363c3 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddRoutesToRoutingTablePayload.java @@ -0,0 +1,334 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; + +/** Object represents a request to add network routes. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class AddRoutesToRoutingTablePayload { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public AddRoutesToRoutingTablePayload() {} + + public AddRoutesToRoutingTablePayload items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public AddRoutesToRoutingTablePayload addItemsItem(Route itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of 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 AddRoutesToRoutingTablePayload instance itself + */ + public AddRoutesToRoutingTablePayload 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; + } + AddRoutesToRoutingTablePayload addRoutesToRoutingTablePayload = + (AddRoutesToRoutingTablePayload) o; + return Objects.equals(this.items, addRoutesToRoutingTablePayload.items) + && Objects.equals( + this.additionalProperties, + addRoutesToRoutingTablePayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(items, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddRoutesToRoutingTablePayload {\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 + * AddRoutesToRoutingTablePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddRoutesToRoutingTablePayload.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 AddRoutesToRoutingTablePayload is not found in the empty JSON string", + AddRoutesToRoutingTablePayload.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddRoutesToRoutingTablePayload.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++) { + Route.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddRoutesToRoutingTablePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddRoutesToRoutingTablePayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddRoutesToRoutingTablePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddRoutesToRoutingTablePayload 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 AddRoutesToRoutingTablePayload read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddRoutesToRoutingTablePayload 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 AddRoutesToRoutingTablePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddRoutesToRoutingTablePayload + * @throws IOException if the JSON string is invalid with respect to + * AddRoutesToRoutingTablePayload + */ + public static AddRoutesToRoutingTablePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddRoutesToRoutingTablePayload.class); + } + + /** + * Convert an instance of AddRoutesToRoutingTablePayload 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/model/AddRoutingTableToAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddRoutingTableToAreaPayload.java new file mode 100644 index 00000000..00eba24f --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddRoutingTableToAreaPayload.java @@ -0,0 +1,536 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; + +/** An object representing a routing table. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class AddRoutingTableToAreaPayload { + 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_DEFAULT = "default"; + + @SerializedName(SERIALIZED_NAME_DEFAULT) + @javax.annotation.Nullable private Boolean _default = true; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + + public static final String SERIALIZED_NAME_DYNAMIC_ROUTES = "dynamicRoutes"; + + @SerializedName(SERIALIZED_NAME_DYNAMIC_ROUTES) + @javax.annotation.Nullable private Boolean dynamicRoutes = true; + + 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_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_SYSTEM_ROUTES = "systemRoutes"; + + @SerializedName(SERIALIZED_NAME_SYSTEM_ROUTES) + @javax.annotation.Nullable private Boolean systemRoutes = true; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public AddRoutingTableToAreaPayload() {} + + public AddRoutingTableToAreaPayload( + OffsetDateTime createdAt, Boolean _default, UUID id, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this._default = _default; + this.id = id; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * This is the default routing table. It can't be deleted and is used if the user does not + * specify it otherwise. + * + * @return _default + */ + @javax.annotation.Nullable public Boolean getDefault() { + return _default; + } + + public AddRoutingTableToAreaPayload 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 AddRoutingTableToAreaPayload dynamicRoutes( + @javax.annotation.Nullable Boolean dynamicRoutes) { + this.dynamicRoutes = dynamicRoutes; + return this; + } + + /** + * A config setting for a routing table which allows propagation of dynamic routes to this + * routing table. + * + * @return dynamicRoutes + */ + @javax.annotation.Nullable public Boolean getDynamicRoutes() { + return dynamicRoutes; + } + + public void setDynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { + this.dynamicRoutes = dynamicRoutes; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public AddRoutingTableToAreaPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * 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. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public AddRoutingTableToAreaPayload 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; + } + + public AddRoutingTableToAreaPayload systemRoutes( + @javax.annotation.Nullable Boolean systemRoutes) { + this.systemRoutes = systemRoutes; + return this; + } + + /** + * A config setting for a routing table which allows installation of automatic system routes for + * connectivity between projects in the same SNA. + * + * @return systemRoutes + */ + @javax.annotation.Nullable public Boolean getSystemRoutes() { + return systemRoutes; + } + + public void setSystemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { + this.systemRoutes = systemRoutes; + } + + /** + * 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 AddRoutingTableToAreaPayload instance itself + */ + public AddRoutingTableToAreaPayload 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; + } + AddRoutingTableToAreaPayload addRoutingTableToAreaPayload = + (AddRoutingTableToAreaPayload) o; + return Objects.equals(this.createdAt, addRoutingTableToAreaPayload.createdAt) + && Objects.equals(this._default, addRoutingTableToAreaPayload._default) + && Objects.equals(this.description, addRoutingTableToAreaPayload.description) + && Objects.equals(this.dynamicRoutes, addRoutingTableToAreaPayload.dynamicRoutes) + && Objects.equals(this.id, addRoutingTableToAreaPayload.id) + && Objects.equals(this.labels, addRoutingTableToAreaPayload.labels) + && Objects.equals(this.name, addRoutingTableToAreaPayload.name) + && Objects.equals(this.systemRoutes, addRoutingTableToAreaPayload.systemRoutes) + && Objects.equals(this.updatedAt, addRoutingTableToAreaPayload.updatedAt) + && Objects.equals( + this.additionalProperties, + addRoutingTableToAreaPayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + _default, + description, + dynamicRoutes, + id, + labels, + name, + systemRoutes, + updatedAt, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddRoutingTableToAreaPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" _default: ").append(toIndentedString(_default)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" dynamicRoutes: ").append(toIndentedString(dynamicRoutes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" systemRoutes: ").append(toIndentedString(systemRoutes)).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", + "default", + "description", + "dynamicRoutes", + "id", + "labels", + "name", + "systemRoutes", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 + * AddRoutingTableToAreaPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddRoutingTableToAreaPayload.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 AddRoutingTableToAreaPayload is not found in the empty JSON string", + AddRoutingTableToAreaPayload.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddRoutingTableToAreaPayload.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())); + } + 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddRoutingTableToAreaPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddRoutingTableToAreaPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddRoutingTableToAreaPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddRoutingTableToAreaPayload 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 AddRoutingTableToAreaPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddRoutingTableToAreaPayload 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 AddRoutingTableToAreaPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddRoutingTableToAreaPayload + * @throws IOException if the JSON string is invalid with respect to + * AddRoutingTableToAreaPayload + */ + public static AddRoutingTableToAreaPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddRoutingTableToAreaPayload.class); + } + + /** + * Convert an instance of AddRoutingTableToAreaPayload 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/model/AddVolumeToServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddVolumeToServerPayload.java index e070bec5..9c2459b9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddVolumeToServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddVolumeToServerPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,17 @@ 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; -import java.util.Set; import java.util.UUID; /** Object that represents a Volume attachment to a server. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class AddVolumeToServerPayload { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -95,6 +96,50 @@ public void setDeleteOnTermination(@javax.annotation.Nullable Boolean deleteOnTe return volumeId; } + /** + * 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 AddVolumeToServerPayload instance itself + */ + public AddVolumeToServerPayload 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) { @@ -107,12 +152,14 @@ public boolean equals(Object o) { return Objects.equals( this.deleteOnTermination, addVolumeToServerPayload.deleteOnTermination) && Objects.equals(this.serverId, addVolumeToServerPayload.serverId) - && Objects.equals(this.volumeId, addVolumeToServerPayload.volumeId); + && Objects.equals(this.volumeId, addVolumeToServerPayload.volumeId) + && Objects.equals( + this.additionalProperties, addVolumeToServerPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(deleteOnTermination, serverId, volumeId); + return Objects.hash(deleteOnTermination, serverId, volumeId, additionalProperties); } @Override @@ -124,6 +171,9 @@ public String toString() { .append("\n"); sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); sb.append(" volumeId: ").append(toIndentedString(volumeId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -163,26 +213,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in AddVolumeToServerPayload is not found in the empty JSON string", AddVolumeToServerPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AddVolumeToServerPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `AddVolumeToServerPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("serverId") != null && !jsonObj.get("serverId").isJsonNull()) && !jsonObj.get("serverId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `serverId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverId").toString())); } @@ -190,6 +231,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("volumeId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeId").toString())); } @@ -213,6 +255,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, AddVolumeToServerPayload 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); } @@ -220,7 +286,41 @@ public void write(JsonWriter out, AddVolumeToServerPayload value) public AddVolumeToServerPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddVolumeToServerPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroup.java index 8dfea6ad..8c944b26 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroup.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,17 +25,17 @@ 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; -import java.util.Set; import java.util.UUID; /** Definition of an affinity group. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class AffinityGroup { public static final String SERIALIZED_NAME_ID = "id"; @@ -129,6 +129,50 @@ public void setPolicy(@javax.annotation.Nonnull String policy) { this.policy = policy; } + /** + * 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 AffinityGroup instance itself + */ + public AffinityGroup 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) { @@ -141,12 +185,13 @@ public boolean equals(Object o) { return Objects.equals(this.id, affinityGroup.id) && Objects.equals(this.members, affinityGroup.members) && Objects.equals(this.name, affinityGroup.name) - && Objects.equals(this.policy, affinityGroup.policy); + && Objects.equals(this.policy, affinityGroup.policy) + && Objects.equals(this.additionalProperties, affinityGroup.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, members, name, policy); + return Objects.hash(id, members, name, policy, additionalProperties); } @Override @@ -157,6 +202,9 @@ public String toString() { sb.append(" members: ").append(toIndentedString(members)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" policy: ").append(toIndentedString(policy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -195,29 +243,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in AffinityGroup is not found in the empty JSON string", AffinityGroup.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AffinityGroup.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `AffinityGroup` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AffinityGroup.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -225,6 +265,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -234,18 +275,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("members").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); } 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("policy").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `policy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("policy").toString())); } @@ -267,6 +311,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, AffinityGroup 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); } @@ -274,7 +342,41 @@ public void write(JsonWriter out, AffinityGroup value) throws IOException { public AffinityGroup read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AffinityGroup 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroupListResponse.java index 874bb389..2c598a5b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroupListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Response object for affinity group list request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class AffinityGroupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 AffinityGroupListResponse instance itself + */ + public AffinityGroupListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } AffinityGroupListResponse affinityGroupListResponse = (AffinityGroupListResponse) o; - return Objects.equals(this.items, affinityGroupListResponse.items); + return Objects.equals(this.items, affinityGroupListResponse.items) + && Objects.equals( + this.additionalProperties, affinityGroupListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AffinityGroupListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in AffinityGroupListResponse is not found in the empty JSON string", AffinityGroupListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AffinityGroupListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `AffinityGroupListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AffinityGroupListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -192,6 +234,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, AffinityGroupListResponse 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); } @@ -199,7 +265,41 @@ public void write(JsonWriter out, AffinityGroupListResponse value) public AffinityGroupListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AffinityGroupListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AllowedAddressesInner.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AllowedAddressesInner.java index 6f11142e..e24d3e10 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AllowedAddressesInner.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AllowedAddressesInner.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -30,7 +30,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class AllowedAddressesInner extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(AllowedAddressesInner.class.getName()); @@ -83,6 +83,7 @@ public AllowedAddressesInner read(JsonReader in) throws IOException { 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())); } @@ -93,6 +94,7 @@ public AllowedAddressesInner read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( + java.util.Locale.ROOT, "Deserialization for String failed with `%s`.", e.getMessage())); log.log( @@ -109,8 +111,11 @@ public AllowedAddressesInner read(JsonReader in) throws IOException { throw new IOException( String.format( + java.util.Locale.ROOT, "Failed deserialization for AllowedAddressesInner: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, errorMessages, jsonElement.toString())); + match, + errorMessages, + jsonElement.toString())); } }.nullSafe(); } @@ -190,20 +195,27 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } validCount++; } catch (Exception e) { errorMessages.add( - String.format("Deserialization for String failed with `%s`.", e.getMessage())); + String.format( + java.util.Locale.ROOT, + "Deserialization for String 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 AllowedAddressesInner with oneOf schemas: String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, errorMessages, jsonElement.toString())); + validCount, + errorMessages, + jsonElement.toString())); } } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Area.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Area.java deleted file mode 100644 index 27ab1a76..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Area.java +++ /dev/null @@ -1,350 +0,0 @@ -/* - * IaaS-API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 1 - * 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.model; - -import cloud.stackit.sdk.iaas.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.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The basic properties of a network area. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class Area { - public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_NAMESERVERS) - @javax.annotation.Nullable private List defaultNameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_NETWORK_RANGES = "networkRanges"; - - @SerializedName(SERIALIZED_NAME_NETWORK_RANGES) - @javax.annotation.Nullable private List networkRanges = new ArrayList<>(); - - public static final String SERIALIZED_NAME_ROUTES = "routes"; - - @SerializedName(SERIALIZED_NAME_ROUTES) - @javax.annotation.Nullable private List routes = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TRANSFER_NETWORK = "transferNetwork"; - - @SerializedName(SERIALIZED_NAME_TRANSFER_NETWORK) - @javax.annotation.Nullable private String transferNetwork; - - public Area() {} - - public Area defaultNameservers(@javax.annotation.Nullable List defaultNameservers) { - this.defaultNameservers = defaultNameservers; - return this; - } - - public Area addDefaultNameserversItem(String defaultNameserversItem) { - if (this.defaultNameservers == null) { - this.defaultNameservers = new ArrayList<>(); - } - this.defaultNameservers.add(defaultNameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv4. - * - * @return defaultNameservers - */ - @javax.annotation.Nullable public List getDefaultNameservers() { - return defaultNameservers; - } - - public void setDefaultNameservers(@javax.annotation.Nullable List defaultNameservers) { - this.defaultNameservers = defaultNameservers; - } - - public Area networkRanges(@javax.annotation.Nullable List networkRanges) { - this.networkRanges = networkRanges; - return this; - } - - public Area addNetworkRangesItem(NetworkRange networkRangesItem) { - if (this.networkRanges == null) { - this.networkRanges = new ArrayList<>(); - } - this.networkRanges.add(networkRangesItem); - return this; - } - - /** - * A list of network ranges. - * - * @return networkRanges - */ - @javax.annotation.Nullable public List getNetworkRanges() { - return networkRanges; - } - - public void setNetworkRanges(@javax.annotation.Nullable List networkRanges) { - this.networkRanges = networkRanges; - } - - public Area routes(@javax.annotation.Nullable List routes) { - this.routes = routes; - return this; - } - - public Area addRoutesItem(Route routesItem) { - if (this.routes == null) { - this.routes = new ArrayList<>(); - } - this.routes.add(routesItem); - return this; - } - - /** - * A list of routes. - * - * @return routes - */ - @javax.annotation.Nullable public List getRoutes() { - return routes; - } - - public void setRoutes(@javax.annotation.Nullable List routes) { - this.routes = routes; - } - - public Area transferNetwork(@javax.annotation.Nullable String transferNetwork) { - this.transferNetwork = transferNetwork; - return this; - } - - /** - * Classless Inter-Domain Routing (CIDR). - * - * @return transferNetwork - */ - @javax.annotation.Nullable public String getTransferNetwork() { - return transferNetwork; - } - - public void setTransferNetwork(@javax.annotation.Nullable String transferNetwork) { - this.transferNetwork = transferNetwork; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Area area = (Area) o; - return Objects.equals(this.defaultNameservers, area.defaultNameservers) - && Objects.equals(this.networkRanges, area.networkRanges) - && Objects.equals(this.routes, area.routes) - && Objects.equals(this.transferNetwork, area.transferNetwork); - } - - @Override - public int hashCode() { - return Objects.hash(defaultNameservers, networkRanges, routes, transferNetwork); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Area {\n"); - sb.append(" defaultNameservers: ") - .append(toIndentedString(defaultNameservers)) - .append("\n"); - sb.append(" networkRanges: ").append(toIndentedString(networkRanges)).append("\n"); - sb.append(" routes: ").append(toIndentedString(routes)).append("\n"); - sb.append(" transferNetwork: ").append(toIndentedString(transferNetwork)).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( - "defaultNameservers", - "networkRanges", - "routes", - "transferNetwork")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Area - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Area.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Area is not found in the empty JSON string", - Area.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Area.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Area` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("defaultNameservers") != null - && !jsonObj.get("defaultNameservers").isJsonNull() - && !jsonObj.get("defaultNameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `defaultNameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("defaultNameservers").toString())); - } - if (jsonObj.get("networkRanges") != null && !jsonObj.get("networkRanges").isJsonNull()) { - JsonArray jsonArraynetworkRanges = jsonObj.getAsJsonArray("networkRanges"); - if (jsonArraynetworkRanges != null) { - // ensure the json data is an array - if (!jsonObj.get("networkRanges").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `networkRanges` to be an array in the JSON string but got `%s`", - jsonObj.get("networkRanges").toString())); - } - - // validate the optional field `networkRanges` (array) - for (int i = 0; i < jsonArraynetworkRanges.size(); i++) { - NetworkRange.validateJsonElement(jsonArraynetworkRanges.get(i)); - } - ; - } - } - if (jsonObj.get("routes") != null && !jsonObj.get("routes").isJsonNull()) { - JsonArray jsonArrayroutes = jsonObj.getAsJsonArray("routes"); - if (jsonArrayroutes != null) { - // ensure the json data is an array - if (!jsonObj.get("routes").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `routes` to be an array in the JSON string but got `%s`", - jsonObj.get("routes").toString())); - } - - // validate the optional field `routes` (array) - for (int i = 0; i < jsonArrayroutes.size(); i++) { - Route.validateJsonElement(jsonArrayroutes.get(i)); - } - ; - } - } - if ((jsonObj.get("transferNetwork") != null && !jsonObj.get("transferNetwork").isJsonNull()) - && !jsonObj.get("transferNetwork").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transferNetwork` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("transferNetwork").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Area.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Area' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Area.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Area value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Area read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Area given an JSON string - * - * @param jsonString JSON string - * @return An instance of Area - * @throws IOException if the JSON string is invalid with respect to Area - */ - public static Area fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Area.class); - } - - /** - * Convert an instance of Area 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/model/AreaConfig.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaConfig.java deleted file mode 100644 index e6fc1167..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaConfig.java +++ /dev/null @@ -1,361 +0,0 @@ -/* - * IaaS-API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 1 - * 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.model; - -import cloud.stackit.sdk.iaas.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.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The basic network area object. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class AreaConfig { - public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_NAMESERVERS) - @javax.annotation.Nullable private List defaultNameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_NETWORK_RANGES = "networkRanges"; - - @SerializedName(SERIALIZED_NAME_NETWORK_RANGES) - @javax.annotation.Nonnull - private List networkRanges = new ArrayList<>(); - - public static final String SERIALIZED_NAME_ROUTES = "routes"; - - @SerializedName(SERIALIZED_NAME_ROUTES) - @javax.annotation.Nullable private List routes = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TRANSFER_NETWORK = "transferNetwork"; - - @SerializedName(SERIALIZED_NAME_TRANSFER_NETWORK) - @javax.annotation.Nonnull - private String transferNetwork; - - public AreaConfig() {} - - public AreaConfig defaultNameservers( - @javax.annotation.Nullable List defaultNameservers) { - this.defaultNameservers = defaultNameservers; - return this; - } - - public AreaConfig addDefaultNameserversItem(String defaultNameserversItem) { - if (this.defaultNameservers == null) { - this.defaultNameservers = new ArrayList<>(); - } - this.defaultNameservers.add(defaultNameserversItem); - return this; - } - - /** - * Get defaultNameservers - * - * @return defaultNameservers - */ - @javax.annotation.Nullable public List getDefaultNameservers() { - return defaultNameservers; - } - - public void setDefaultNameservers(@javax.annotation.Nullable List defaultNameservers) { - this.defaultNameservers = defaultNameservers; - } - - public AreaConfig networkRanges(@javax.annotation.Nonnull List networkRanges) { - this.networkRanges = networkRanges; - return this; - } - - public AreaConfig addNetworkRangesItem(NetworkRange networkRangesItem) { - if (this.networkRanges == null) { - this.networkRanges = new ArrayList<>(); - } - this.networkRanges.add(networkRangesItem); - return this; - } - - /** - * A list of network ranges. - * - * @return networkRanges - */ - @javax.annotation.Nonnull - public List getNetworkRanges() { - return networkRanges; - } - - public void setNetworkRanges(@javax.annotation.Nonnull List networkRanges) { - this.networkRanges = networkRanges; - } - - public AreaConfig routes(@javax.annotation.Nullable List routes) { - this.routes = routes; - return this; - } - - public AreaConfig addRoutesItem(Route routesItem) { - if (this.routes == null) { - this.routes = new ArrayList<>(); - } - this.routes.add(routesItem); - return this; - } - - /** - * A list of routes. - * - * @return routes - */ - @javax.annotation.Nullable public List getRoutes() { - return routes; - } - - public void setRoutes(@javax.annotation.Nullable List routes) { - this.routes = routes; - } - - public AreaConfig transferNetwork(@javax.annotation.Nonnull String transferNetwork) { - this.transferNetwork = transferNetwork; - return this; - } - - /** - * Classless Inter-Domain Routing (CIDR). - * - * @return transferNetwork - */ - @javax.annotation.Nonnull - public String getTransferNetwork() { - return transferNetwork; - } - - public void setTransferNetwork(@javax.annotation.Nonnull String transferNetwork) { - this.transferNetwork = transferNetwork; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AreaConfig areaConfig = (AreaConfig) o; - return Objects.equals(this.defaultNameservers, areaConfig.defaultNameservers) - && Objects.equals(this.networkRanges, areaConfig.networkRanges) - && Objects.equals(this.routes, areaConfig.routes) - && Objects.equals(this.transferNetwork, areaConfig.transferNetwork); - } - - @Override - public int hashCode() { - return Objects.hash(defaultNameservers, networkRanges, routes, transferNetwork); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AreaConfig {\n"); - sb.append(" defaultNameservers: ") - .append(toIndentedString(defaultNameservers)) - .append("\n"); - sb.append(" networkRanges: ").append(toIndentedString(networkRanges)).append("\n"); - sb.append(" routes: ").append(toIndentedString(routes)).append("\n"); - sb.append(" transferNetwork: ").append(toIndentedString(transferNetwork)).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( - "defaultNameservers", - "networkRanges", - "routes", - "transferNetwork")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = - new HashSet(Arrays.asList("networkRanges", "transferNetwork")); - } - - /** - * 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 AreaConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AreaConfig.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AreaConfig is not found in the empty JSON string", - AreaConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AreaConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `AreaConfig` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AreaConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("defaultNameservers") != null - && !jsonObj.get("defaultNameservers").isJsonNull() - && !jsonObj.get("defaultNameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `defaultNameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("defaultNameservers").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("networkRanges").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `networkRanges` to be an array in the JSON string but got `%s`", - jsonObj.get("networkRanges").toString())); - } - - JsonArray jsonArraynetworkRanges = jsonObj.getAsJsonArray("networkRanges"); - // validate the required field `networkRanges` (array) - for (int i = 0; i < jsonArraynetworkRanges.size(); i++) { - NetworkRange.validateJsonElement(jsonArraynetworkRanges.get(i)); - } - ; - if (jsonObj.get("routes") != null && !jsonObj.get("routes").isJsonNull()) { - JsonArray jsonArrayroutes = jsonObj.getAsJsonArray("routes"); - if (jsonArrayroutes != null) { - // ensure the json data is an array - if (!jsonObj.get("routes").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `routes` to be an array in the JSON string but got `%s`", - jsonObj.get("routes").toString())); - } - - // validate the optional field `routes` (array) - for (int i = 0; i < jsonArrayroutes.size(); i++) { - Route.validateJsonElement(jsonArrayroutes.get(i)); - } - ; - } - } - if (!jsonObj.get("transferNetwork").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transferNetwork` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("transferNetwork").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AreaConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AreaConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AreaConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AreaConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AreaConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AreaConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of AreaConfig - * @throws IOException if the JSON string is invalid with respect to AreaConfig - */ - public static AreaConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AreaConfig.class); - } - - /** - * Convert an instance of AreaConfig 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/model/AreaId.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaId.java index 51dd31d5..293d999c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaId.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaId.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -30,7 +30,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class AreaId extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(AreaId.class.getName()); @@ -95,6 +95,7 @@ public AreaId read(JsonReader in) throws IOException { // 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); @@ -110,6 +111,7 @@ public AreaId read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( + java.util.Locale.ROOT, "Deserialization for StaticAreaID failed with `%s`.", e.getMessage())); log.log( @@ -126,8 +128,11 @@ public AreaId read(JsonReader in) throws IOException { throw new IOException( String.format( + java.util.Locale.ROOT, "Failed deserialization for AreaId: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, errorMessages, jsonElement.toString())); + match, + errorMessages, + jsonElement.toString())); } }.nullSafe(); } @@ -225,7 +230,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti validCount++; } catch (Exception e) { errorMessages.add( - String.format("Deserialization for UUID failed with `%s`.", e.getMessage())); + String.format( + java.util.Locale.ROOT, + "Deserialization for UUID failed with `%s`.", + e.getMessage())); // continue to the next one } // validate the json string with StaticAreaID @@ -235,14 +243,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for StaticAreaID failed with `%s`.", e.getMessage())); + java.util.Locale.ROOT, + "Deserialization for StaticAreaID 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 AreaId with oneOf schemas: StaticAreaID, UUID. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, errorMessages, jsonElement.toString())); + validCount, + errorMessages, + jsonElement.toString())); } } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaPrefixConfigIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaPrefixConfigIPv4.java deleted file mode 100644 index c8228ee4..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaPrefixConfigIPv4.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * IaaS-API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 1 - * 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.model; - -import cloud.stackit.sdk.iaas.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.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The IPv4 prefix config for a network area. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class AreaPrefixConfigIPv4 { - public static final String SERIALIZED_NAME_DEFAULT_PREFIX_LEN = "defaultPrefixLen"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_PREFIX_LEN) - @javax.annotation.Nullable private Integer defaultPrefixLen = 25; - - public static final String SERIALIZED_NAME_MAX_PREFIX_LEN = "maxPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MAX_PREFIX_LEN) - @javax.annotation.Nullable private Integer maxPrefixLen = 29; - - public static final String SERIALIZED_NAME_MIN_PREFIX_LEN = "minPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MIN_PREFIX_LEN) - @javax.annotation.Nullable private Integer minPrefixLen = 24; - - public AreaPrefixConfigIPv4() {} - - public AreaPrefixConfigIPv4 defaultPrefixLen( - @javax.annotation.Nullable Integer defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - return this; - } - - /** - * The default prefix length for networks in the network area. minimum: 24 maximum: 29 - * - * @return defaultPrefixLen - */ - @javax.annotation.Nullable public Integer getDefaultPrefixLen() { - return defaultPrefixLen; - } - - public void setDefaultPrefixLen(@javax.annotation.Nullable Integer defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - } - - public AreaPrefixConfigIPv4 maxPrefixLen(@javax.annotation.Nullable Integer maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - return this; - } - - /** - * The maximal prefix length for networks in the network area. minimum: 24 maximum: 29 - * - * @return maxPrefixLen - */ - @javax.annotation.Nullable public Integer getMaxPrefixLen() { - return maxPrefixLen; - } - - public void setMaxPrefixLen(@javax.annotation.Nullable Integer maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - } - - public AreaPrefixConfigIPv4 minPrefixLen(@javax.annotation.Nullable Integer minPrefixLen) { - this.minPrefixLen = minPrefixLen; - return this; - } - - /** - * The minimal prefix length for networks in the network area. minimum: 8 maximum: 29 - * - * @return minPrefixLen - */ - @javax.annotation.Nullable public Integer getMinPrefixLen() { - return minPrefixLen; - } - - public void setMinPrefixLen(@javax.annotation.Nullable Integer minPrefixLen) { - this.minPrefixLen = minPrefixLen; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AreaPrefixConfigIPv4 areaPrefixConfigIPv4 = (AreaPrefixConfigIPv4) o; - return Objects.equals(this.defaultPrefixLen, areaPrefixConfigIPv4.defaultPrefixLen) - && Objects.equals(this.maxPrefixLen, areaPrefixConfigIPv4.maxPrefixLen) - && Objects.equals(this.minPrefixLen, areaPrefixConfigIPv4.minPrefixLen); - } - - @Override - public int hashCode() { - return Objects.hash(defaultPrefixLen, maxPrefixLen, minPrefixLen); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AreaPrefixConfigIPv4 {\n"); - sb.append(" defaultPrefixLen: ").append(toIndentedString(defaultPrefixLen)).append("\n"); - sb.append(" maxPrefixLen: ").append(toIndentedString(maxPrefixLen)).append("\n"); - sb.append(" minPrefixLen: ").append(toIndentedString(minPrefixLen)).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("defaultPrefixLen", "maxPrefixLen", "minPrefixLen")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AreaPrefixConfigIPv4 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AreaPrefixConfigIPv4.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AreaPrefixConfigIPv4 is not found in the empty JSON string", - AreaPrefixConfigIPv4.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AreaPrefixConfigIPv4.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `AreaPrefixConfigIPv4` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AreaPrefixConfigIPv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AreaPrefixConfigIPv4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AreaPrefixConfigIPv4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AreaPrefixConfigIPv4 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AreaPrefixConfigIPv4 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AreaPrefixConfigIPv4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of AreaPrefixConfigIPv4 - * @throws IOException if the JSON string is invalid with respect to AreaPrefixConfigIPv4 - */ - public static AreaPrefixConfigIPv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AreaPrefixConfigIPv4.class); - } - - /** - * Convert an instance of AreaPrefixConfigIPv4 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/model/AvailabilityZoneListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AvailabilityZoneListResponse.java index 0d5586ff..67829cbb 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AvailabilityZoneListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AvailabilityZoneListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,16 +25,16 @@ 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; -import java.util.Set; /** Availability Zone list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class AvailabilityZoneListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -71,6 +71,50 @@ 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 AvailabilityZoneListResponse instance itself + */ + public AvailabilityZoneListResponse 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) { @@ -81,12 +125,15 @@ public boolean equals(Object o) { } AvailabilityZoneListResponse availabilityZoneListResponse = (AvailabilityZoneListResponse) o; - return Objects.equals(this.items, availabilityZoneListResponse.items); + return Objects.equals(this.items, availabilityZoneListResponse.items) + && Objects.equals( + this.additionalProperties, + availabilityZoneListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +141,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AvailabilityZoneListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -133,29 +183,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in AvailabilityZoneListResponse is not found in the empty JSON string", AvailabilityZoneListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AvailabilityZoneListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `AvailabilityZoneListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AvailabilityZoneListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -166,6 +208,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } else 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())); } @@ -190,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, AvailabilityZoneListResponse 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); } @@ -197,7 +264,42 @@ public void write(JsonWriter out, AvailabilityZoneListResponse value) public AvailabilityZoneListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AvailabilityZoneListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Backup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Backup.java index 20a1f0f8..6e904d54 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Backup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Backup.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,16 +25,17 @@ 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.Set; import java.util.UUID; /** Object that represents a backup. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Backup { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -46,6 +47,16 @@ public class Backup { @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_ENCRYPTED = "encrypted"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED) + @javax.annotation.Nullable private Boolean encrypted; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -91,6 +102,7 @@ public Backup() {} public Backup( String availabilityZone, OffsetDateTime createdAt, + Boolean encrypted, UUID id, Long size, UUID snapshotId, @@ -100,6 +112,7 @@ public Backup( this(); this.availabilityZone = availabilityZone; this.createdAt = createdAt; + this.encrypted = encrypted; this.id = id; this.size = size; this.snapshotId = snapshotId; @@ -126,6 +139,33 @@ public Backup( return createdAt; } + public Backup 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; + } + + /** + * Indicates if a volume is encrypted. + * + * @return encrypted + */ + @javax.annotation.Nullable public Boolean getEncrypted() { + return encrypted; + } + /** * Universally Unique Identifier (UUID). * @@ -144,7 +184,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -220,6 +261,50 @@ public void setName(@javax.annotation.Nullable String name) { return volumeId; } + /** + * 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 Backup instance itself + */ + public Backup 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) { @@ -231,6 +316,8 @@ public boolean equals(Object o) { Backup backup = (Backup) o; return Objects.equals(this.availabilityZone, backup.availabilityZone) && Objects.equals(this.createdAt, backup.createdAt) + && Objects.equals(this.description, backup.description) + && Objects.equals(this.encrypted, backup.encrypted) && Objects.equals(this.id, backup.id) && Objects.equals(this.labels, backup.labels) && Objects.equals(this.name, backup.name) @@ -238,7 +325,8 @@ public boolean equals(Object o) { && Objects.equals(this.snapshotId, backup.snapshotId) && Objects.equals(this.status, backup.status) && Objects.equals(this.updatedAt, backup.updatedAt) - && Objects.equals(this.volumeId, backup.volumeId); + && Objects.equals(this.volumeId, backup.volumeId) + && Objects.equals(this.additionalProperties, backup.additionalProperties); } @Override @@ -246,6 +334,8 @@ public int hashCode() { return Objects.hash( availabilityZone, createdAt, + description, + encrypted, id, labels, name, @@ -253,7 +343,8 @@ public int hashCode() { snapshotId, status, updatedAt, - volumeId); + volumeId, + additionalProperties); } @Override @@ -262,6 +353,8 @@ public String toString() { sb.append("class Backup {\n"); sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" encrypted: ").append(toIndentedString(encrypted)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -270,6 +363,9 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" volumeId: ").append(toIndentedString(volumeId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -295,6 +391,8 @@ private String toIndentedString(Object o) { Arrays.asList( "availabilityZone", "createdAt", + "description", + "encrypted", "id", "labels", "name", @@ -320,34 +418,34 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Backup is not found in the empty JSON string", Backup.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Backup.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Backup` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("availabilityZone") != null && !jsonObj.get("availabilityZone").isJsonNull()) && !jsonObj.get("availabilityZone").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `availabilityZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("availabilityZone").toString())); } + 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") != 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())); } @@ -355,6 +453,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -362,6 +461,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("snapshotId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `snapshotId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("snapshotId").toString())); } @@ -369,6 +469,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -376,6 +477,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("volumeId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeId").toString())); } @@ -397,6 +499,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Backup 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); } @@ -404,7 +530,41 @@ public void write(JsonWriter out, Backup value) throws IOException { public Backup read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Backup 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupListResponse.java index 4ec0e37d..780981ff 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Backup list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class BackupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 BackupListResponse instance itself + */ + public BackupListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } BackupListResponse backupListResponse = (BackupListResponse) o; - return Objects.equals(this.items, backupListResponse.items); + return Objects.equals(this.items, backupListResponse.items) + && Objects.equals( + this.additionalProperties, backupListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BackupListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in BackupListResponse is not found in the empty JSON string", BackupListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BackupListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `BackupListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : BackupListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -191,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, BackupListResponse 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); } @@ -198,7 +264,41 @@ public void write(JsonWriter out, BackupListResponse value) public BackupListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BackupListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupSource.java index 05a5d9cd..147d3971 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupSource.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,17 @@ 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; -import java.util.Set; import java.util.UUID; /** The source object of a backup. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class BackupSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -87,6 +88,50 @@ 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 BackupSource instance itself + */ + public BackupSource 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) { @@ -97,12 +142,13 @@ public boolean equals(Object o) { } BackupSource backupSource = (BackupSource) o; return Objects.equals(this.id, backupSource.id) - && Objects.equals(this.type, backupSource.type); + && Objects.equals(this.type, backupSource.type) + && Objects.equals(this.additionalProperties, backupSource.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, type); + return Objects.hash(id, type, additionalProperties); } @Override @@ -111,6 +157,9 @@ public String toString() { sb.append("class BackupSource {\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(); } @@ -149,41 +198,35 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in BackupSource is not found in the empty JSON string", BackupSource.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BackupSource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `BackupSource` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : BackupSource.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); 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())); } 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())); } @@ -205,6 +248,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, BackupSource 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); } @@ -212,7 +279,41 @@ public void write(JsonWriter out, BackupSource value) throws IOException { public BackupSource read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BackupSource 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BaseSecurityGroupRule.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BaseSecurityGroupRule.java index b140f153..33d8da6f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BaseSecurityGroupRule.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BaseSecurityGroupRule.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,16 +25,17 @@ 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.Set; import java.util.UUID; /** The base schema for a security group rule. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class BaseSecurityGroupRule { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -270,6 +271,50 @@ public void setRemoteSecurityGroupId(@javax.annotation.Nullable UUID remoteSecur 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 BaseSecurityGroupRule instance itself + */ + public BaseSecurityGroupRule 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) { @@ -290,7 +335,9 @@ public boolean equals(Object o) { && Objects.equals( this.remoteSecurityGroupId, baseSecurityGroupRule.remoteSecurityGroupId) && Objects.equals(this.securityGroupId, baseSecurityGroupRule.securityGroupId) - && Objects.equals(this.updatedAt, baseSecurityGroupRule.updatedAt); + && Objects.equals(this.updatedAt, baseSecurityGroupRule.updatedAt) + && Objects.equals( + this.additionalProperties, baseSecurityGroupRule.additionalProperties); } @Override @@ -306,7 +353,8 @@ public int hashCode() { portRange, remoteSecurityGroupId, securityGroupId, - updatedAt); + updatedAt, + additionalProperties); } @Override @@ -326,6 +374,9 @@ public String toString() { .append("\n"); sb.append(" securityGroupId: ").append(toIndentedString(securityGroupId)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -377,29 +428,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in BaseSecurityGroupRule is not found in the empty JSON string", BaseSecurityGroupRule.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BaseSecurityGroupRule.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `BaseSecurityGroupRule` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : BaseSecurityGroupRule.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -407,12 +450,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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("direction").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `direction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("direction").toString())); } @@ -420,6 +465,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -431,6 +477,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -438,6 +485,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ipRange").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ipRange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipRange").toString())); } @@ -450,6 +498,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("remoteSecurityGroupId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `remoteSecurityGroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteSecurityGroupId").toString())); } @@ -457,6 +506,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("securityGroupId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `securityGroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("securityGroupId").toString())); } @@ -479,6 +529,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, BaseSecurityGroupRule 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); } @@ -486,7 +560,41 @@ public void write(JsonWriter out, BaseSecurityGroupRule value) public BaseSecurityGroupRule read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BaseSecurityGroupRule 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolume.java index 6da5095e..d559bff6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolume.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolume.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,17 @@ 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; -import java.util.Set; import java.util.UUID; /** The boot device for the server. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class BootVolume { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -148,6 +149,50 @@ public void setSource(@javax.annotation.Nullable BootVolumeSource 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 BootVolume instance itself + */ + public BootVolume 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) { @@ -161,12 +206,14 @@ public boolean equals(Object o) { && Objects.equals(this.id, bootVolume.id) && Objects.equals(this.performanceClass, bootVolume.performanceClass) && Objects.equals(this.size, bootVolume.size) - && Objects.equals(this.source, bootVolume.source); + && Objects.equals(this.source, bootVolume.source) + && Objects.equals(this.additionalProperties, bootVolume.additionalProperties); } @Override public int hashCode() { - return Objects.hash(deleteOnTermination, id, performanceClass, size, source); + return Objects.hash( + deleteOnTermination, id, performanceClass, size, source, additionalProperties); } @Override @@ -180,6 +227,9 @@ public String toString() { sb.append(" performanceClass: ").append(toIndentedString(performanceClass)).append("\n"); sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -221,26 +271,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in BootVolume is not found in the empty JSON string", BootVolume.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BootVolume.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `BootVolume` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); 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())); } @@ -249,6 +290,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -274,6 +316,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, BootVolume 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); } @@ -281,7 +347,41 @@ public void write(JsonWriter out, BootVolume value) throws IOException { public BootVolume read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BootVolume 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolumeSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolumeSource.java index ddd332d0..29541640 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolumeSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolumeSource.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,17 @@ 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; -import java.util.Set; import java.util.UUID; /** The source object of a boot volume. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class BootVolumeSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -87,6 +88,50 @@ 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 BootVolumeSource instance itself + */ + public BootVolumeSource 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) { @@ -97,12 +142,13 @@ public boolean equals(Object o) { } BootVolumeSource bootVolumeSource = (BootVolumeSource) o; return Objects.equals(this.id, bootVolumeSource.id) - && Objects.equals(this.type, bootVolumeSource.type); + && Objects.equals(this.type, bootVolumeSource.type) + && Objects.equals(this.additionalProperties, bootVolumeSource.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, type); + return Objects.hash(id, type, additionalProperties); } @Override @@ -111,6 +157,9 @@ public String toString() { sb.append("class BootVolumeSource {\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(); } @@ -149,41 +198,35 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in BootVolumeSource is not found in the empty JSON string", BootVolumeSource.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BootVolumeSource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `BootVolumeSource` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : BootVolumeSource.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); 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())); } 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())); } @@ -206,6 +249,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, BootVolumeSource 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); } @@ -213,7 +280,41 @@ public void write(JsonWriter out, BootVolumeSource value) public BootVolumeSource read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BootVolumeSource 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAffinityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAffinityGroupPayload.java index 8c5d2541..ab09a8b4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAffinityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAffinityGroupPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,17 +25,17 @@ 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; -import java.util.Set; import java.util.UUID; /** Definition of an affinity group. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateAffinityGroupPayload { public static final String SERIALIZED_NAME_ID = "id"; @@ -129,6 +129,50 @@ public void setPolicy(@javax.annotation.Nonnull String policy) { this.policy = policy; } + /** + * 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 CreateAffinityGroupPayload instance itself + */ + public CreateAffinityGroupPayload 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) { @@ -141,12 +185,14 @@ public boolean equals(Object o) { return Objects.equals(this.id, createAffinityGroupPayload.id) && Objects.equals(this.members, createAffinityGroupPayload.members) && Objects.equals(this.name, createAffinityGroupPayload.name) - && Objects.equals(this.policy, createAffinityGroupPayload.policy); + && Objects.equals(this.policy, createAffinityGroupPayload.policy) + && Objects.equals( + this.additionalProperties, createAffinityGroupPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, members, name, policy); + return Objects.hash(id, members, name, policy, additionalProperties); } @Override @@ -157,6 +203,9 @@ public String toString() { sb.append(" members: ").append(toIndentedString(members)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" policy: ").append(toIndentedString(policy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -195,29 +244,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateAffinityGroupPayload is not found in the empty JSON string", CreateAffinityGroupPayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateAffinityGroupPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateAffinityGroupPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateAffinityGroupPayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -225,6 +266,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -234,18 +276,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("members").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `members` to be an array in the JSON string but got `%s`", jsonObj.get("members").toString())); } 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("policy").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `policy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("policy").toString())); } @@ -269,6 +314,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateAffinityGroupPayload 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); } @@ -276,7 +345,41 @@ public void write(JsonWriter out, CreateAffinityGroupPayload value) public CreateAffinityGroupPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateAffinityGroupPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAreaAddressFamily.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAreaAddressFamily.java deleted file mode 100644 index 8098ad6b..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAreaAddressFamily.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * IaaS-API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 1 - * 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.model; - -import cloud.stackit.sdk.iaas.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.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The addressFamily object for a area create request. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class CreateAreaAddressFamily { - public static final String SERIALIZED_NAME_IPV4 = "ipv4"; - - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private CreateAreaIPv4 ipv4; - - public CreateAreaAddressFamily() {} - - public CreateAreaAddressFamily ipv4(@javax.annotation.Nullable CreateAreaIPv4 ipv4) { - this.ipv4 = ipv4; - return this; - } - - /** - * Get ipv4 - * - * @return ipv4 - */ - @javax.annotation.Nullable public CreateAreaIPv4 getIpv4() { - return ipv4; - } - - public void setIpv4(@javax.annotation.Nullable CreateAreaIPv4 ipv4) { - this.ipv4 = ipv4; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateAreaAddressFamily createAreaAddressFamily = (CreateAreaAddressFamily) o; - return Objects.equals(this.ipv4, createAreaAddressFamily.ipv4); - } - - @Override - public int hashCode() { - return Objects.hash(ipv4); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateAreaAddressFamily {\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).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("ipv4")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateAreaAddressFamily - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateAreaAddressFamily.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateAreaAddressFamily is not found in the empty JSON string", - CreateAreaAddressFamily.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateAreaAddressFamily.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateAreaAddressFamily` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `ipv4` - if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - CreateAreaIPv4.validateJsonElement(jsonObj.get("ipv4")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateAreaAddressFamily.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateAreaAddressFamily' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateAreaAddressFamily.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateAreaAddressFamily value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateAreaAddressFamily read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateAreaAddressFamily given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateAreaAddressFamily - * @throws IOException if the JSON string is invalid with respect to CreateAreaAddressFamily - */ - public static CreateAreaAddressFamily fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateAreaAddressFamily.class); - } - - /** - * Convert an instance of CreateAreaAddressFamily 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/model/CreateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateBackupPayload.java index 519b5579..aac4c8b7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateBackupPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,22 @@ 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; -import java.util.Set; /** Object that represents a backup create request body. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateBackupPayload { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_LABELS = "labels"; @SerializedName(SERIALIZED_NAME_LABELS) @@ -52,6 +58,24 @@ public class CreateBackupPayload { public CreateBackupPayload() {} + public CreateBackupPayload 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 CreateBackupPayload labels(@javax.annotation.Nullable Object labels) { this.labels = labels; return this; @@ -61,7 +85,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -110,6 +135,50 @@ public void setSource(@javax.annotation.Nonnull BackupSource 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 CreateBackupPayload instance itself + */ + public CreateBackupPayload 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) { @@ -119,23 +188,30 @@ public boolean equals(Object o) { return false; } CreateBackupPayload createBackupPayload = (CreateBackupPayload) o; - return Objects.equals(this.labels, createBackupPayload.labels) + return Objects.equals(this.description, createBackupPayload.description) + && Objects.equals(this.labels, createBackupPayload.labels) && Objects.equals(this.name, createBackupPayload.name) - && Objects.equals(this.source, createBackupPayload.source); + && Objects.equals(this.source, createBackupPayload.source) + && Objects.equals( + this.additionalProperties, createBackupPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(labels, name, source); + return Objects.hash(description, labels, name, source, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateBackupPayload {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -156,7 +232,8 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("labels", "name", "source")); + openapiFields = + new HashSet(Arrays.asList("description", "labels", "name", "source")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("source")); @@ -174,36 +251,37 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateBackupPayload is not found in the empty JSON string", CreateBackupPayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateBackupPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateBackupPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateBackupPayload.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())); + 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())); + } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !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())); } @@ -228,6 +306,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateBackupPayload 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); } @@ -235,7 +337,41 @@ public void write(JsonWriter out, CreateBackupPayload value) public CreateBackupPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateBackupPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateImagePayload.java index b065977d..764c7b32 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateImagePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,10 +25,11 @@ 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.Set; import java.util.UUID; /** @@ -36,7 +37,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateImagePayload { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -69,6 +70,11 @@ public class CreateImagePayload { @SerializedName(SERIALIZED_NAME_ID) @javax.annotation.Nullable private UUID id; + public static final String SERIALIZED_NAME_IMPORT_PROGRESS = "importProgress"; + + @SerializedName(SERIALIZED_NAME_IMPORT_PROGRESS) + @javax.annotation.Nullable private Long importProgress; + public static final String SERIALIZED_NAME_LABELS = "labels"; @SerializedName(SERIALIZED_NAME_LABELS) @@ -126,6 +132,7 @@ public CreateImagePayload( ImageChecksum checksum, OffsetDateTime createdAt, UUID id, + Long importProgress, UUID owner, String scope, Long size, @@ -135,6 +142,7 @@ public CreateImagePayload( this.checksum = checksum; this.createdAt = createdAt; this.id = id; + this.importProgress = importProgress; this.owner = owner; this.scope = scope; this.size = size; @@ -225,6 +233,15 @@ public void setDiskFormat(@javax.annotation.Nonnull String diskFormat) { return id; } + /** + * Indicates Image Import Progress in percent. + * + * @return importProgress + */ + @javax.annotation.Nullable public Long getImportProgress() { + return importProgress; + } + public CreateImagePayload labels(@javax.annotation.Nullable Object labels) { this.labels = labels; return this; @@ -234,7 +251,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -366,6 +384,50 @@ public void setProtected(@javax.annotation.Nullable Boolean _protected) { 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 CreateImagePayload instance itself + */ + public CreateImagePayload 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) { @@ -381,6 +443,7 @@ public boolean equals(Object o) { && Objects.equals(this.createdAt, createImagePayload.createdAt) && Objects.equals(this.diskFormat, createImagePayload.diskFormat) && Objects.equals(this.id, createImagePayload.id) + && Objects.equals(this.importProgress, createImagePayload.importProgress) && Objects.equals(this.labels, createImagePayload.labels) && Objects.equals(this.minDiskSize, createImagePayload.minDiskSize) && Objects.equals(this.minRam, createImagePayload.minRam) @@ -390,7 +453,9 @@ public boolean equals(Object o) { && Objects.equals(this.scope, createImagePayload.scope) && Objects.equals(this.size, createImagePayload.size) && Objects.equals(this.status, createImagePayload.status) - && Objects.equals(this.updatedAt, createImagePayload.updatedAt); + && Objects.equals(this.updatedAt, createImagePayload.updatedAt) + && Objects.equals( + this.additionalProperties, createImagePayload.additionalProperties); } @Override @@ -402,6 +467,7 @@ public int hashCode() { createdAt, diskFormat, id, + importProgress, labels, minDiskSize, minRam, @@ -411,7 +477,8 @@ public int hashCode() { scope, size, status, - updatedAt); + updatedAt, + additionalProperties); } @Override @@ -424,6 +491,7 @@ public String toString() { sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" diskFormat: ").append(toIndentedString(diskFormat)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" importProgress: ").append(toIndentedString(importProgress)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" minDiskSize: ").append(toIndentedString(minDiskSize)).append("\n"); sb.append(" minRam: ").append(toIndentedString(minRam)).append("\n"); @@ -434,6 +502,9 @@ public String toString() { sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -463,6 +534,7 @@ private String toIndentedString(Object o) { "createdAt", "diskFormat", "id", + "importProgress", "labels", "minDiskSize", "minRam", @@ -490,29 +562,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateImagePayload is not found in the empty JSON string", CreateImagePayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateImagePayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateImagePayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateImagePayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -531,6 +595,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("diskFormat").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `diskFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("diskFormat").toString())); } @@ -538,12 +603,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -551,6 +618,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("owner").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `owner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner").toString())); } @@ -558,6 +626,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("scope").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); } @@ -565,6 +634,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -587,6 +657,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateImagePayload 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); } @@ -594,7 +688,41 @@ public void write(JsonWriter out, CreateImagePayload value) public CreateImagePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateImagePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateIsolatedNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateIsolatedNetworkPayload.java new file mode 100644 index 00000000..b0a6512d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateIsolatedNetworkPayload.java @@ -0,0 +1,398 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 request body for a single isolated network create. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class CreateIsolatedNetworkPayload { + public static final String SERIALIZED_NAME_DHCP = "dhcp"; + + @SerializedName(SERIALIZED_NAME_DHCP) + @javax.annotation.Nullable private Boolean dhcp = true; + + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private CreateNetworkIPv4 ipv4; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public CreateIsolatedNetworkPayload() {} + + public CreateIsolatedNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { + this.dhcp = dhcp; + return this; + } + + /** + * Enable or disable DHCP for a network. + * + * @return dhcp + */ + @javax.annotation.Nullable public Boolean getDhcp() { + return dhcp; + } + + public void setDhcp(@javax.annotation.Nullable Boolean dhcp) { + this.dhcp = dhcp; + } + + public CreateIsolatedNetworkPayload ipv4(@javax.annotation.Nullable CreateNetworkIPv4 ipv4) { + this.ipv4 = ipv4; + return this; + } + + /** + * Get ipv4 + * + * @return ipv4 + */ + @javax.annotation.Nullable public CreateNetworkIPv4 getIpv4() { + return ipv4; + } + + public void setIpv4(@javax.annotation.Nullable CreateNetworkIPv4 ipv4) { + this.ipv4 = ipv4; + } + + public CreateIsolatedNetworkPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * 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. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public CreateIsolatedNetworkPayload 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; + } + + /** + * 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 CreateIsolatedNetworkPayload instance itself + */ + public CreateIsolatedNetworkPayload 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; + } + CreateIsolatedNetworkPayload createIsolatedNetworkPayload = + (CreateIsolatedNetworkPayload) o; + return Objects.equals(this.dhcp, createIsolatedNetworkPayload.dhcp) + && Objects.equals(this.ipv4, createIsolatedNetworkPayload.ipv4) + && Objects.equals(this.labels, createIsolatedNetworkPayload.labels) + && Objects.equals(this.name, createIsolatedNetworkPayload.name) + && Objects.equals( + this.additionalProperties, + createIsolatedNetworkPayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dhcp, ipv4, labels, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateIsolatedNetworkPayload {\n"); + sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); + sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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("dhcp", "ipv4", "labels", "name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 + * CreateIsolatedNetworkPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateIsolatedNetworkPayload.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 CreateIsolatedNetworkPayload is not found in the empty JSON string", + CreateIsolatedNetworkPayload.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateIsolatedNetworkPayload.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 `ipv4` + if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { + CreateNetworkIPv4.validateJsonElement(jsonObj.get("ipv4")); + } + 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateIsolatedNetworkPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateIsolatedNetworkPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateIsolatedNetworkPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateIsolatedNetworkPayload 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 CreateIsolatedNetworkPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateIsolatedNetworkPayload 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 CreateIsolatedNetworkPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateIsolatedNetworkPayload + * @throws IOException if the JSON string is invalid with respect to + * CreateIsolatedNetworkPayload + */ + public static CreateIsolatedNetworkPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateIsolatedNetworkPayload.class); + } + + /** + * Convert an instance of CreateIsolatedNetworkPayload 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/model/CreateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateKeyPairPayload.java index d7080810..12d11eda 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateKeyPairPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,15 +25,16 @@ 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.Set; /** Object that represents the public key of an SSH keypair and its name. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateKeyPairPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -103,7 +104,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -162,6 +164,50 @@ public void setPublicKey(@javax.annotation.Nonnull String publicKey) { 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 CreateKeyPairPayload instance itself + */ + public CreateKeyPairPayload 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) { @@ -176,12 +222,15 @@ public boolean equals(Object o) { && Objects.equals(this.labels, createKeyPairPayload.labels) && Objects.equals(this.name, createKeyPairPayload.name) && Objects.equals(this.publicKey, createKeyPairPayload.publicKey) - && Objects.equals(this.updatedAt, createKeyPairPayload.updatedAt); + && Objects.equals(this.updatedAt, createKeyPairPayload.updatedAt) + && Objects.equals( + this.additionalProperties, createKeyPairPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(createdAt, fingerprint, labels, name, publicKey, updatedAt); + return Objects.hash( + createdAt, fingerprint, labels, name, publicKey, updatedAt, additionalProperties); } @Override @@ -194,6 +243,9 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -240,29 +292,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateKeyPairPayload is not found in the empty JSON string", CreateKeyPairPayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateKeyPairPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateKeyPairPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateKeyPairPayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -270,6 +314,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("fingerprint").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); } @@ -277,12 +322,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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("publicKey").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); } @@ -305,6 +352,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateKeyPairPayload 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); } @@ -312,7 +383,41 @@ public void write(JsonWriter out, CreateKeyPairPayload value) public CreateKeyPairPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateKeyPairPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAddressFamily.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAddressFamily.java deleted file mode 100644 index 4f7ec7a0..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAddressFamily.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * IaaS-API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 1 - * 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.model; - -import cloud.stackit.sdk.iaas.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.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The addressFamily object for a network create request. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class CreateNetworkAddressFamily { - public static final String SERIALIZED_NAME_IPV4 = "ipv4"; - - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private CreateNetworkIPv4Body ipv4; - - public static final String SERIALIZED_NAME_IPV6 = "ipv6"; - - @SerializedName(SERIALIZED_NAME_IPV6) - @javax.annotation.Nullable private CreateNetworkIPv6Body ipv6; - - public CreateNetworkAddressFamily() {} - - public CreateNetworkAddressFamily ipv4(@javax.annotation.Nullable CreateNetworkIPv4Body ipv4) { - this.ipv4 = ipv4; - return this; - } - - /** - * Get ipv4 - * - * @return ipv4 - */ - @javax.annotation.Nullable public CreateNetworkIPv4Body getIpv4() { - return ipv4; - } - - public void setIpv4(@javax.annotation.Nullable CreateNetworkIPv4Body ipv4) { - this.ipv4 = ipv4; - } - - public CreateNetworkAddressFamily ipv6(@javax.annotation.Nullable CreateNetworkIPv6Body ipv6) { - this.ipv6 = ipv6; - return this; - } - - /** - * Get ipv6 - * - * @return ipv6 - */ - @javax.annotation.Nullable public CreateNetworkIPv6Body getIpv6() { - return ipv6; - } - - public void setIpv6(@javax.annotation.Nullable CreateNetworkIPv6Body ipv6) { - this.ipv6 = ipv6; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateNetworkAddressFamily createNetworkAddressFamily = (CreateNetworkAddressFamily) o; - return Objects.equals(this.ipv4, createNetworkAddressFamily.ipv4) - && Objects.equals(this.ipv6, createNetworkAddressFamily.ipv6); - } - - @Override - public int hashCode() { - return Objects.hash(ipv4, ipv6); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateNetworkAddressFamily {\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); - sb.append(" ipv6: ").append(toIndentedString(ipv6)).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("ipv4", "ipv6")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateNetworkAddressFamily - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateNetworkAddressFamily.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateNetworkAddressFamily is not found in the empty JSON string", - CreateNetworkAddressFamily.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateNetworkAddressFamily.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateNetworkAddressFamily` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `ipv4` - if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - CreateNetworkIPv4Body.validateJsonElement(jsonObj.get("ipv4")); - } - // validate the optional field `ipv6` - if (jsonObj.get("ipv6") != null && !jsonObj.get("ipv6").isJsonNull()) { - CreateNetworkIPv6Body.validateJsonElement(jsonObj.get("ipv6")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateNetworkAddressFamily.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateNetworkAddressFamily' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkAddressFamily.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateNetworkAddressFamily value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateNetworkAddressFamily read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateNetworkAddressFamily given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateNetworkAddressFamily - * @throws IOException if the JSON string is invalid with respect to CreateNetworkAddressFamily - */ - public static CreateNetworkAddressFamily fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateNetworkAddressFamily.class); - } - - /** - * Convert an instance of CreateNetworkAddressFamily 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/model/CreateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaPayload.java index 532224cd..1c71ab16 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,22 +24,17 @@ 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; -import java.util.Set; -/** CreateNetworkAreaPayload */ +/** Object that represents the network area create request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateNetworkAreaPayload { - public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "addressFamily"; - - @SerializedName(SERIALIZED_NAME_ADDRESS_FAMILY) - @javax.annotation.Nonnull - private CreateAreaAddressFamily addressFamily; - public static final String SERIALIZED_NAME_LABELS = "labels"; @SerializedName(SERIALIZED_NAME_LABELS) @@ -53,26 +48,6 @@ public class CreateNetworkAreaPayload { public CreateNetworkAreaPayload() {} - public CreateNetworkAreaPayload addressFamily( - @javax.annotation.Nonnull CreateAreaAddressFamily addressFamily) { - this.addressFamily = addressFamily; - return this; - } - - /** - * Get addressFamily - * - * @return addressFamily - */ - @javax.annotation.Nonnull - public CreateAreaAddressFamily getAddressFamily() { - return addressFamily; - } - - public void setAddressFamily(@javax.annotation.Nonnull CreateAreaAddressFamily addressFamily) { - this.addressFamily = addressFamily; - } - public CreateNetworkAreaPayload labels(@javax.annotation.Nullable Object labels) { this.labels = labels; return this; @@ -82,7 +57,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -100,7 +76,7 @@ public CreateNetworkAreaPayload name(@javax.annotation.Nonnull String name) { } /** - * The name for a General Object. Matches Names and also UUIDs. + * Get name * * @return name */ @@ -113,6 +89,50 @@ public void setName(@javax.annotation.Nonnull String name) { this.name = name; } + /** + * 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 CreateNetworkAreaPayload instance itself + */ + public CreateNetworkAreaPayload 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) { @@ -122,23 +142,26 @@ public boolean equals(Object o) { return false; } CreateNetworkAreaPayload createNetworkAreaPayload = (CreateNetworkAreaPayload) o; - return Objects.equals(this.addressFamily, createNetworkAreaPayload.addressFamily) - && Objects.equals(this.labels, createNetworkAreaPayload.labels) - && Objects.equals(this.name, createNetworkAreaPayload.name); + return Objects.equals(this.labels, createNetworkAreaPayload.labels) + && Objects.equals(this.name, createNetworkAreaPayload.name) + && Objects.equals( + this.additionalProperties, createNetworkAreaPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(addressFamily, labels, name); + return Objects.hash(labels, name, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNetworkAreaPayload {\n"); - sb.append(" addressFamily: ").append(toIndentedString(addressFamily)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -159,10 +182,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("addressFamily", "labels", "name")); + openapiFields = new HashSet(Arrays.asList("labels", "name")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("addressFamily", "name")); + openapiRequiredFields = new HashSet(Arrays.asList("name")); } /** @@ -177,37 +200,28 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateNetworkAreaPayload is not found in the empty JSON string", CreateNetworkAreaPayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateNetworkAreaPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateNetworkAreaPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateNetworkAreaPayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `addressFamily` - CreateAreaAddressFamily.validateJsonElement(jsonObj.get("addressFamily")); 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())); } @@ -231,6 +245,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateNetworkAreaPayload 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); } @@ -238,7 +276,41 @@ public void write(JsonWriter out, CreateNetworkAreaPayload value) public CreateNetworkAreaPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNetworkAreaPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRangePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRangePayload.java index fb7bd2ae..9073631e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRangePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRangePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** CreateNetworkAreaRangePayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateNetworkAreaRangePayload { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -70,6 +70,50 @@ public void setIpv4(@javax.annotation.Nullable List ipv4) { this.ipv4 = ipv4; } + /** + * 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 CreateNetworkAreaRangePayload instance itself + */ + public CreateNetworkAreaRangePayload 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) { @@ -80,12 +124,15 @@ public boolean equals(Object o) { } CreateNetworkAreaRangePayload createNetworkAreaRangePayload = (CreateNetworkAreaRangePayload) o; - return Objects.equals(this.ipv4, createNetworkAreaRangePayload.ipv4); + return Objects.equals(this.ipv4, createNetworkAreaRangePayload.ipv4) + && Objects.equals( + this.additionalProperties, + createNetworkAreaRangePayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(ipv4); + return Objects.hash(ipv4, additionalProperties); } @Override @@ -93,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNetworkAreaRangePayload {\n"); sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,21 +182,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateNetworkAreaRangePayload is not found in the empty JSON string", CreateNetworkAreaRangePayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateNetworkAreaRangePayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateNetworkAreaRangePayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { JsonArray jsonArrayipv4 = jsonObj.getAsJsonArray("ipv4"); @@ -155,6 +195,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("ipv4").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ipv4` to be an array in the JSON string but got `%s`", jsonObj.get("ipv4").toString())); } @@ -187,6 +228,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateNetworkAreaRangePayload 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); } @@ -195,7 +260,42 @@ public CreateNetworkAreaRangePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNetworkAreaRangePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRegionPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRegionPayload.java new file mode 100644 index 00000000..995c59b7 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRegionPayload.java @@ -0,0 +1,330 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; + +/** The basic properties of a regional network area. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class CreateNetworkAreaRegionPayload { + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private RegionalAreaIPv4 ipv4; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public CreateNetworkAreaRegionPayload() {} + + public CreateNetworkAreaRegionPayload(String status) { + this(); + this.status = status; + } + + public CreateNetworkAreaRegionPayload ipv4(@javax.annotation.Nullable RegionalAreaIPv4 ipv4) { + this.ipv4 = ipv4; + return this; + } + + /** + * Get ipv4 + * + * @return ipv4 + */ + @javax.annotation.Nullable public RegionalAreaIPv4 getIpv4() { + return ipv4; + } + + public void setIpv4(@javax.annotation.Nullable RegionalAreaIPv4 ipv4) { + this.ipv4 = ipv4; + } + + /** + * The state of a resource object. Possible values: `CREATING`, `CREATED`, + * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, + * `UPDATING`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * 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 CreateNetworkAreaRegionPayload instance itself + */ + public CreateNetworkAreaRegionPayload 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; + } + CreateNetworkAreaRegionPayload createNetworkAreaRegionPayload = + (CreateNetworkAreaRegionPayload) o; + return Objects.equals(this.ipv4, createNetworkAreaRegionPayload.ipv4) + && Objects.equals(this.status, createNetworkAreaRegionPayload.status) + && Objects.equals( + this.additionalProperties, + createNetworkAreaRegionPayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ipv4, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNetworkAreaRegionPayload {\n"); + sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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("ipv4", "status")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateNetworkAreaRegionPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNetworkAreaRegionPayload.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 CreateNetworkAreaRegionPayload is not found in the empty JSON string", + CreateNetworkAreaRegionPayload.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `ipv4` + if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { + RegionalAreaIPv4.validateJsonElement(jsonObj.get("ipv4")); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `status` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNetworkAreaRegionPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNetworkAreaRegionPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateNetworkAreaRegionPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNetworkAreaRegionPayload 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 CreateNetworkAreaRegionPayload read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNetworkAreaRegionPayload 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 CreateNetworkAreaRegionPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNetworkAreaRegionPayload + * @throws IOException if the JSON string is invalid with respect to + * CreateNetworkAreaRegionPayload + */ + public static CreateNetworkAreaRegionPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNetworkAreaRegionPayload.class); + } + + /** + * Convert an instance of CreateNetworkAreaRegionPayload 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/model/CreateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRoutePayload.java index c51fa388..ed593d36 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRoutePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,48 +26,94 @@ 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; -import java.util.Set; -/** CreateNetworkAreaRoutePayload */ +/** Object represents a request to add network routes. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateNetworkAreaRoutePayload { - public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private List ipv4 = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); public CreateNetworkAreaRoutePayload() {} - public CreateNetworkAreaRoutePayload ipv4(@javax.annotation.Nullable List ipv4) { - this.ipv4 = ipv4; + public CreateNetworkAreaRoutePayload items(@javax.annotation.Nonnull List items) { + this.items = items; return this; } - public CreateNetworkAreaRoutePayload addIpv4Item(Route ipv4Item) { - if (this.ipv4 == null) { - this.ipv4 = new ArrayList<>(); + public CreateNetworkAreaRoutePayload addItemsItem(Route itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); } - this.ipv4.add(ipv4Item); + this.items.add(itemsItem); return this; } /** * A list of routes. * - * @return ipv4 + * @return items */ - @javax.annotation.Nullable public List getIpv4() { - return ipv4; + @javax.annotation.Nonnull + public List getItems() { + return items; } - public void setIpv4(@javax.annotation.Nullable List ipv4) { - this.ipv4 = ipv4; + 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 CreateNetworkAreaRoutePayload instance itself + */ + public CreateNetworkAreaRoutePayload 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 @@ -80,19 +126,25 @@ public boolean equals(Object o) { } CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload = (CreateNetworkAreaRoutePayload) o; - return Objects.equals(this.ipv4, createNetworkAreaRoutePayload.ipv4); + return Objects.equals(this.items, createNetworkAreaRoutePayload.items) + && Objects.equals( + this.additionalProperties, + createNetworkAreaRoutePayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(ipv4); + return Objects.hash(items, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNetworkAreaRoutePayload {\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -113,10 +165,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("ipv4")); + openapiFields = new HashSet(Arrays.asList("items")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); + openapiRequiredFields = new HashSet(Arrays.asList("items")); } /** @@ -132,40 +184,39 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateNetworkAreaRoutePayload is not found in the empty JSON string", CreateNetworkAreaRoutePayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateNetworkAreaRoutePayload.openapiFields.contains(entry.getKey())) { + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateNetworkAreaRoutePayload.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( - "The field `%s` in the JSON string is not defined in the `CreateNetworkAreaRoutePayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); + 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("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - JsonArray jsonArrayipv4 = jsonObj.getAsJsonArray("ipv4"); - if (jsonArrayipv4 != null) { - // ensure the json data is an array - if (!jsonObj.get("ipv4").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `ipv4` to be an array in the JSON string but got `%s`", - jsonObj.get("ipv4").toString())); - } - - // validate the optional field `ipv4` (array) - for (int i = 0; i < jsonArrayipv4.size(); i++) { - Route.validateJsonElement(jsonArrayipv4.get(i)); - } - ; - } + // 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++) { + Route.validateJsonElement(jsonArrayitems.get(i)); } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -187,6 +238,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateNetworkAreaRoutePayload 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); } @@ -195,7 +270,42 @@ public CreateNetworkAreaRoutePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNetworkAreaRoutePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4.java new file mode 100644 index 00000000..2ee5043d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4.java @@ -0,0 +1,300 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class CreateNetworkIPv4 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(CreateNetworkIPv4.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNetworkIPv4.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNetworkIPv4' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterCreateNetworkIPv4WithPrefix = + gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkIPv4WithPrefix.class)); + final TypeAdapter + adapterCreateNetworkIPv4WithPrefixLength = + gson.getDelegateAdapter( + this, TypeToken.get(CreateNetworkIPv4WithPrefixLength.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNetworkIPv4 value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `CreateNetworkIPv4WithPrefix` + if (value.getActualInstance() instanceof CreateNetworkIPv4WithPrefix) { + JsonElement element = + adapterCreateNetworkIPv4WithPrefix.toJsonTree( + (CreateNetworkIPv4WithPrefix) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `CreateNetworkIPv4WithPrefixLength` + if (value.getActualInstance() + instanceof CreateNetworkIPv4WithPrefixLength) { + JsonElement element = + adapterCreateNetworkIPv4WithPrefixLength.toJsonTree( + (CreateNetworkIPv4WithPrefixLength) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas: CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength"); + } + + @Override + public CreateNetworkIPv4 read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize CreateNetworkIPv4WithPrefix + try { + // validate the JSON object to see if any exception is thrown + CreateNetworkIPv4WithPrefix.validateJsonElement(jsonElement); + actualAdapter = adapterCreateNetworkIPv4WithPrefix; + match++; + log.log( + Level.FINER, + "Input data matches schema 'CreateNetworkIPv4WithPrefix'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateNetworkIPv4WithPrefix failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'CreateNetworkIPv4WithPrefix'", + e); + } + // deserialize CreateNetworkIPv4WithPrefixLength + try { + // validate the JSON object to see if any exception is thrown + CreateNetworkIPv4WithPrefixLength.validateJsonElement(jsonElement); + actualAdapter = adapterCreateNetworkIPv4WithPrefixLength; + match++; + log.log( + Level.FINER, + "Input data matches schema 'CreateNetworkIPv4WithPrefixLength'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateNetworkIPv4WithPrefixLength failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'CreateNetworkIPv4WithPrefixLength'", + e); + } + + if (match == 1) { + CreateNetworkIPv4 ret = new CreateNetworkIPv4(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + java.util.Locale.ROOT, + "Failed deserialization for CreateNetworkIPv4: %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 CreateNetworkIPv4() { + super("oneOf", Boolean.FALSE); + } + + public CreateNetworkIPv4(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("CreateNetworkIPv4WithPrefix", CreateNetworkIPv4WithPrefix.class); + schemas.put("CreateNetworkIPv4WithPrefixLength", CreateNetworkIPv4WithPrefixLength.class); + } + + @Override + public Map> getSchemas() { + return CreateNetworkIPv4.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: CreateNetworkIPv4WithPrefix, + * CreateNetworkIPv4WithPrefixLength + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof CreateNetworkIPv4WithPrefix) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateNetworkIPv4WithPrefixLength) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength"); + } + + /** + * Get the actual instance, which can be the following: CreateNetworkIPv4WithPrefix, + * CreateNetworkIPv4WithPrefixLength + * + * @return The actual instance (CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateNetworkIPv4WithPrefix`. If the actual instance is not + * `CreateNetworkIPv4WithPrefix`, the ClassCastException will be thrown. + * + * @return The actual instance of `CreateNetworkIPv4WithPrefix` + * @throws ClassCastException if the instance is not `CreateNetworkIPv4WithPrefix` + */ + public CreateNetworkIPv4WithPrefix getCreateNetworkIPv4WithPrefix() throws ClassCastException { + return (CreateNetworkIPv4WithPrefix) super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateNetworkIPv4WithPrefixLength`. If the actual instance is not + * `CreateNetworkIPv4WithPrefixLength`, the ClassCastException will be thrown. + * + * @return The actual instance of `CreateNetworkIPv4WithPrefixLength` + * @throws ClassCastException if the instance is not `CreateNetworkIPv4WithPrefixLength` + */ + public CreateNetworkIPv4WithPrefixLength getCreateNetworkIPv4WithPrefixLength() + throws ClassCastException { + return (CreateNetworkIPv4WithPrefixLength) 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 CreateNetworkIPv4 + */ + 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 CreateNetworkIPv4WithPrefix + try { + CreateNetworkIPv4WithPrefix.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateNetworkIPv4WithPrefix failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with CreateNetworkIPv4WithPrefixLength + try { + CreateNetworkIPv4WithPrefixLength.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateNetworkIPv4WithPrefixLength 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 CreateNetworkIPv4 with oneOf schemas: CreateNetworkIPv4WithPrefix, CreateNetworkIPv4WithPrefixLength. %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 CreateNetworkIPv4 given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNetworkIPv4 + * @throws IOException if the JSON string is invalid with respect to CreateNetworkIPv4 + */ + public static CreateNetworkIPv4 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNetworkIPv4.class); + } + + /** + * Convert an instance of CreateNetworkIPv4 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/model/CreateNetworkIPv4Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4Body.java deleted file mode 100644 index c311833e..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4Body.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * IaaS-API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 1 - * 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.model; - -import cloud.stackit.sdk.iaas.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.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; - -/** The config object for an IPv4 network. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class CreateNetworkIPv4Body { - public static final String SERIALIZED_NAME_GATEWAY = "gateway"; - - @SerializedName(SERIALIZED_NAME_GATEWAY) - @javax.annotation.Nullable private String gateway; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PREFIX = "prefix"; - - @SerializedName(SERIALIZED_NAME_PREFIX) - @javax.annotation.Nullable private String prefix; - - public static final String SERIALIZED_NAME_PREFIX_LENGTH = "prefixLength"; - - @SerializedName(SERIALIZED_NAME_PREFIX_LENGTH) - @javax.annotation.Nullable private Integer prefixLength; - - public CreateNetworkIPv4Body() {} - - public CreateNetworkIPv4Body gateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - return this; - } - - /** - * The gateway of a network. If not specified the first IP of the network will be assigned as - * the gateway. If 'null' is sent, then the network doesn't have a gateway. - * - * @return gateway - */ - @javax.annotation.Nullable public String getGateway() { - return gateway; - } - - public void setGateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - } - - public CreateNetworkIPv4Body nameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public CreateNetworkIPv4Body addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv4. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - public CreateNetworkIPv4Body prefix(@javax.annotation.Nullable String prefix) { - this.prefix = prefix; - return this; - } - - /** - * Classless Inter-Domain Routing (CIDR). - * - * @return prefix - */ - @javax.annotation.Nullable public String getPrefix() { - return prefix; - } - - public void setPrefix(@javax.annotation.Nullable String prefix) { - this.prefix = prefix; - } - - public CreateNetworkIPv4Body prefixLength(@javax.annotation.Nullable Integer prefixLength) { - this.prefixLength = prefixLength; - return this; - } - - /** - * Get prefixLength minimum: 8 maximum: 29 - * - * @return prefixLength - */ - @javax.annotation.Nullable public Integer getPrefixLength() { - return prefixLength; - } - - public void setPrefixLength(@javax.annotation.Nullable Integer prefixLength) { - this.prefixLength = prefixLength; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateNetworkIPv4Body createNetworkIPv4Body = (CreateNetworkIPv4Body) o; - return Objects.equals(this.gateway, createNetworkIPv4Body.gateway) - && Objects.equals(this.nameservers, createNetworkIPv4Body.nameservers) - && Objects.equals(this.prefix, createNetworkIPv4Body.prefix) - && Objects.equals(this.prefixLength, createNetworkIPv4Body.prefixLength); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(gateway, nameservers, prefix, prefixLength); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateNetworkIPv4Body {\n"); - sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); - sb.append(" prefixLength: ").append(toIndentedString(prefixLength)).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("gateway", "nameservers", "prefix", "prefixLength")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateNetworkIPv4Body - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateNetworkIPv4Body.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateNetworkIPv4Body is not found in the empty JSON string", - CreateNetworkIPv4Body.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateNetworkIPv4Body.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateNetworkIPv4Body` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) - && !jsonObj.get("gateway").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("gateway").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - if ((jsonObj.get("prefix") != null && !jsonObj.get("prefix").isJsonNull()) - && !jsonObj.get("prefix").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("prefix").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateNetworkIPv4Body.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateNetworkIPv4Body' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkIPv4Body.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateNetworkIPv4Body value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateNetworkIPv4Body read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateNetworkIPv4Body given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateNetworkIPv4Body - * @throws IOException if the JSON string is invalid with respect to CreateNetworkIPv4Body - */ - public static CreateNetworkIPv4Body fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateNetworkIPv4Body.class); - } - - /** - * Convert an instance of CreateNetworkIPv4Body 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/model/CreateNetworkIPv4WithPrefix.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4WithPrefix.java new file mode 100644 index 00000000..c63a625c --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4WithPrefix.java @@ -0,0 +1,408 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The create request for an IPv4 network with a specified prefix. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class CreateNetworkIPv4WithPrefix { + public static final String SERIALIZED_NAME_GATEWAY = "gateway"; + + @SerializedName(SERIALIZED_NAME_GATEWAY) + @javax.annotation.Nullable private String gateway; + + public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; + + @SerializedName(SERIALIZED_NAME_NAMESERVERS) + @javax.annotation.Nullable private List nameservers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PREFIX = "prefix"; + + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nonnull + private String prefix; + + public CreateNetworkIPv4WithPrefix() {} + + public CreateNetworkIPv4WithPrefix gateway(@javax.annotation.Nullable String gateway) { + this.gateway = gateway; + return this; + } + + /** + * The IPv4 gateway of a network. If not specified the first IP of the network will be assigned + * as the gateway. If 'null' is sent, then the network doesn't have a gateway. + * + * @return gateway + */ + @javax.annotation.Nullable public String getGateway() { + return gateway; + } + + public void setGateway(@javax.annotation.Nullable String gateway) { + this.gateway = gateway; + } + + public CreateNetworkIPv4WithPrefix nameservers( + @javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + return this; + } + + public CreateNetworkIPv4WithPrefix addNameserversItem(String nameserversItem) { + if (this.nameservers == null) { + this.nameservers = new ArrayList<>(); + } + this.nameservers.add(nameserversItem); + return this; + } + + /** + * A list containing DNS Servers/Nameservers for IPv4. + * + * @return nameservers + */ + @javax.annotation.Nullable public List getNameservers() { + return nameservers; + } + + public void setNameservers(@javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + } + + public CreateNetworkIPv4WithPrefix prefix(@javax.annotation.Nonnull String prefix) { + this.prefix = prefix; + return this; + } + + /** + * IPv4 Classless Inter-Domain Routing (CIDR). + * + * @return prefix + */ + @javax.annotation.Nonnull + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nonnull String prefix) { + this.prefix = prefix; + } + + /** + * 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 CreateNetworkIPv4WithPrefix instance itself + */ + public CreateNetworkIPv4WithPrefix 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; + } + CreateNetworkIPv4WithPrefix createNetworkIPv4WithPrefix = (CreateNetworkIPv4WithPrefix) o; + return Objects.equals(this.gateway, createNetworkIPv4WithPrefix.gateway) + && Objects.equals(this.nameservers, createNetworkIPv4WithPrefix.nameservers) + && Objects.equals(this.prefix, createNetworkIPv4WithPrefix.prefix) + && Objects.equals( + this.additionalProperties, + createNetworkIPv4WithPrefix.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gateway, nameservers, prefix, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNetworkIPv4WithPrefix {\n"); + sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); + sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).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("gateway", "nameservers", "prefix")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("prefix")); + } + + /** + * 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 + * CreateNetworkIPv4WithPrefix + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNetworkIPv4WithPrefix.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 CreateNetworkIPv4WithPrefix is not found in the empty JSON string", + CreateNetworkIPv4WithPrefix.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateNetworkIPv4WithPrefix.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("gateway") != null && !jsonObj.get("gateway").isJsonNull()) + && !jsonObj.get("gateway").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("gateway").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("nameservers") != null + && !jsonObj.get("nameservers").isJsonNull() + && !jsonObj.get("nameservers").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `nameservers` to be an array in the JSON string but got `%s`", + jsonObj.get("nameservers").toString())); + } + if (!jsonObj.get("prefix").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("prefix").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNetworkIPv4WithPrefix.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNetworkIPv4WithPrefix' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkIPv4WithPrefix.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNetworkIPv4WithPrefix 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 CreateNetworkIPv4WithPrefix read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNetworkIPv4WithPrefix 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 CreateNetworkIPv4WithPrefix given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNetworkIPv4WithPrefix + * @throws IOException if the JSON string is invalid with respect to CreateNetworkIPv4WithPrefix + */ + public static CreateNetworkIPv4WithPrefix fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNetworkIPv4WithPrefix.class); + } + + /** + * Convert an instance of CreateNetworkIPv4WithPrefix 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/model/CreateNetworkIPv4WithPrefixLength.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4WithPrefixLength.java new file mode 100644 index 00000000..fd25c7d7 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4WithPrefixLength.java @@ -0,0 +1,356 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; + +/** The create request for an IPv4 network with a wanted prefix length. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class CreateNetworkIPv4WithPrefixLength { + public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; + + @SerializedName(SERIALIZED_NAME_NAMESERVERS) + @javax.annotation.Nullable private List nameservers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PREFIX_LENGTH = "prefixLength"; + + @SerializedName(SERIALIZED_NAME_PREFIX_LENGTH) + @javax.annotation.Nonnull + private Long prefixLength; + + public CreateNetworkIPv4WithPrefixLength() {} + + public CreateNetworkIPv4WithPrefixLength nameservers( + @javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + return this; + } + + public CreateNetworkIPv4WithPrefixLength addNameserversItem(String nameserversItem) { + if (this.nameservers == null) { + this.nameservers = new ArrayList<>(); + } + this.nameservers.add(nameserversItem); + return this; + } + + /** + * A list containing DNS Servers/Nameservers for IPv4. + * + * @return nameservers + */ + @javax.annotation.Nullable public List getNameservers() { + return nameservers; + } + + public void setNameservers(@javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + } + + public CreateNetworkIPv4WithPrefixLength prefixLength( + @javax.annotation.Nonnull Long prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * Get prefixLength minimum: 8 maximum: 29 + * + * @return prefixLength + */ + @javax.annotation.Nonnull + public Long getPrefixLength() { + return prefixLength; + } + + public void setPrefixLength(@javax.annotation.Nonnull Long prefixLength) { + this.prefixLength = prefixLength; + } + + /** + * 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 CreateNetworkIPv4WithPrefixLength instance itself + */ + public CreateNetworkIPv4WithPrefixLength 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; + } + CreateNetworkIPv4WithPrefixLength createNetworkIPv4WithPrefixLength = + (CreateNetworkIPv4WithPrefixLength) o; + return Objects.equals(this.nameservers, createNetworkIPv4WithPrefixLength.nameservers) + && Objects.equals(this.prefixLength, createNetworkIPv4WithPrefixLength.prefixLength) + && Objects.equals( + this.additionalProperties, + createNetworkIPv4WithPrefixLength.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(nameservers, prefixLength, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNetworkIPv4WithPrefixLength {\n"); + sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); + sb.append(" prefixLength: ").append(toIndentedString(prefixLength)).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("nameservers", "prefixLength")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("prefixLength")); + } + + /** + * 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 + * CreateNetworkIPv4WithPrefixLength + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNetworkIPv4WithPrefixLength.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 CreateNetworkIPv4WithPrefixLength is not found in the empty JSON string", + CreateNetworkIPv4WithPrefixLength.openapiRequiredFields + .toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateNetworkIPv4WithPrefixLength.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 optional json data is an array if present + if (jsonObj.get("nameservers") != null + && !jsonObj.get("nameservers").isJsonNull() + && !jsonObj.get("nameservers").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `nameservers` to be an array in the JSON string but got `%s`", + jsonObj.get("nameservers").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNetworkIPv4WithPrefixLength.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNetworkIPv4WithPrefixLength' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateNetworkIPv4WithPrefixLength.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNetworkIPv4WithPrefixLength 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 CreateNetworkIPv4WithPrefixLength read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNetworkIPv4WithPrefixLength 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 CreateNetworkIPv4WithPrefixLength given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNetworkIPv4WithPrefixLength + * @throws IOException if the JSON string is invalid with respect to + * CreateNetworkIPv4WithPrefixLength + */ + public static CreateNetworkIPv4WithPrefixLength fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNetworkIPv4WithPrefixLength.class); + } + + /** + * Convert an instance of CreateNetworkIPv4WithPrefixLength 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/model/CreateNetworkIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6.java new file mode 100644 index 00000000..90e6aeaf --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6.java @@ -0,0 +1,300 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class CreateNetworkIPv6 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(CreateNetworkIPv6.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNetworkIPv6.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNetworkIPv6' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterCreateNetworkIPv6WithPrefix = + gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkIPv6WithPrefix.class)); + final TypeAdapter + adapterCreateNetworkIPv6WithPrefixLength = + gson.getDelegateAdapter( + this, TypeToken.get(CreateNetworkIPv6WithPrefixLength.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNetworkIPv6 value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `CreateNetworkIPv6WithPrefix` + if (value.getActualInstance() instanceof CreateNetworkIPv6WithPrefix) { + JsonElement element = + adapterCreateNetworkIPv6WithPrefix.toJsonTree( + (CreateNetworkIPv6WithPrefix) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `CreateNetworkIPv6WithPrefixLength` + if (value.getActualInstance() + instanceof CreateNetworkIPv6WithPrefixLength) { + JsonElement element = + adapterCreateNetworkIPv6WithPrefixLength.toJsonTree( + (CreateNetworkIPv6WithPrefixLength) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas: CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength"); + } + + @Override + public CreateNetworkIPv6 read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize CreateNetworkIPv6WithPrefix + try { + // validate the JSON object to see if any exception is thrown + CreateNetworkIPv6WithPrefix.validateJsonElement(jsonElement); + actualAdapter = adapterCreateNetworkIPv6WithPrefix; + match++; + log.log( + Level.FINER, + "Input data matches schema 'CreateNetworkIPv6WithPrefix'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateNetworkIPv6WithPrefix failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'CreateNetworkIPv6WithPrefix'", + e); + } + // deserialize CreateNetworkIPv6WithPrefixLength + try { + // validate the JSON object to see if any exception is thrown + CreateNetworkIPv6WithPrefixLength.validateJsonElement(jsonElement); + actualAdapter = adapterCreateNetworkIPv6WithPrefixLength; + match++; + log.log( + Level.FINER, + "Input data matches schema 'CreateNetworkIPv6WithPrefixLength'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateNetworkIPv6WithPrefixLength failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'CreateNetworkIPv6WithPrefixLength'", + e); + } + + if (match == 1) { + CreateNetworkIPv6 ret = new CreateNetworkIPv6(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + java.util.Locale.ROOT, + "Failed deserialization for CreateNetworkIPv6: %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 CreateNetworkIPv6() { + super("oneOf", Boolean.FALSE); + } + + public CreateNetworkIPv6(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("CreateNetworkIPv6WithPrefix", CreateNetworkIPv6WithPrefix.class); + schemas.put("CreateNetworkIPv6WithPrefixLength", CreateNetworkIPv6WithPrefixLength.class); + } + + @Override + public Map> getSchemas() { + return CreateNetworkIPv6.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: CreateNetworkIPv6WithPrefix, + * CreateNetworkIPv6WithPrefixLength + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof CreateNetworkIPv6WithPrefix) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateNetworkIPv6WithPrefixLength) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength"); + } + + /** + * Get the actual instance, which can be the following: CreateNetworkIPv6WithPrefix, + * CreateNetworkIPv6WithPrefixLength + * + * @return The actual instance (CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateNetworkIPv6WithPrefix`. If the actual instance is not + * `CreateNetworkIPv6WithPrefix`, the ClassCastException will be thrown. + * + * @return The actual instance of `CreateNetworkIPv6WithPrefix` + * @throws ClassCastException if the instance is not `CreateNetworkIPv6WithPrefix` + */ + public CreateNetworkIPv6WithPrefix getCreateNetworkIPv6WithPrefix() throws ClassCastException { + return (CreateNetworkIPv6WithPrefix) super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateNetworkIPv6WithPrefixLength`. If the actual instance is not + * `CreateNetworkIPv6WithPrefixLength`, the ClassCastException will be thrown. + * + * @return The actual instance of `CreateNetworkIPv6WithPrefixLength` + * @throws ClassCastException if the instance is not `CreateNetworkIPv6WithPrefixLength` + */ + public CreateNetworkIPv6WithPrefixLength getCreateNetworkIPv6WithPrefixLength() + throws ClassCastException { + return (CreateNetworkIPv6WithPrefixLength) 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 CreateNetworkIPv6 + */ + 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 CreateNetworkIPv6WithPrefix + try { + CreateNetworkIPv6WithPrefix.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateNetworkIPv6WithPrefix failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with CreateNetworkIPv6WithPrefixLength + try { + CreateNetworkIPv6WithPrefixLength.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateNetworkIPv6WithPrefixLength 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 CreateNetworkIPv6 with oneOf schemas: CreateNetworkIPv6WithPrefix, CreateNetworkIPv6WithPrefixLength. %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 CreateNetworkIPv6 given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNetworkIPv6 + * @throws IOException if the JSON string is invalid with respect to CreateNetworkIPv6 + */ + public static CreateNetworkIPv6 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNetworkIPv6.class); + } + + /** + * Convert an instance of CreateNetworkIPv6 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/model/CreateNetworkIPv6Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6Body.java deleted file mode 100644 index ee660456..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6Body.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * IaaS-API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 1 - * 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.model; - -import cloud.stackit.sdk.iaas.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.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; - -/** The config object for an IPv6 network. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class CreateNetworkIPv6Body { - public static final String SERIALIZED_NAME_GATEWAY = "gateway"; - - @SerializedName(SERIALIZED_NAME_GATEWAY) - @javax.annotation.Nullable private String gateway; - - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PREFIX = "prefix"; - - @SerializedName(SERIALIZED_NAME_PREFIX) - @javax.annotation.Nullable private String prefix; - - public static final String SERIALIZED_NAME_PREFIX_LENGTH = "prefixLength"; - - @SerializedName(SERIALIZED_NAME_PREFIX_LENGTH) - @javax.annotation.Nullable private Integer prefixLength; - - public CreateNetworkIPv6Body() {} - - public CreateNetworkIPv6Body gateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - return this; - } - - /** - * The gateway of a network. If not specified the first IP of the network will be assigned as - * the gateway. If 'null' is sent, then the network doesn't have a gateway. - * - * @return gateway - */ - @javax.annotation.Nullable public String getGateway() { - return gateway; - } - - public void setGateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; - } - - public CreateNetworkIPv6Body nameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public CreateNetworkIPv6Body addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv6. - * - * @return nameservers - */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - } - - public CreateNetworkIPv6Body prefix(@javax.annotation.Nullable String prefix) { - this.prefix = prefix; - return this; - } - - /** - * Classless Inter-Domain Routing (CIDR) for IPv6. - * - * @return prefix - */ - @javax.annotation.Nullable public String getPrefix() { - return prefix; - } - - public void setPrefix(@javax.annotation.Nullable String prefix) { - this.prefix = prefix; - } - - public CreateNetworkIPv6Body prefixLength(@javax.annotation.Nullable Integer prefixLength) { - this.prefixLength = prefixLength; - return this; - } - - /** - * Get prefixLength minimum: 56 maximum: 128 - * - * @return prefixLength - */ - @javax.annotation.Nullable public Integer getPrefixLength() { - return prefixLength; - } - - public void setPrefixLength(@javax.annotation.Nullable Integer prefixLength) { - this.prefixLength = prefixLength; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateNetworkIPv6Body createNetworkIPv6Body = (CreateNetworkIPv6Body) o; - return Objects.equals(this.gateway, createNetworkIPv6Body.gateway) - && Objects.equals(this.nameservers, createNetworkIPv6Body.nameservers) - && Objects.equals(this.prefix, createNetworkIPv6Body.prefix) - && Objects.equals(this.prefixLength, createNetworkIPv6Body.prefixLength); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(gateway, nameservers, prefix, prefixLength); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateNetworkIPv6Body {\n"); - sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); - sb.append(" prefixLength: ").append(toIndentedString(prefixLength)).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("gateway", "nameservers", "prefix", "prefixLength")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateNetworkIPv6Body - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateNetworkIPv6Body.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateNetworkIPv6Body is not found in the empty JSON string", - CreateNetworkIPv6Body.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateNetworkIPv6Body.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateNetworkIPv6Body` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) - && !jsonObj.get("gateway").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("gateway").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - if ((jsonObj.get("prefix") != null && !jsonObj.get("prefix").isJsonNull()) - && !jsonObj.get("prefix").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("prefix").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateNetworkIPv6Body.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateNetworkIPv6Body' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkIPv6Body.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateNetworkIPv6Body value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateNetworkIPv6Body read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateNetworkIPv6Body given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateNetworkIPv6Body - * @throws IOException if the JSON string is invalid with respect to CreateNetworkIPv6Body - */ - public static CreateNetworkIPv6Body fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateNetworkIPv6Body.class); - } - - /** - * Convert an instance of CreateNetworkIPv6Body 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/model/CreateNetworkIPv6WithPrefix.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6WithPrefix.java new file mode 100644 index 00000000..91501338 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6WithPrefix.java @@ -0,0 +1,408 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The create request for an IPv6 network with a specified prefix. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class CreateNetworkIPv6WithPrefix { + public static final String SERIALIZED_NAME_GATEWAY = "gateway"; + + @SerializedName(SERIALIZED_NAME_GATEWAY) + @javax.annotation.Nullable private String gateway; + + public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; + + @SerializedName(SERIALIZED_NAME_NAMESERVERS) + @javax.annotation.Nullable private List nameservers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PREFIX = "prefix"; + + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nonnull + private String prefix; + + public CreateNetworkIPv6WithPrefix() {} + + public CreateNetworkIPv6WithPrefix gateway(@javax.annotation.Nullable String gateway) { + this.gateway = gateway; + return this; + } + + /** + * The IPv6 gateway of a network. If not specified the first IP of the network will be assigned + * as the gateway. If 'null' is sent, then the network doesn't have a gateway. + * + * @return gateway + */ + @javax.annotation.Nullable public String getGateway() { + return gateway; + } + + public void setGateway(@javax.annotation.Nullable String gateway) { + this.gateway = gateway; + } + + public CreateNetworkIPv6WithPrefix nameservers( + @javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + return this; + } + + public CreateNetworkIPv6WithPrefix addNameserversItem(String nameserversItem) { + if (this.nameservers == null) { + this.nameservers = new ArrayList<>(); + } + this.nameservers.add(nameserversItem); + return this; + } + + /** + * A list containing DNS Servers/Nameservers for IPv6. + * + * @return nameservers + */ + @javax.annotation.Nullable public List getNameservers() { + return nameservers; + } + + public void setNameservers(@javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + } + + public CreateNetworkIPv6WithPrefix prefix(@javax.annotation.Nonnull String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Classless Inter-Domain Routing (CIDR) for IPv6. + * + * @return prefix + */ + @javax.annotation.Nonnull + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nonnull String prefix) { + this.prefix = prefix; + } + + /** + * 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 CreateNetworkIPv6WithPrefix instance itself + */ + public CreateNetworkIPv6WithPrefix 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; + } + CreateNetworkIPv6WithPrefix createNetworkIPv6WithPrefix = (CreateNetworkIPv6WithPrefix) o; + return Objects.equals(this.gateway, createNetworkIPv6WithPrefix.gateway) + && Objects.equals(this.nameservers, createNetworkIPv6WithPrefix.nameservers) + && Objects.equals(this.prefix, createNetworkIPv6WithPrefix.prefix) + && Objects.equals( + this.additionalProperties, + createNetworkIPv6WithPrefix.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gateway, nameservers, prefix, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNetworkIPv6WithPrefix {\n"); + sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); + sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).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("gateway", "nameservers", "prefix")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("prefix")); + } + + /** + * 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 + * CreateNetworkIPv6WithPrefix + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNetworkIPv6WithPrefix.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 CreateNetworkIPv6WithPrefix is not found in the empty JSON string", + CreateNetworkIPv6WithPrefix.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateNetworkIPv6WithPrefix.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("gateway") != null && !jsonObj.get("gateway").isJsonNull()) + && !jsonObj.get("gateway").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("gateway").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("nameservers") != null + && !jsonObj.get("nameservers").isJsonNull() + && !jsonObj.get("nameservers").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `nameservers` to be an array in the JSON string but got `%s`", + jsonObj.get("nameservers").toString())); + } + if (!jsonObj.get("prefix").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("prefix").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNetworkIPv6WithPrefix.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNetworkIPv6WithPrefix' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkIPv6WithPrefix.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNetworkIPv6WithPrefix 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 CreateNetworkIPv6WithPrefix read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNetworkIPv6WithPrefix 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 CreateNetworkIPv6WithPrefix given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNetworkIPv6WithPrefix + * @throws IOException if the JSON string is invalid with respect to CreateNetworkIPv6WithPrefix + */ + public static CreateNetworkIPv6WithPrefix fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNetworkIPv6WithPrefix.class); + } + + /** + * Convert an instance of CreateNetworkIPv6WithPrefix 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/model/CreateNetworkIPv6WithPrefixLength.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6WithPrefixLength.java new file mode 100644 index 00000000..1e6e7371 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6WithPrefixLength.java @@ -0,0 +1,356 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; + +/** The create request for an IPv6 network with a wanted prefix length. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class CreateNetworkIPv6WithPrefixLength { + public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; + + @SerializedName(SERIALIZED_NAME_NAMESERVERS) + @javax.annotation.Nullable private List nameservers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PREFIX_LENGTH = "prefixLength"; + + @SerializedName(SERIALIZED_NAME_PREFIX_LENGTH) + @javax.annotation.Nonnull + private Long prefixLength; + + public CreateNetworkIPv6WithPrefixLength() {} + + public CreateNetworkIPv6WithPrefixLength nameservers( + @javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + return this; + } + + public CreateNetworkIPv6WithPrefixLength addNameserversItem(String nameserversItem) { + if (this.nameservers == null) { + this.nameservers = new ArrayList<>(); + } + this.nameservers.add(nameserversItem); + return this; + } + + /** + * A list containing DNS Servers/Nameservers for IPv6. + * + * @return nameservers + */ + @javax.annotation.Nullable public List getNameservers() { + return nameservers; + } + + public void setNameservers(@javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + } + + public CreateNetworkIPv6WithPrefixLength prefixLength( + @javax.annotation.Nonnull Long prefixLength) { + this.prefixLength = prefixLength; + return this; + } + + /** + * Get prefixLength minimum: 56 maximum: 128 + * + * @return prefixLength + */ + @javax.annotation.Nonnull + public Long getPrefixLength() { + return prefixLength; + } + + public void setPrefixLength(@javax.annotation.Nonnull Long prefixLength) { + this.prefixLength = prefixLength; + } + + /** + * 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 CreateNetworkIPv6WithPrefixLength instance itself + */ + public CreateNetworkIPv6WithPrefixLength 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; + } + CreateNetworkIPv6WithPrefixLength createNetworkIPv6WithPrefixLength = + (CreateNetworkIPv6WithPrefixLength) o; + return Objects.equals(this.nameservers, createNetworkIPv6WithPrefixLength.nameservers) + && Objects.equals(this.prefixLength, createNetworkIPv6WithPrefixLength.prefixLength) + && Objects.equals( + this.additionalProperties, + createNetworkIPv6WithPrefixLength.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(nameservers, prefixLength, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNetworkIPv6WithPrefixLength {\n"); + sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); + sb.append(" prefixLength: ").append(toIndentedString(prefixLength)).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("nameservers", "prefixLength")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("prefixLength")); + } + + /** + * 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 + * CreateNetworkIPv6WithPrefixLength + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNetworkIPv6WithPrefixLength.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 CreateNetworkIPv6WithPrefixLength is not found in the empty JSON string", + CreateNetworkIPv6WithPrefixLength.openapiRequiredFields + .toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateNetworkIPv6WithPrefixLength.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 optional json data is an array if present + if (jsonObj.get("nameservers") != null + && !jsonObj.get("nameservers").isJsonNull() + && !jsonObj.get("nameservers").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `nameservers` to be an array in the JSON string but got `%s`", + jsonObj.get("nameservers").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNetworkIPv6WithPrefixLength.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNetworkIPv6WithPrefixLength' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateNetworkIPv6WithPrefixLength.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNetworkIPv6WithPrefixLength 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 CreateNetworkIPv6WithPrefixLength read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNetworkIPv6WithPrefixLength 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 CreateNetworkIPv6WithPrefixLength given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNetworkIPv6WithPrefixLength + * @throws IOException if the JSON string is invalid with respect to + * CreateNetworkIPv6WithPrefixLength + */ + public static CreateNetworkIPv6WithPrefixLength fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNetworkIPv6WithPrefixLength.class); + } + + /** + * Convert an instance of CreateNetworkIPv6WithPrefixLength 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/model/CreateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkPayload.java index 101ffb22..caba2f0f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,26 +24,33 @@ 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; -import java.util.Set; +import java.util.UUID; /** Object that represents the request body for a network create. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateNetworkPayload { - public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "addressFamily"; - - @SerializedName(SERIALIZED_NAME_ADDRESS_FAMILY) - @javax.annotation.Nullable private CreateNetworkAddressFamily addressFamily; - public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @javax.annotation.Nullable private Boolean dhcp = true; + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private CreateNetworkIPv4 ipv4; + + public static final String SERIALIZED_NAME_IPV6 = "ipv6"; + + @SerializedName(SERIALIZED_NAME_IPV6) + @javax.annotation.Nullable private CreateNetworkIPv6 ipv6; + public static final String SERIALIZED_NAME_LABELS = "labels"; @SerializedName(SERIALIZED_NAME_LABELS) @@ -60,44 +67,65 @@ public class CreateNetworkPayload { @SerializedName(SERIALIZED_NAME_ROUTED) @javax.annotation.Nullable private Boolean routed; + public static final String SERIALIZED_NAME_ROUTING_TABLE_ID = "routingTableId"; + + @SerializedName(SERIALIZED_NAME_ROUTING_TABLE_ID) + @javax.annotation.Nullable private UUID routingTableId; + public CreateNetworkPayload() {} - public CreateNetworkPayload addressFamily( - @javax.annotation.Nullable CreateNetworkAddressFamily addressFamily) { - this.addressFamily = addressFamily; + public CreateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { + this.dhcp = dhcp; return this; } /** - * Get addressFamily + * Enable or disable DHCP for a network. * - * @return addressFamily + * @return dhcp */ - @javax.annotation.Nullable public CreateNetworkAddressFamily getAddressFamily() { - return addressFamily; + @javax.annotation.Nullable public Boolean getDhcp() { + return dhcp; } - public void setAddressFamily( - @javax.annotation.Nullable CreateNetworkAddressFamily addressFamily) { - this.addressFamily = addressFamily; + public void setDhcp(@javax.annotation.Nullable Boolean dhcp) { + this.dhcp = dhcp; } - public CreateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { - this.dhcp = dhcp; + public CreateNetworkPayload ipv4(@javax.annotation.Nullable CreateNetworkIPv4 ipv4) { + this.ipv4 = ipv4; return this; } /** - * Enable or disable DHCP for a network. + * Get ipv4 * - * @return dhcp + * @return ipv4 */ - @javax.annotation.Nullable public Boolean getDhcp() { - return dhcp; + @javax.annotation.Nullable public CreateNetworkIPv4 getIpv4() { + return ipv4; } - public void setDhcp(@javax.annotation.Nullable Boolean dhcp) { - this.dhcp = dhcp; + public void setIpv4(@javax.annotation.Nullable CreateNetworkIPv4 ipv4) { + this.ipv4 = ipv4; + } + + public CreateNetworkPayload ipv6(@javax.annotation.Nullable CreateNetworkIPv6 ipv6) { + this.ipv6 = ipv6; + return this; + } + + /** + * Get ipv6 + * + * @return ipv6 + */ + @javax.annotation.Nullable public CreateNetworkIPv6 getIpv6() { + return ipv6; + } + + public void setIpv6(@javax.annotation.Nullable CreateNetworkIPv6 ipv6) { + this.ipv6 = ipv6; } public CreateNetworkPayload labels(@javax.annotation.Nullable Object labels) { @@ -109,7 +137,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -158,6 +187,68 @@ public void setRouted(@javax.annotation.Nullable Boolean routed) { this.routed = routed; } + public CreateNetworkPayload routingTableId(@javax.annotation.Nullable UUID routingTableId) { + this.routingTableId = routingTableId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return routingTableId + */ + @javax.annotation.Nullable public UUID getRoutingTableId() { + return routingTableId; + } + + public void setRoutingTableId(@javax.annotation.Nullable UUID routingTableId) { + this.routingTableId = routingTableId; + } + + /** + * 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 CreateNetworkPayload instance itself + */ + public CreateNetworkPayload 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) { @@ -167,27 +258,37 @@ public boolean equals(Object o) { return false; } CreateNetworkPayload createNetworkPayload = (CreateNetworkPayload) o; - return Objects.equals(this.addressFamily, createNetworkPayload.addressFamily) - && Objects.equals(this.dhcp, createNetworkPayload.dhcp) + return Objects.equals(this.dhcp, createNetworkPayload.dhcp) + && Objects.equals(this.ipv4, createNetworkPayload.ipv4) + && Objects.equals(this.ipv6, createNetworkPayload.ipv6) && Objects.equals(this.labels, createNetworkPayload.labels) && Objects.equals(this.name, createNetworkPayload.name) - && Objects.equals(this.routed, createNetworkPayload.routed); + && Objects.equals(this.routed, createNetworkPayload.routed) + && Objects.equals(this.routingTableId, createNetworkPayload.routingTableId) + && Objects.equals( + this.additionalProperties, createNetworkPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(addressFamily, dhcp, labels, name, routed); + return Objects.hash( + dhcp, ipv4, ipv6, labels, name, routed, routingTableId, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNetworkPayload {\n"); - sb.append(" addressFamily: ").append(toIndentedString(addressFamily)).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"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" routed: ").append(toIndentedString(routed)).append("\n"); + sb.append(" routingTableId: ").append(toIndentedString(routingTableId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -210,7 +311,14 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet( - Arrays.asList("addressFamily", "dhcp", "labels", "name", "routed")); + Arrays.asList( + "dhcp", + "ipv4", + "ipv6", + "labels", + "name", + "routed", + "routingTableId")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("name")); @@ -228,42 +336,47 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateNetworkPayload is not found in the empty JSON string", CreateNetworkPayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateNetworkPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateNetworkPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateNetworkPayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `addressFamily` - if (jsonObj.get("addressFamily") != null && !jsonObj.get("addressFamily").isJsonNull()) { - CreateNetworkAddressFamily.validateJsonElement(jsonObj.get("addressFamily")); + // validate the optional field `ipv4` + if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { + CreateNetworkIPv4.validateJsonElement(jsonObj.get("ipv4")); + } + // validate the optional field `ipv6` + if (jsonObj.get("ipv6") != null && !jsonObj.get("ipv6").isJsonNull()) { + CreateNetworkIPv6.validateJsonElement(jsonObj.get("ipv6")); } 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("routingTableId") != null && !jsonObj.get("routingTableId").isJsonNull()) + && !jsonObj.get("routingTableId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `routingTableId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("routingTableId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -283,6 +396,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateNetworkPayload 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); } @@ -290,7 +427,41 @@ public void write(JsonWriter out, CreateNetworkPayload value) public CreateNetworkPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNetworkPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNicPayload.java index f6ad7344..ba00a131 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNicPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,17 +26,17 @@ 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; -import java.util.Set; import java.util.UUID; /** Object that represents a network interface. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateNicPayload { public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; @@ -230,7 +230,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -341,6 +342,50 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return 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 CreateNicPayload instance itself + */ + public CreateNicPayload 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) { @@ -363,7 +408,8 @@ public boolean equals(Object o) { && Objects.equals(this.nicSecurity, createNicPayload.nicSecurity) && Objects.equals(this.securityGroups, createNicPayload.securityGroups) && Objects.equals(this.status, createNicPayload.status) - && Objects.equals(this.type, createNicPayload.type); + && Objects.equals(this.type, createNicPayload.type) + && Objects.equals(this.additionalProperties, createNicPayload.additionalProperties); } @Override @@ -382,7 +428,8 @@ public int hashCode() { nicSecurity, securityGroups, status, - type); + type, + additionalProperties); } @Override @@ -403,6 +450,9 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -457,21 +507,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateNicPayload is not found in the empty JSON string", CreateNicPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateNicPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateNicPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("allowedAddresses") != null && !jsonObj.get("allowedAddresses").isJsonNull()) { @@ -481,6 +521,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("allowedAddresses").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `allowedAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedAddresses").toString())); } @@ -496,6 +537,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -503,6 +545,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("device").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `device` to be a primitive type in the JSON string but got `%s`", jsonObj.get("device").toString())); } @@ -510,6 +553,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -517,6 +561,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ipv4").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ipv4` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipv4").toString())); } @@ -524,6 +569,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ipv6").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ipv6` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipv6").toString())); } @@ -531,6 +577,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("mac").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `mac` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mac").toString())); } @@ -538,6 +585,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -545,6 +593,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("networkId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `networkId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkId").toString())); } @@ -554,6 +603,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("securityGroups").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", jsonObj.get("securityGroups").toString())); } @@ -561,6 +611,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -568,6 +619,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -590,6 +642,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateNicPayload 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); } @@ -597,7 +673,41 @@ public void write(JsonWriter out, CreateNicPayload value) public CreateNicPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateNicPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateProtocol.java index 7af293e1..0a5cf686 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateProtocol.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -30,7 +30,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateProtocol extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateProtocol.class.getName()); @@ -93,6 +93,7 @@ public CreateProtocol read(JsonReader in) throws IOException { if (!jsonElement.getAsJsonPrimitive().isNumber()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); } @@ -103,6 +104,7 @@ public CreateProtocol read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( + java.util.Locale.ROOT, "Deserialization for Long failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'Long'", e); @@ -113,6 +115,7 @@ public CreateProtocol read(JsonReader in) throws IOException { 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())); } @@ -123,6 +126,7 @@ public CreateProtocol read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( + java.util.Locale.ROOT, "Deserialization for String failed with `%s`.", e.getMessage())); log.log( @@ -139,8 +143,11 @@ public CreateProtocol read(JsonReader in) throws IOException { throw new IOException( String.format( + java.util.Locale.ROOT, "Failed deserialization for CreateProtocol: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, errorMessages, jsonElement.toString())); + match, + errorMessages, + jsonElement.toString())); } }.nullSafe(); } @@ -237,13 +244,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonElement.getAsJsonPrimitive().isNumber()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); } validCount++; } catch (Exception e) { errorMessages.add( - String.format("Deserialization for Long failed with `%s`.", e.getMessage())); + String.format( + java.util.Locale.ROOT, + "Deserialization for Long failed with `%s`.", + e.getMessage())); // continue to the next one } // validate the json string with String @@ -251,20 +262,27 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } validCount++; } catch (Exception e) { errorMessages.add( - String.format("Deserialization for String failed with `%s`.", e.getMessage())); + String.format( + java.util.Locale.ROOT, + "Deserialization for String 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 CreateProtocol with oneOf schemas: Long, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, errorMessages, jsonElement.toString())); + validCount, + errorMessages, + jsonElement.toString())); } } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreatePublicIPPayload.java index f22974ba..cbef621b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreatePublicIPPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,17 +24,18 @@ 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; -import java.util.Set; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreatePublicIPPayload { public static final String SERIALIZED_NAME_ID = "id"; @@ -74,7 +75,7 @@ public CreatePublicIPPayload(UUID id, String ip) { } /** - * Object that represents an IP address. + * String that represents an IPv4 address. * * @return ip */ @@ -91,7 +92,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -122,6 +124,50 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * 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 CreatePublicIPPayload instance itself + */ + public CreatePublicIPPayload 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) { @@ -134,7 +180,9 @@ public boolean equals(Object o) { return Objects.equals(this.id, createPublicIPPayload.id) && Objects.equals(this.ip, createPublicIPPayload.ip) && Objects.equals(this.labels, createPublicIPPayload.labels) - && Objects.equals(this.networkInterface, createPublicIPPayload.networkInterface); + && Objects.equals(this.networkInterface, createPublicIPPayload.networkInterface) + && Objects.equals( + this.additionalProperties, createPublicIPPayload.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -148,7 +196,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface); + return Objects.hash(id, ip, labels, networkInterface, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -166,6 +214,9 @@ public String toString() { sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -205,26 +256,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreatePublicIPPayload is not found in the empty JSON string", CreatePublicIPPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreatePublicIPPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreatePublicIPPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); 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())); } @@ -232,6 +274,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ip").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ip").toString())); } @@ -240,6 +283,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("networkInterface").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `networkInterface` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkInterface").toString())); } @@ -262,6 +306,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreatePublicIPPayload 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); } @@ -269,7 +337,41 @@ public void write(JsonWriter out, CreatePublicIPPayload value) public CreatePublicIPPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreatePublicIPPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupPayload.java index e90e1509..a1211078 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,17 +26,17 @@ 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.Set; import java.util.UUID; /** Object that represents a security group. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateSecurityGroupPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -138,7 +138,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -206,6 +207,50 @@ public void setStateful(@javax.annotation.Nullable Boolean stateful) { 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 CreateSecurityGroupPayload instance itself + */ + public CreateSecurityGroupPayload 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) { @@ -222,12 +267,23 @@ public boolean equals(Object o) { && Objects.equals(this.name, createSecurityGroupPayload.name) && Objects.equals(this.rules, createSecurityGroupPayload.rules) && Objects.equals(this.stateful, createSecurityGroupPayload.stateful) - && Objects.equals(this.updatedAt, createSecurityGroupPayload.updatedAt); + && Objects.equals(this.updatedAt, createSecurityGroupPayload.updatedAt) + && Objects.equals( + this.additionalProperties, createSecurityGroupPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(createdAt, description, id, labels, name, rules, stateful, updatedAt); + return Objects.hash( + createdAt, + description, + id, + labels, + name, + rules, + stateful, + updatedAt, + additionalProperties); } @Override @@ -242,6 +298,9 @@ public String toString() { sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); sb.append(" stateful: ").append(toIndentedString(stateful)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -290,29 +349,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateSecurityGroupPayload is not found in the empty JSON string", CreateSecurityGroupPayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateSecurityGroupPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateSecurityGroupPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateSecurityGroupPayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -320,6 +371,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -327,12 +379,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -343,6 +397,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("rules").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `rules` to be an array in the JSON string but got `%s`", jsonObj.get("rules").toString())); } @@ -374,6 +429,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateSecurityGroupPayload 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); } @@ -381,7 +460,41 @@ public void write(JsonWriter out, CreateSecurityGroupPayload value) public CreateSecurityGroupPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateSecurityGroupPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRulePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRulePayload.java index 2d36b204..9e2c5e6d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRulePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRulePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,16 +25,17 @@ 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.Set; import java.util.UUID; /** Object that represents a request body for security group rule creation. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateSecurityGroupRulePayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -296,6 +297,50 @@ public void setProtocol(@javax.annotation.Nullable CreateProtocol protocol) { this.protocol = protocol; } + /** + * 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 CreateSecurityGroupRulePayload instance itself + */ + public CreateSecurityGroupRulePayload 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) { @@ -321,7 +366,10 @@ public boolean equals(Object o) { && Objects.equals( this.securityGroupId, createSecurityGroupRulePayload.securityGroupId) && Objects.equals(this.updatedAt, createSecurityGroupRulePayload.updatedAt) - && Objects.equals(this.protocol, createSecurityGroupRulePayload.protocol); + && Objects.equals(this.protocol, createSecurityGroupRulePayload.protocol) + && Objects.equals( + this.additionalProperties, + createSecurityGroupRulePayload.additionalProperties); } @Override @@ -338,7 +386,8 @@ public int hashCode() { remoteSecurityGroupId, securityGroupId, updatedAt, - protocol); + protocol, + additionalProperties); } @Override @@ -359,6 +408,9 @@ public String toString() { sb.append(" securityGroupId: ").append(toIndentedString(securityGroupId)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -412,29 +464,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateSecurityGroupRulePayload is not found in the empty JSON string", CreateSecurityGroupRulePayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateSecurityGroupRulePayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateSecurityGroupRulePayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateSecurityGroupRulePayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -442,12 +486,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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("direction").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `direction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("direction").toString())); } @@ -455,6 +501,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -466,6 +513,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -473,6 +521,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ipRange").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ipRange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipRange").toString())); } @@ -485,6 +534,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("remoteSecurityGroupId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `remoteSecurityGroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteSecurityGroupId").toString())); } @@ -492,6 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("securityGroupId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `securityGroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("securityGroupId").toString())); } @@ -520,6 +571,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateSecurityGroupRulePayload 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); } @@ -528,7 +603,42 @@ public CreateSecurityGroupRulePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateSecurityGroupRulePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRuleProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRuleProtocol.java index 73ae90bd..7e180891 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRuleProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRuleProtocol.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** The internet protocol which the rule should match. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateSecurityGroupRuleProtocol { public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; @@ -60,6 +61,50 @@ public void setProtocol(@javax.annotation.Nullable CreateProtocol protocol) { this.protocol = protocol; } + /** + * 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 CreateSecurityGroupRuleProtocol instance itself + */ + public CreateSecurityGroupRuleProtocol 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) { @@ -70,12 +115,15 @@ public boolean equals(Object o) { } CreateSecurityGroupRuleProtocol createSecurityGroupRuleProtocol = (CreateSecurityGroupRuleProtocol) o; - return Objects.equals(this.protocol, createSecurityGroupRuleProtocol.protocol); + return Objects.equals(this.protocol, createSecurityGroupRuleProtocol.protocol) + && Objects.equals( + this.additionalProperties, + createSecurityGroupRuleProtocol.additionalProperties); } @Override public int hashCode() { - return Objects.hash(protocol); + return Objects.hash(protocol, additionalProperties); } @Override @@ -83,6 +131,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateSecurityGroupRuleProtocol {\n"); sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -122,21 +173,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateSecurityGroupRuleProtocol is not found in the empty JSON string", CreateSecurityGroupRuleProtocol.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateSecurityGroupRuleProtocol.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateSecurityGroupRuleProtocol` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `protocol` if (jsonObj.get("protocol") != null && !jsonObj.get("protocol").isJsonNull()) { @@ -163,6 +204,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateSecurityGroupRuleProtocol 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); } @@ -171,7 +236,42 @@ public CreateSecurityGroupRuleProtocol read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateSecurityGroupRuleProtocol 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworking.java index e1b3ef0d..5b8080ea 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworking.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworking.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -33,7 +33,7 @@ /** The initial networking setup for the server creation with a network. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateServerNetworking { public static final String SERIALIZED_NAME_NETWORK_ID = "networkId"; @@ -120,6 +120,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateServerNetworking is not found in the empty JSON string", CreateServerNetworking.openapiRequiredFields.toString())); } @@ -131,8 +132,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!CreateServerNetworking.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `CreateServerNetworking` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); + entry.getKey(), + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -140,6 +143,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("networkId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `networkId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkId").toString())); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworkingWithNics.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworkingWithNics.java index 61df2e35..c513993a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworkingWithNics.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworkingWithNics.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -35,7 +35,7 @@ /** The initial networking setup for the server creation with a network interface. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateServerNetworkingWithNics { public static final String SERIALIZED_NAME_NIC_IDS = "nicIds"; @@ -132,6 +132,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateServerNetworkingWithNics is not found in the empty JSON string", CreateServerNetworkingWithNics.openapiRequiredFields.toString())); } @@ -143,8 +144,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!CreateServerNetworkingWithNics.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `CreateServerNetworkingWithNics` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); + entry.getKey(), + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -154,6 +157,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("nicIds").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `nicIds` to be an array in the JSON string but got `%s`", jsonObj.get("nicIds").toString())); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayload.java index f2b25180..1e5aeba8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,17 +27,17 @@ 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.Set; import java.util.UUID; -/** Representation of a single server object. */ +/** Object that represents the request body for a server create. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateServerPayload { public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; @@ -119,7 +119,8 @@ public class CreateServerPayload { public static final String SERIALIZED_NAME_NETWORKING = "networking"; @SerializedName(SERIALIZED_NAME_NETWORKING) - @javax.annotation.Nullable private CreateServerPayloadNetworking networking; + @javax.annotation.Nonnull + private CreateServerPayloadAllOfNetworking networking; public static final String SERIALIZED_NAME_NICS = "nics"; @@ -333,7 +334,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -422,7 +424,7 @@ public void setName(@javax.annotation.Nonnull String name) { } public CreateServerPayload networking( - @javax.annotation.Nullable CreateServerPayloadNetworking networking) { + @javax.annotation.Nonnull CreateServerPayloadAllOfNetworking networking) { this.networking = networking; return this; } @@ -432,11 +434,13 @@ public CreateServerPayload networking( * * @return networking */ - @javax.annotation.Nullable public CreateServerPayloadNetworking getNetworking() { + @javax.annotation.Nonnull + public CreateServerPayloadAllOfNetworking getNetworking() { return networking; } - public void setNetworking(@javax.annotation.Nullable CreateServerPayloadNetworking networking) { + public void setNetworking( + @javax.annotation.Nonnull CreateServerPayloadAllOfNetworking networking) { this.networking = networking; } @@ -584,6 +588,50 @@ public void setVolumes(@javax.annotation.Nullable List volumes) { this.volumes = volumes; } + /** + * 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 CreateServerPayload instance itself + */ + public CreateServerPayload 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) { @@ -616,7 +664,9 @@ public boolean equals(Object o) { && Objects.equals(this.status, createServerPayload.status) && Objects.equals(this.updatedAt, createServerPayload.updatedAt) && Arrays.equals(this.userData, createServerPayload.userData) - && Objects.equals(this.volumes, createServerPayload.volumes); + && Objects.equals(this.volumes, createServerPayload.volumes) + && Objects.equals( + this.additionalProperties, createServerPayload.additionalProperties); } @Override @@ -645,7 +695,8 @@ public int hashCode() { status, updatedAt, Arrays.hashCode(userData), - volumes); + volumes, + additionalProperties); } @Override @@ -680,6 +731,9 @@ public String toString() { sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); sb.append(" volumes: ").append(toIndentedString(volumes)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -729,7 +783,8 @@ private String toIndentedString(Object o) { "volumes")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("machineType", "name")); + openapiRequiredFields = + new HashSet(Arrays.asList("machineType", "name", "networking")); } /** @@ -744,29 +799,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateServerPayload is not found in the empty JSON string", CreateServerPayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateServerPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateServerPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateServerPayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -774,6 +821,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("affinityGroup").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `affinityGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("affinityGroup").toString())); } @@ -786,6 +834,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("availabilityZone").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `availabilityZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("availabilityZone").toString())); } @@ -797,6 +846,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("errorMessage").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `errorMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorMessage").toString())); } @@ -804,6 +854,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -811,6 +862,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("imageId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `imageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imageId").toString())); } @@ -818,12 +870,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("keypairName").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `keypairName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keypairName").toString())); } if (!jsonObj.get("machineType").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `machineType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("machineType").toString())); } @@ -835,13 +889,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } - // validate the optional field `networking` - if (jsonObj.get("networking") != null && !jsonObj.get("networking").isJsonNull()) { - CreateServerPayloadNetworking.validateJsonElement(jsonObj.get("networking")); - } + // validate the required field `networking` + CreateServerPayloadAllOfNetworking.validateJsonElement(jsonObj.get("networking")); if (jsonObj.get("nics") != null && !jsonObj.get("nics").isJsonNull()) { JsonArray jsonArraynics = jsonObj.getAsJsonArray("nics"); if (jsonArraynics != null) { @@ -849,6 +902,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("nics").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `nics` to be an array in the JSON string but got `%s`", jsonObj.get("nics").toString())); } @@ -864,6 +918,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("powerStatus").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `powerStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("powerStatus").toString())); } @@ -873,6 +928,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("securityGroups").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", jsonObj.get("securityGroups").toString())); } @@ -882,6 +938,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("serviceAccountMails").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `serviceAccountMails` to be an array in the JSON string but got `%s`", jsonObj.get("serviceAccountMails").toString())); } @@ -889,6 +946,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -898,6 +956,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("volumes").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `volumes` to be an array in the JSON string but got `%s`", jsonObj.get("volumes").toString())); } @@ -920,6 +979,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateServerPayload 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); } @@ -927,7 +1010,41 @@ public void write(JsonWriter out, CreateServerPayload value) public CreateServerPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateServerPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayloadAllOfNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayloadAllOfNetworking.java new file mode 100644 index 00000000..2de41fc5 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayloadAllOfNetworking.java @@ -0,0 +1,304 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class CreateServerPayloadAllOfNetworking extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(CreateServerPayloadAllOfNetworking.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateServerPayloadAllOfNetworking.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateServerPayloadAllOfNetworking' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterCreateServerNetworking = + gson.getDelegateAdapter(this, TypeToken.get(CreateServerNetworking.class)); + final TypeAdapter + adapterCreateServerNetworkingWithNics = + gson.getDelegateAdapter( + this, TypeToken.get(CreateServerNetworkingWithNics.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateServerPayloadAllOfNetworking value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `CreateServerNetworking` + if (value.getActualInstance() instanceof CreateServerNetworking) { + JsonElement element = + adapterCreateServerNetworking.toJsonTree( + (CreateServerNetworking) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `CreateServerNetworkingWithNics` + if (value.getActualInstance() + instanceof CreateServerNetworkingWithNics) { + JsonElement element = + adapterCreateServerNetworkingWithNics.toJsonTree( + (CreateServerNetworkingWithNics) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas: CreateServerNetworking, CreateServerNetworkingWithNics"); + } + + @Override + public CreateServerPayloadAllOfNetworking read(JsonReader in) + throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize CreateServerNetworking + try { + // validate the JSON object to see if any exception is thrown + CreateServerNetworking.validateJsonElement(jsonElement); + actualAdapter = adapterCreateServerNetworking; + match++; + log.log( + Level.FINER, + "Input data matches schema 'CreateServerNetworking'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateServerNetworking failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'CreateServerNetworking'", + e); + } + // deserialize CreateServerNetworkingWithNics + try { + // validate the JSON object to see if any exception is thrown + CreateServerNetworkingWithNics.validateJsonElement(jsonElement); + actualAdapter = adapterCreateServerNetworkingWithNics; + match++; + log.log( + Level.FINER, + "Input data matches schema 'CreateServerNetworkingWithNics'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateServerNetworkingWithNics failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'CreateServerNetworkingWithNics'", + e); + } + + if (match == 1) { + CreateServerPayloadAllOfNetworking ret = + new CreateServerPayloadAllOfNetworking(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + java.util.Locale.ROOT, + "Failed deserialization for CreateServerPayloadAllOfNetworking: %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 CreateServerPayloadAllOfNetworking() { + super("oneOf", Boolean.FALSE); + } + + public CreateServerPayloadAllOfNetworking(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("CreateServerNetworking", CreateServerNetworking.class); + schemas.put("CreateServerNetworkingWithNics", CreateServerNetworkingWithNics.class); + } + + @Override + public Map> getSchemas() { + return CreateServerPayloadAllOfNetworking.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: CreateServerNetworking, CreateServerNetworkingWithNics + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof CreateServerNetworking) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateServerNetworkingWithNics) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be CreateServerNetworking, CreateServerNetworkingWithNics"); + } + + /** + * Get the actual instance, which can be the following: CreateServerNetworking, + * CreateServerNetworkingWithNics + * + * @return The actual instance (CreateServerNetworking, CreateServerNetworkingWithNics) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateServerNetworking`. If the actual instance is not + * `CreateServerNetworking`, the ClassCastException will be thrown. + * + * @return The actual instance of `CreateServerNetworking` + * @throws ClassCastException if the instance is not `CreateServerNetworking` + */ + public CreateServerNetworking getCreateServerNetworking() throws ClassCastException { + return (CreateServerNetworking) super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateServerNetworkingWithNics`. If the actual instance is not + * `CreateServerNetworkingWithNics`, the ClassCastException will be thrown. + * + * @return The actual instance of `CreateServerNetworkingWithNics` + * @throws ClassCastException if the instance is not `CreateServerNetworkingWithNics` + */ + public CreateServerNetworkingWithNics getCreateServerNetworkingWithNics() + throws ClassCastException { + return (CreateServerNetworkingWithNics) 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 + * CreateServerPayloadAllOfNetworking + */ + 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 CreateServerNetworking + try { + CreateServerNetworking.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateServerNetworking failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with CreateServerNetworkingWithNics + try { + CreateServerNetworkingWithNics.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for CreateServerNetworkingWithNics 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 CreateServerPayloadAllOfNetworking with oneOf schemas: CreateServerNetworking, CreateServerNetworkingWithNics. %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 CreateServerPayloadAllOfNetworking given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateServerPayloadAllOfNetworking + * @throws IOException if the JSON string is invalid with respect to + * CreateServerPayloadAllOfNetworking + */ + public static CreateServerPayloadAllOfNetworking fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateServerPayloadAllOfNetworking.class); + } + + /** + * Convert an instance of CreateServerPayloadAllOfNetworking 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/model/CreateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSnapshotPayload.java index 1245468c..a05aa21d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSnapshotPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,22 +25,28 @@ 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.Set; import java.util.UUID; /** Object that represents a snapshot. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateSnapshotPayload { 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_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -98,6 +104,24 @@ public CreateSnapshotPayload( return createdAt; } + public CreateSnapshotPayload 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; + } + /** * Universally Unique Identifier (UUID). * @@ -116,7 +140,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -194,6 +219,50 @@ public void setVolumeId(@javax.annotation.Nonnull UUID volumeId) { this.volumeId = volumeId; } + /** + * 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 CreateSnapshotPayload instance itself + */ + public CreateSnapshotPayload 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) { @@ -204,18 +273,31 @@ public boolean equals(Object o) { } CreateSnapshotPayload createSnapshotPayload = (CreateSnapshotPayload) o; return Objects.equals(this.createdAt, createSnapshotPayload.createdAt) + && Objects.equals(this.description, createSnapshotPayload.description) && Objects.equals(this.id, createSnapshotPayload.id) && Objects.equals(this.labels, createSnapshotPayload.labels) && Objects.equals(this.name, createSnapshotPayload.name) && Objects.equals(this.size, createSnapshotPayload.size) && Objects.equals(this.status, createSnapshotPayload.status) && Objects.equals(this.updatedAt, createSnapshotPayload.updatedAt) - && Objects.equals(this.volumeId, createSnapshotPayload.volumeId); + && Objects.equals(this.volumeId, createSnapshotPayload.volumeId) + && Objects.equals( + this.additionalProperties, createSnapshotPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(createdAt, id, labels, name, size, status, updatedAt, volumeId); + return Objects.hash( + createdAt, + description, + id, + labels, + name, + size, + status, + updatedAt, + volumeId, + additionalProperties); } @Override @@ -223,6 +305,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateSnapshotPayload {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -230,6 +313,9 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" volumeId: ").append(toIndentedString(volumeId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -254,6 +340,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "createdAt", + "description", "id", "labels", "name", @@ -278,36 +365,37 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateSnapshotPayload is not found in the empty JSON string", CreateSnapshotPayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateSnapshotPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateSnapshotPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateSnapshotPayload.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())); + 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())); + } 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())); } @@ -315,6 +403,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -322,12 +411,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } if (!jsonObj.get("volumeId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeId").toString())); } @@ -350,6 +441,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateSnapshotPayload 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); } @@ -357,7 +472,41 @@ public void write(JsonWriter out, CreateSnapshotPayload value) public CreateSnapshotPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateSnapshotPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateVolumePayload.java index 0ccef69e..6a275c81 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateVolumePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,10 +25,11 @@ 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.Set; import java.util.UUID; /** @@ -36,7 +37,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class CreateVolumePayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -259,7 +260,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -377,6 +379,50 @@ public void setSource(@javax.annotation.Nullable VolumeSource source) { 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 CreateVolumePayload instance itself + */ + public CreateVolumePayload 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) { @@ -402,7 +448,9 @@ public boolean equals(Object o) { && Objects.equals(this.size, createVolumePayload.size) && Objects.equals(this.source, createVolumePayload.source) && Objects.equals(this.status, createVolumePayload.status) - && Objects.equals(this.updatedAt, createVolumePayload.updatedAt); + && Objects.equals(this.updatedAt, createVolumePayload.updatedAt) + && Objects.equals( + this.additionalProperties, createVolumePayload.additionalProperties); } @Override @@ -423,7 +471,8 @@ public int hashCode() { size, source, status, - updatedAt); + updatedAt, + additionalProperties); } @Override @@ -448,6 +497,9 @@ public String toString() { sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -504,35 +556,28 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in CreateVolumePayload is not found in the empty JSON string", CreateVolumePayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateVolumePayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateVolumePayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateVolumePayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("availabilityZone").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `availabilityZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("availabilityZone").toString())); } @@ -540,6 +585,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -552,6 +598,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -563,6 +610,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -571,6 +619,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -578,6 +627,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("serverId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `serverId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverId").toString())); } @@ -589,6 +639,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -611,6 +662,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, CreateVolumePayload 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); } @@ -618,7 +693,41 @@ public void write(JsonWriter out, CreateVolumePayload value) public CreateVolumePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateVolumePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/DestinationCIDRv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/DestinationCIDRv4.java new file mode 100644 index 00000000..9ae12f57 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/DestinationCIDRv4.java @@ -0,0 +1,342 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; + +/** IPv4 Classless Inter-Domain Routing (CIDR) Object. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class DestinationCIDRv4 { + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_VALUE = "value"; + + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public DestinationCIDRv4() {} + + public DestinationCIDRv4 type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + public DestinationCIDRv4 value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * An CIDRv4 string. + * + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + /** + * 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 DestinationCIDRv4 instance itself + */ + public DestinationCIDRv4 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; + } + DestinationCIDRv4 destinationCIDRv4 = (DestinationCIDRv4) o; + return Objects.equals(this.type, destinationCIDRv4.type) + && Objects.equals(this.value, destinationCIDRv4.value) + && Objects.equals( + this.additionalProperties, destinationCIDRv4.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationCIDRv4 {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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("type", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "value")); + } + + /** + * 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 DestinationCIDRv4 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DestinationCIDRv4.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 DestinationCIDRv4 is not found in the empty JSON string", + DestinationCIDRv4.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationCIDRv4.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("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("value").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `value` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationCIDRv4.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationCIDRv4' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv4.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationCIDRv4 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 DestinationCIDRv4 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DestinationCIDRv4 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 DestinationCIDRv4 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationCIDRv4 + * @throws IOException if the JSON string is invalid with respect to DestinationCIDRv4 + */ + public static DestinationCIDRv4 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationCIDRv4.class); + } + + /** + * Convert an instance of DestinationCIDRv4 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/model/DestinationCIDRv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/DestinationCIDRv6.java new file mode 100644 index 00000000..aaeff173 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/DestinationCIDRv6.java @@ -0,0 +1,342 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; + +/** IPv6 Classless Inter-Domain Routing (CIDR) Object. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class DestinationCIDRv6 { + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_VALUE = "value"; + + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public DestinationCIDRv6() {} + + public DestinationCIDRv6 type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + public DestinationCIDRv6 value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * An CIDRv6 string. + * + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + /** + * 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 DestinationCIDRv6 instance itself + */ + public DestinationCIDRv6 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; + } + DestinationCIDRv6 destinationCIDRv6 = (DestinationCIDRv6) o; + return Objects.equals(this.type, destinationCIDRv6.type) + && Objects.equals(this.value, destinationCIDRv6.value) + && Objects.equals( + this.additionalProperties, destinationCIDRv6.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationCIDRv6 {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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("type", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "value")); + } + + /** + * 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 DestinationCIDRv6 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DestinationCIDRv6.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 DestinationCIDRv6 is not found in the empty JSON string", + DestinationCIDRv6.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationCIDRv6.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("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("value").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `value` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationCIDRv6.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationCIDRv6' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv6.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationCIDRv6 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 DestinationCIDRv6 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DestinationCIDRv6 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 DestinationCIDRv6 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationCIDRv6 + * @throws IOException if the JSON string is invalid with respect to DestinationCIDRv6 + */ + public static DestinationCIDRv6 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationCIDRv6.class); + } + + /** + * Convert an instance of DestinationCIDRv6 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/model/Error.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Error.java index 58ca9d02..cfb15cf9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Error.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Error.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Error with HTTP error code and an error message. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Error { public static final String SERIALIZED_NAME_CODE = "code"; @@ -86,6 +87,50 @@ public void setMsg(@javax.annotation.Nonnull String msg) { this.msg = msg; } + /** + * 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 Error instance itself + */ + public Error 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) { @@ -95,12 +140,14 @@ public boolean equals(Object o) { return false; } Error error = (Error) o; - return Objects.equals(this.code, error.code) && Objects.equals(this.msg, error.msg); + return Objects.equals(this.code, error.code) + && Objects.equals(this.msg, error.msg) + && Objects.equals(this.additionalProperties, error.additionalProperties); } @Override public int hashCode() { - return Objects.hash(code, msg); + return Objects.hash(code, msg, additionalProperties); } @Override @@ -109,6 +156,9 @@ public String toString() { sb.append("class Error {\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -147,35 +197,28 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Error is not found in the empty JSON string", Error.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Error.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Error` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Error.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("msg").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("msg").toString())); } @@ -197,6 +240,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Error 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); } @@ -204,7 +271,41 @@ public void write(JsonWriter out, Error value) throws IOException { public Error read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Error 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/GetServerLog200Response.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/GetServerLog200Response.java index 1937680b..dfc77bb4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/GetServerLog200Response.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/GetServerLog200Response.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** GetServerLog200Response */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class GetServerLog200Response { public static final String SERIALIZED_NAME_OUTPUT = "output"; @@ -59,6 +60,50 @@ public void setOutput(@javax.annotation.Nullable String output) { this.output = output; } + /** + * 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 GetServerLog200Response instance itself + */ + public GetServerLog200Response 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) { @@ -68,12 +113,14 @@ public boolean equals(Object o) { return false; } GetServerLog200Response getServerLog200Response = (GetServerLog200Response) o; - return Objects.equals(this.output, getServerLog200Response.output); + return Objects.equals(this.output, getServerLog200Response.output) + && Objects.equals( + this.additionalProperties, getServerLog200Response.additionalProperties); } @Override public int hashCode() { - return Objects.hash(output); + return Objects.hash(output, additionalProperties); } @Override @@ -81,6 +128,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GetServerLog200Response {\n"); sb.append(" output: ").append(toIndentedString(output)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -119,26 +169,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in GetServerLog200Response is not found in the empty JSON string", GetServerLog200Response.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetServerLog200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `GetServerLog200Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("output") != null && !jsonObj.get("output").isJsonNull()) && !jsonObj.get("output").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `output` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output").toString())); } @@ -162,6 +203,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, GetServerLog200Response 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); } @@ -169,7 +234,41 @@ public void write(JsonWriter out, GetServerLog200Response value) public GetServerLog200Response read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetServerLog200Response 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ICMPParameters.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ICMPParameters.java index 60b81691..cbe4ef3c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ICMPParameters.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ICMPParameters.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents ICMP parameters. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ICMPParameters { public static final String SERIALIZED_NAME_CODE = "code"; @@ -86,6 +87,50 @@ public void setType(@javax.annotation.Nonnull Long 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 ICMPParameters instance itself + */ + public ICMPParameters 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) { @@ -96,12 +141,13 @@ public boolean equals(Object o) { } ICMPParameters icMPParameters = (ICMPParameters) o; return Objects.equals(this.code, icMPParameters.code) - && Objects.equals(this.type, icMPParameters.type); + && Objects.equals(this.type, icMPParameters.type) + && Objects.equals(this.additionalProperties, icMPParameters.additionalProperties); } @Override public int hashCode() { - return Objects.hash(code, type); + return Objects.hash(code, type, additionalProperties); } @Override @@ -110,6 +156,9 @@ public String toString() { sb.append("class ICMPParameters {\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -148,29 +197,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ICMPParameters is not found in the empty JSON string", ICMPParameters.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ICMPParameters.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ICMPParameters` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ICMPParameters.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -192,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ICMPParameters 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); } @@ -199,7 +264,41 @@ public void write(JsonWriter out, ICMPParameters value) throws IOException { public ICMPParameters read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ICMPParameters 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Image.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Image.java index f51617df..daea55b4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Image.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Image.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,10 +25,11 @@ 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.Set; import java.util.UUID; /** @@ -36,7 +37,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Image { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -69,6 +70,11 @@ public class Image { @SerializedName(SERIALIZED_NAME_ID) @javax.annotation.Nullable private UUID id; + public static final String SERIALIZED_NAME_IMPORT_PROGRESS = "importProgress"; + + @SerializedName(SERIALIZED_NAME_IMPORT_PROGRESS) + @javax.annotation.Nullable private Long importProgress; + public static final String SERIALIZED_NAME_LABELS = "labels"; @SerializedName(SERIALIZED_NAME_LABELS) @@ -126,6 +132,7 @@ public Image( ImageChecksum checksum, OffsetDateTime createdAt, UUID id, + Long importProgress, UUID owner, String scope, Long size, @@ -135,6 +142,7 @@ public Image( this.checksum = checksum; this.createdAt = createdAt; this.id = id; + this.importProgress = importProgress; this.owner = owner; this.scope = scope; this.size = size; @@ -225,6 +233,15 @@ public void setDiskFormat(@javax.annotation.Nonnull String diskFormat) { return id; } + /** + * Indicates Image Import Progress in percent. + * + * @return importProgress + */ + @javax.annotation.Nullable public Long getImportProgress() { + return importProgress; + } + public Image labels(@javax.annotation.Nullable Object labels) { this.labels = labels; return this; @@ -234,7 +251,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -366,6 +384,50 @@ public void setProtected(@javax.annotation.Nullable Boolean _protected) { 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 Image instance itself + */ + public Image 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) { @@ -381,6 +443,7 @@ public boolean equals(Object o) { && Objects.equals(this.createdAt, image.createdAt) && Objects.equals(this.diskFormat, image.diskFormat) && Objects.equals(this.id, image.id) + && Objects.equals(this.importProgress, image.importProgress) && Objects.equals(this.labels, image.labels) && Objects.equals(this.minDiskSize, image.minDiskSize) && Objects.equals(this.minRam, image.minRam) @@ -390,7 +453,8 @@ public boolean equals(Object o) { && Objects.equals(this.scope, image.scope) && Objects.equals(this.size, image.size) && Objects.equals(this.status, image.status) - && Objects.equals(this.updatedAt, image.updatedAt); + && Objects.equals(this.updatedAt, image.updatedAt) + && Objects.equals(this.additionalProperties, image.additionalProperties); } @Override @@ -402,6 +466,7 @@ public int hashCode() { createdAt, diskFormat, id, + importProgress, labels, minDiskSize, minRam, @@ -411,7 +476,8 @@ public int hashCode() { scope, size, status, - updatedAt); + updatedAt, + additionalProperties); } @Override @@ -424,6 +490,7 @@ public String toString() { sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" diskFormat: ").append(toIndentedString(diskFormat)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" importProgress: ").append(toIndentedString(importProgress)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" minDiskSize: ").append(toIndentedString(minDiskSize)).append("\n"); sb.append(" minRam: ").append(toIndentedString(minRam)).append("\n"); @@ -434,6 +501,9 @@ public String toString() { sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -463,6 +533,7 @@ private String toIndentedString(Object o) { "createdAt", "diskFormat", "id", + "importProgress", "labels", "minDiskSize", "minRam", @@ -490,29 +561,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Image is not found in the empty JSON string", Image.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Image.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Image` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Image.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -531,6 +594,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("diskFormat").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `diskFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("diskFormat").toString())); } @@ -538,12 +602,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -551,6 +617,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("owner").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `owner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner").toString())); } @@ -558,6 +625,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("scope").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); } @@ -565,6 +633,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -586,6 +655,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Image 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); } @@ -593,7 +686,41 @@ public void write(JsonWriter out, Image value) throws IOException { public Image read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Image 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageAgent.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageAgent.java index 3ae646a8..356ab08b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageAgent.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageAgent.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Support status and default provioning setting for the STACKIT server agent. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ImageAgent { public static final String SERIALIZED_NAME_PROVISION_BY_DEFAULT = "provisionByDefault"; @@ -83,6 +84,50 @@ public void setSupported(@javax.annotation.Nullable Boolean supported) { this.supported = supported; } + /** + * 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 ImageAgent instance itself + */ + public ImageAgent 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) { @@ -93,12 +138,13 @@ public boolean equals(Object o) { } ImageAgent imageAgent = (ImageAgent) o; return Objects.equals(this.provisionByDefault, imageAgent.provisionByDefault) - && Objects.equals(this.supported, imageAgent.supported); + && Objects.equals(this.supported, imageAgent.supported) + && Objects.equals(this.additionalProperties, imageAgent.additionalProperties); } @Override public int hashCode() { - return Objects.hash(provisionByDefault, supported); + return Objects.hash(provisionByDefault, supported, additionalProperties); } @Override @@ -109,6 +155,9 @@ public String toString() { .append(toIndentedString(provisionByDefault)) .append("\n"); sb.append(" supported: ").append(toIndentedString(supported)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -147,21 +196,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ImageAgent is not found in the empty JSON string", ImageAgent.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ImageAgent.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ImageAgent` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } @@ -181,6 +220,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ImageAgent 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); } @@ -188,7 +251,41 @@ public void write(JsonWriter out, ImageAgent value) throws IOException { public ImageAgent read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImageAgent 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageChecksum.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageChecksum.java index 3205f1f9..78efa2ab 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageChecksum.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageChecksum.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Representation of an image checksum. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ImageChecksum { public static final String SERIALIZED_NAME_ALGORITHM = "algorithm"; @@ -87,6 +88,50 @@ public void setDigest(@javax.annotation.Nonnull String digest) { this.digest = digest; } + /** + * 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 ImageChecksum instance itself + */ + public ImageChecksum 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) { @@ -97,12 +142,13 @@ public boolean equals(Object o) { } ImageChecksum imageChecksum = (ImageChecksum) o; return Objects.equals(this.algorithm, imageChecksum.algorithm) - && Objects.equals(this.digest, imageChecksum.digest); + && Objects.equals(this.digest, imageChecksum.digest) + && Objects.equals(this.additionalProperties, imageChecksum.additionalProperties); } @Override public int hashCode() { - return Objects.hash(algorithm, digest); + return Objects.hash(algorithm, digest, additionalProperties); } @Override @@ -111,6 +157,9 @@ public String toString() { sb.append("class ImageChecksum {\n"); sb.append(" algorithm: ").append(toIndentedString(algorithm)).append("\n"); sb.append(" digest: ").append(toIndentedString(digest)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -149,41 +198,35 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ImageChecksum is not found in the empty JSON string", ImageChecksum.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ImageChecksum.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ImageChecksum` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ImageChecksum.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("algorithm").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `algorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("algorithm").toString())); } if (!jsonObj.get("digest").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `digest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("digest").toString())); } @@ -205,6 +248,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ImageChecksum 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); } @@ -212,7 +279,41 @@ public void write(JsonWriter out, ImageChecksum value) throws IOException { public ImageChecksum read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImageChecksum 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageConfig.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageConfig.java index eac38917..4f057fd7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageConfig.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageConfig.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,17 @@ 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; -import java.util.Set; import org.openapitools.jackson.nullable.JsonNullable; /** Properties to set hardware and scheduling settings for an Image. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ImageConfig { public static final String SERIALIZED_NAME_ARCHITECTURE = "architecture"; @@ -371,6 +372,50 @@ public void setVirtioScsi(@javax.annotation.Nullable Boolean virtioScsi) { this.virtioScsi = virtioScsi; } + /** + * 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 ImageConfig instance itself + */ + public ImageConfig 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) { @@ -393,7 +438,8 @@ public boolean equals(Object o) { && Objects.equals(this.secureBoot, imageConfig.secureBoot) && Objects.equals(this.uefi, imageConfig.uefi) && Objects.equals(this.videoModel, imageConfig.videoModel) - && Objects.equals(this.virtioScsi, imageConfig.virtioScsi); + && Objects.equals(this.virtioScsi, imageConfig.virtioScsi) + && Objects.equals(this.additionalProperties, imageConfig.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -421,7 +467,8 @@ public int hashCode() { secureBoot, uefi, videoModel, - virtioScsi); + virtioScsi, + additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -453,6 +500,9 @@ public String toString() { sb.append(" uefi: ").append(toIndentedString(uefi)).append("\n"); sb.append(" videoModel: ").append(toIndentedString(videoModel)).append("\n"); sb.append(" virtioScsi: ").append(toIndentedString(virtioScsi)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -507,26 +557,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ImageConfig is not found in the empty JSON string", ImageConfig.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ImageConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ImageConfig` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("architecture") != null && !jsonObj.get("architecture").isJsonNull()) && !jsonObj.get("architecture").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `architecture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("architecture").toString())); } @@ -534,6 +575,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("cdromBus").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `cdromBus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cdromBus").toString())); } @@ -541,6 +583,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("diskBus").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `diskBus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("diskBus").toString())); } @@ -548,6 +591,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("nicModel").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `nicModel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nicModel").toString())); } @@ -555,6 +599,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("operatingSystem").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `operatingSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operatingSystem").toString())); } @@ -563,6 +608,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("operatingSystemDistro").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `operatingSystemDistro` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operatingSystemDistro").toString())); } @@ -571,6 +617,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("operatingSystemVersion").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `operatingSystemVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operatingSystemVersion").toString())); } @@ -578,6 +625,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("rescueBus").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `rescueBus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rescueBus").toString())); } @@ -585,6 +633,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("rescueDevice").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `rescueDevice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rescueDevice").toString())); } @@ -592,6 +641,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("videoModel").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `videoModel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("videoModel").toString())); } @@ -613,6 +663,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ImageConfig 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); } @@ -620,7 +694,41 @@ public void write(JsonWriter out, ImageConfig value) throws IOException { public ImageConfig read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImageConfig 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageCreateResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageCreateResponse.java index ae688d01..c6b8e6d7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageCreateResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageCreateResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,16 +25,17 @@ import java.io.IOException; import java.net.URI; 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.Set; import java.util.UUID; /** Image creation response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ImageCreateResponse { public static final String SERIALIZED_NAME_ID = "id"; @@ -88,6 +89,50 @@ public void setUploadUrl(@javax.annotation.Nonnull URI uploadUrl) { this.uploadUrl = uploadUrl; } + /** + * 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 ImageCreateResponse instance itself + */ + public ImageCreateResponse 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) { @@ -98,12 +143,14 @@ public boolean equals(Object o) { } ImageCreateResponse imageCreateResponse = (ImageCreateResponse) o; return Objects.equals(this.id, imageCreateResponse.id) - && Objects.equals(this.uploadUrl, imageCreateResponse.uploadUrl); + && Objects.equals(this.uploadUrl, imageCreateResponse.uploadUrl) + && Objects.equals( + this.additionalProperties, imageCreateResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, uploadUrl); + return Objects.hash(id, uploadUrl, additionalProperties); } @Override @@ -112,6 +159,9 @@ public String toString() { sb.append("class ImageCreateResponse {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" uploadUrl: ").append(toIndentedString(uploadUrl)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -150,41 +200,35 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ImageCreateResponse is not found in the empty JSON string", ImageCreateResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ImageCreateResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ImageCreateResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ImageCreateResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); 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())); } if (!jsonObj.get("uploadUrl").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `uploadUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uploadUrl").toString())); } @@ -207,6 +251,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, ImageCreateResponse 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); } @@ -214,7 +282,41 @@ public void write(JsonWriter out, ImageCreateResponse value) public ImageCreateResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImageCreateResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageFromVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageFromVolumePayload.java new file mode 100644 index 00000000..43e7d2a8 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageFromVolumePayload.java @@ -0,0 +1,371 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 upload request of an image to a volume. Used for creating an image + * from a volume. + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class ImageFromVolumePayload { + public static final String SERIALIZED_NAME_DISK_FORMAT = "diskFormat"; + + @SerializedName(SERIALIZED_NAME_DISK_FORMAT) + @javax.annotation.Nonnull + private String diskFormat; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_PROTECTED = "protected"; + + @SerializedName(SERIALIZED_NAME_PROTECTED) + @javax.annotation.Nullable private Boolean _protected = false; + + public ImageFromVolumePayload() {} + + public ImageFromVolumePayload diskFormat(@javax.annotation.Nonnull String diskFormat) { + this.diskFormat = diskFormat; + return this; + } + + /** + * Object that represents a disk format. Possible values: `raw`, `qcow2`, + * `iso`. + * + * @return diskFormat + */ + @javax.annotation.Nonnull + public String getDiskFormat() { + return diskFormat; + } + + public void setDiskFormat(@javax.annotation.Nonnull String diskFormat) { + this.diskFormat = diskFormat; + } + + public ImageFromVolumePayload 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; + } + + public ImageFromVolumePayload _protected(@javax.annotation.Nullable Boolean _protected) { + this._protected = _protected; + return this; + } + + /** + * When true the created image is prevented from being deleted. + * + * @return _protected + */ + @javax.annotation.Nullable public Boolean getProtected() { + return _protected; + } + + public void setProtected(@javax.annotation.Nullable Boolean _protected) { + this._protected = _protected; + } + + /** + * 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 ImageFromVolumePayload instance itself + */ + public ImageFromVolumePayload 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; + } + ImageFromVolumePayload imageFromVolumePayload = (ImageFromVolumePayload) o; + return Objects.equals(this.diskFormat, imageFromVolumePayload.diskFormat) + && Objects.equals(this.name, imageFromVolumePayload.name) + && Objects.equals(this._protected, imageFromVolumePayload._protected) + && Objects.equals( + this.additionalProperties, imageFromVolumePayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(diskFormat, name, _protected, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageFromVolumePayload {\n"); + sb.append(" diskFormat: ").append(toIndentedString(diskFormat)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" _protected: ").append(toIndentedString(_protected)).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("diskFormat", "name", "protected")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("diskFormat", "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 ImageFromVolumePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImageFromVolumePayload.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 ImageFromVolumePayload is not found in the empty JSON string", + ImageFromVolumePayload.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ImageFromVolumePayload.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("diskFormat").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `diskFormat` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("diskFormat").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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImageFromVolumePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImageFromVolumePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ImageFromVolumePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ImageFromVolumePayload 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 ImageFromVolumePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImageFromVolumePayload 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 ImageFromVolumePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImageFromVolumePayload + * @throws IOException if the JSON string is invalid with respect to ImageFromVolumePayload + */ + public static ImageFromVolumePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImageFromVolumePayload.class); + } + + /** + * Convert an instance of ImageFromVolumePayload 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/model/ImageListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageListResponse.java index 4301a067..fb377065 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Image list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ImageListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 ImageListResponse instance itself + */ + public ImageListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } ImageListResponse imageListResponse = (ImageListResponse) o; - return Objects.equals(this.items, imageListResponse.items); + return Objects.equals(this.items, imageListResponse.items) + && Objects.equals( + this.additionalProperties, imageListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ImageListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ImageListResponse is not found in the empty JSON string", ImageListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ImageListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ImageListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ImageListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -191,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, ImageListResponse 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); } @@ -198,7 +264,41 @@ public void write(JsonWriter out, ImageListResponse value) public ImageListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImageListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShare.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShare.java index 09dfac1e..d888146a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShare.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShare.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,11 +25,11 @@ 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; -import java.util.Set; import java.util.UUID; /** @@ -37,7 +37,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ImageShare { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -95,6 +95,50 @@ public void setProjects(@javax.annotation.Nullable List projects) { this.projects = projects; } + /** + * 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 ImageShare instance itself + */ + public ImageShare 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) { @@ -105,12 +149,13 @@ public boolean equals(Object o) { } ImageShare imageShare = (ImageShare) o; return Objects.equals(this.parentOrganization, imageShare.parentOrganization) - && Objects.equals(this.projects, imageShare.projects); + && Objects.equals(this.projects, imageShare.projects) + && Objects.equals(this.additionalProperties, imageShare.additionalProperties); } @Override public int hashCode() { - return Objects.hash(parentOrganization, projects); + return Objects.hash(parentOrganization, projects, additionalProperties); } @Override @@ -121,6 +166,9 @@ public String toString() { .append(toIndentedString(parentOrganization)) .append("\n"); sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -159,21 +207,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ImageShare is not found in the empty JSON string", ImageShare.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ImageShare.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ImageShare` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the optional json data is an array if present if (jsonObj.get("projects") != null @@ -181,6 +219,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("projects").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `projects` to be an array in the JSON string but got `%s`", jsonObj.get("projects").toString())); } @@ -202,6 +241,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ImageShare 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); } @@ -209,7 +272,41 @@ public void write(JsonWriter out, ImageShare value) throws IOException { public ImageShare read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImageShare 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShareConsumer.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShareConsumer.java index ce603995..6afcaf53 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShareConsumer.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShareConsumer.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,16 +25,17 @@ 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.Set; import java.util.UUID; /** The details of an Image share consumer. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ImageShareConsumer { public static final String SERIALIZED_NAME_CONSUMER_PROJECT_ID = "consumerProjectId"; @@ -106,6 +107,50 @@ public ImageShareConsumer( 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 ImageShareConsumer instance itself + */ + public ImageShareConsumer 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) { @@ -118,12 +163,14 @@ public boolean equals(Object o) { return Objects.equals(this.consumerProjectId, imageShareConsumer.consumerProjectId) && Objects.equals(this.createdAt, imageShareConsumer.createdAt) && Objects.equals(this.imageId, imageShareConsumer.imageId) - && Objects.equals(this.updatedAt, imageShareConsumer.updatedAt); + && Objects.equals(this.updatedAt, imageShareConsumer.updatedAt) + && Objects.equals( + this.additionalProperties, imageShareConsumer.additionalProperties); } @Override public int hashCode() { - return Objects.hash(consumerProjectId, createdAt, imageId, updatedAt); + return Objects.hash(consumerProjectId, createdAt, imageId, updatedAt, additionalProperties); } @Override @@ -136,6 +183,9 @@ public String toString() { sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" imageId: ").append(toIndentedString(imageId)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -176,27 +226,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ImageShareConsumer is not found in the empty JSON string", ImageShareConsumer.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ImageShareConsumer.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ImageShareConsumer` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("consumerProjectId") != null && !jsonObj.get("consumerProjectId").isJsonNull()) && !jsonObj.get("consumerProjectId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `consumerProjectId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("consumerProjectId").toString())); } @@ -204,6 +245,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("imageId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `imageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imageId").toString())); } @@ -226,6 +268,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, ImageShareConsumer 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); } @@ -233,7 +299,41 @@ public void write(JsonWriter out, ImageShareConsumer value) public ImageShareConsumer read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ImageShareConsumer 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/KeyPairListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/KeyPairListResponse.java index 887372fa..484a036b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/KeyPairListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/KeyPairListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** SSH keypair list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class KeyPairListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 KeyPairListResponse instance itself + */ + public KeyPairListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } KeyPairListResponse keyPairListResponse = (KeyPairListResponse) o; - return Objects.equals(this.items, keyPairListResponse.items); + return Objects.equals(this.items, keyPairListResponse.items) + && Objects.equals( + this.additionalProperties, keyPairListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class KeyPairListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in KeyPairListResponse is not found in the empty JSON string", KeyPairListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!KeyPairListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `KeyPairListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : KeyPairListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -191,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, KeyPairListResponse 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); } @@ -198,7 +264,41 @@ public void write(JsonWriter out, KeyPairListResponse value) public KeyPairListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + KeyPairListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Keypair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Keypair.java index f918230b..ff232c2d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Keypair.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Keypair.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,15 +25,16 @@ 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.Set; /** Object that represents the public key of an SSH keypair and its name. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Keypair { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -102,7 +103,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -161,6 +163,50 @@ public void setPublicKey(@javax.annotation.Nonnull String publicKey) { 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 Keypair instance itself + */ + public Keypair 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) { @@ -175,12 +221,14 @@ public boolean equals(Object o) { && Objects.equals(this.labels, keypair.labels) && Objects.equals(this.name, keypair.name) && Objects.equals(this.publicKey, keypair.publicKey) - && Objects.equals(this.updatedAt, keypair.updatedAt); + && Objects.equals(this.updatedAt, keypair.updatedAt) + && Objects.equals(this.additionalProperties, keypair.additionalProperties); } @Override public int hashCode() { - return Objects.hash(createdAt, fingerprint, labels, name, publicKey, updatedAt); + return Objects.hash( + createdAt, fingerprint, labels, name, publicKey, updatedAt, additionalProperties); } @Override @@ -193,6 +241,9 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -239,29 +290,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Keypair is not found in the empty JSON string", Keypair.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Keypair.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Keypair` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Keypair.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -269,6 +312,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("fingerprint").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); } @@ -276,12 +320,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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("publicKey").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); } @@ -303,6 +349,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Keypair 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); } @@ -310,7 +380,41 @@ public void write(JsonWriter out, Keypair value) throws IOException { public Keypair read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Keypair 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineType.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineType.java index e0a0a8ae..78aeef17 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineType.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineType.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,10 +24,11 @@ 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; -import java.util.Set; /** * Machine Type. Filterable Fields: `disk`, `extraSpecs`, `name`, @@ -35,7 +36,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class MachineType { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -185,6 +186,50 @@ public void setVcpus(@javax.annotation.Nonnull Long vcpus) { this.vcpus = vcpus; } + /** + * 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 MachineType instance itself + */ + public MachineType 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) { @@ -199,12 +244,13 @@ public boolean equals(Object o) { && Objects.equals(this.extraSpecs, machineType.extraSpecs) && Objects.equals(this.name, machineType.name) && Objects.equals(this.ram, machineType.ram) - && Objects.equals(this.vcpus, machineType.vcpus); + && Objects.equals(this.vcpus, machineType.vcpus) + && Objects.equals(this.additionalProperties, machineType.additionalProperties); } @Override public int hashCode() { - return Objects.hash(description, disk, extraSpecs, name, ram, vcpus); + return Objects.hash(description, disk, extraSpecs, name, ram, vcpus, additionalProperties); } @Override @@ -217,6 +263,9 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" ram: ").append(toIndentedString(ram)).append("\n"); sb.append(" vcpus: ").append(toIndentedString(vcpus)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -257,29 +306,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in MachineType is not found in the empty JSON string", MachineType.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MachineType.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `MachineType` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : MachineType.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -287,12 +328,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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("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())); } @@ -314,6 +357,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, MachineType 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); } @@ -321,7 +388,41 @@ public void write(JsonWriter out, MachineType value) throws IOException { public MachineType read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MachineType 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineTypeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineTypeListResponse.java index 59d7aa49..ee9b724b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineTypeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineTypeListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Machine type list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class MachineTypeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 MachineTypeListResponse instance itself + */ + public MachineTypeListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } MachineTypeListResponse machineTypeListResponse = (MachineTypeListResponse) o; - return Objects.equals(this.items, machineTypeListResponse.items); + return Objects.equals(this.items, machineTypeListResponse.items) + && Objects.equals( + this.additionalProperties, machineTypeListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class MachineTypeListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in MachineTypeListResponse is not found in the empty JSON string", MachineTypeListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MachineTypeListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `MachineTypeListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : MachineTypeListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -192,6 +234,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, MachineTypeListResponse 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); } @@ -199,7 +265,41 @@ public void write(JsonWriter out, MachineTypeListResponse value) public MachineTypeListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MachineTypeListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NIC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NIC.java index 9742df40..bd7c3792 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NIC.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NIC.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,17 +26,17 @@ 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; -import java.util.Set; import java.util.UUID; /** Object that represents a network interface. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class NIC { public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; @@ -229,7 +229,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -340,6 +341,50 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return 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 NIC instance itself + */ + public NIC 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) { @@ -362,7 +407,8 @@ public boolean equals(Object o) { && Objects.equals(this.nicSecurity, NIC.nicSecurity) && Objects.equals(this.securityGroups, NIC.securityGroups) && Objects.equals(this.status, NIC.status) - && Objects.equals(this.type, NIC.type); + && Objects.equals(this.type, NIC.type) + && Objects.equals(this.additionalProperties, NIC.additionalProperties); } @Override @@ -381,7 +427,8 @@ public int hashCode() { nicSecurity, securityGroups, status, - type); + type, + additionalProperties); } @Override @@ -402,6 +449,9 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -456,21 +506,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in NIC is not found in the empty JSON string", NIC.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NIC.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `NIC` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("allowedAddresses") != null && !jsonObj.get("allowedAddresses").isJsonNull()) { @@ -480,6 +520,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("allowedAddresses").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `allowedAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedAddresses").toString())); } @@ -495,6 +536,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -502,6 +544,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("device").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `device` to be a primitive type in the JSON string but got `%s`", jsonObj.get("device").toString())); } @@ -509,6 +552,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -516,6 +560,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ipv4").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ipv4` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipv4").toString())); } @@ -523,6 +568,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ipv6").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ipv6` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipv6").toString())); } @@ -530,6 +576,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("mac").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `mac` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mac").toString())); } @@ -537,6 +584,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -544,6 +592,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("networkId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `networkId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkId").toString())); } @@ -553,6 +602,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("securityGroups").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", jsonObj.get("securityGroups").toString())); } @@ -560,6 +610,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -567,6 +618,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -588,6 +640,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, NIC 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); } @@ -595,7 +671,41 @@ public void write(JsonWriter out, NIC value) throws IOException { public NIC read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NIC 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NICListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NICListResponse.java index 3210f011..1c475a7c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NICListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NICListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** NIC list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class NICListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 NICListResponse instance itself + */ + public NICListResponse 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) { @@ -81,12 +125,13 @@ public boolean equals(Object o) { return false; } NICListResponse niCListResponse = (NICListResponse) o; - return Objects.equals(this.items, niCListResponse.items); + return Objects.equals(this.items, niCListResponse.items) + && Objects.equals(this.additionalProperties, niCListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +139,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NICListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +180,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in NICListResponse is not found in the empty JSON string", NICListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NICListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `NICListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NICListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +202,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -191,6 +232,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, NICListResponse 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); } @@ -198,7 +263,41 @@ public void write(JsonWriter out, NICListResponse value) public NICListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NICListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Network.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Network.java index 5ce19550..bc53f773 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Network.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Network.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,20 +24,21 @@ 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.Set; import java.util.UUID; -import org.openapitools.jackson.nullable.JsonNullable; -/** Object that represents a network. */ +/** + * Object that represents a network. If no routing table is specified, the default routing table is + * used. + */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Network { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -49,15 +50,21 @@ public class Network { @SerializedName(SERIALIZED_NAME_DHCP) @javax.annotation.Nullable private Boolean dhcp; - public static final String SERIALIZED_NAME_GATEWAY = "gateway"; + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private UUID id; - @SerializedName(SERIALIZED_NAME_GATEWAY) - @javax.annotation.Nullable private String gateway; + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; - public static final String SERIALIZED_NAME_GATEWAYV6 = "gatewayv6"; + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private NetworkIPv4 ipv4; - @SerializedName(SERIALIZED_NAME_GATEWAYV6) - @javax.annotation.Nullable private String gatewayv6; + public static final String SERIALIZED_NAME_IPV6 = "ipv6"; + + @SerializedName(SERIALIZED_NAME_IPV6) + @javax.annotation.Nullable private NetworkIPv6 ipv6; public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -70,47 +77,21 @@ public class Network { @javax.annotation.Nonnull private String name; - public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS) - @javax.annotation.Nullable private List nameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_NAMESERVERS_V6 = "nameserversV6"; - - @SerializedName(SERIALIZED_NAME_NAMESERVERS_V6) - @javax.annotation.Nullable private List nameserversV6 = new ArrayList<>(); - - public static final String SERIALIZED_NAME_NETWORK_ID = "networkId"; - - @SerializedName(SERIALIZED_NAME_NETWORK_ID) - @javax.annotation.Nonnull - private UUID networkId; - - public static final String SERIALIZED_NAME_PREFIXES = "prefixes"; - - @SerializedName(SERIALIZED_NAME_PREFIXES) - @javax.annotation.Nullable private List prefixes = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PREFIXES_V6 = "prefixesV6"; - - @SerializedName(SERIALIZED_NAME_PREFIXES_V6) - @javax.annotation.Nullable private List prefixesV6 = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PUBLIC_IP = "publicIp"; - - @SerializedName(SERIALIZED_NAME_PUBLIC_IP) - @javax.annotation.Nullable private String publicIp; - public static final String SERIALIZED_NAME_ROUTED = "routed"; @SerializedName(SERIALIZED_NAME_ROUTED) @javax.annotation.Nullable private Boolean routed; - public static final String SERIALIZED_NAME_STATE = "state"; + public static final String SERIALIZED_NAME_ROUTING_TABLE_ID = "routingTableId"; + + @SerializedName(SERIALIZED_NAME_ROUTING_TABLE_ID) + @javax.annotation.Nullable private UUID routingTableId; - @SerializedName(SERIALIZED_NAME_STATE) + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) @javax.annotation.Nonnull - private String state; + private String status; public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; @@ -152,42 +133,59 @@ public void setDhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; } - public Network gateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; + public Network 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 Network ipv4(@javax.annotation.Nullable NetworkIPv4 ipv4) { + this.ipv4 = ipv4; return this; } /** - * The gateway of a network. If not specified the first IP of the network will be assigned as - * the gateway. If 'null' is sent, then the network doesn't have a gateway. + * Get ipv4 * - * @return gateway + * @return ipv4 */ - @javax.annotation.Nullable public String getGateway() { - return gateway; + @javax.annotation.Nullable public NetworkIPv4 getIpv4() { + return ipv4; } - public void setGateway(@javax.annotation.Nullable String gateway) { - this.gateway = gateway; + public void setIpv4(@javax.annotation.Nullable NetworkIPv4 ipv4) { + this.ipv4 = ipv4; } - public Network gatewayv6(@javax.annotation.Nullable String gatewayv6) { - this.gatewayv6 = gatewayv6; + public Network ipv6(@javax.annotation.Nullable NetworkIPv6 ipv6) { + this.ipv6 = ipv6; return this; } /** - * The gateway of a network. If not specified the first IP of the network will be assigned as - * the gateway. If 'null' is sent, then the network doesn't have a gateway. + * Get ipv6 * - * @return gatewayv6 + * @return ipv6 */ - @javax.annotation.Nullable public String getGatewayv6() { - return gatewayv6; + @javax.annotation.Nullable public NetworkIPv6 getIpv6() { + return ipv6; } - public void setGatewayv6(@javax.annotation.Nullable String gatewayv6) { - this.gatewayv6 = gatewayv6; + public void setIpv6(@javax.annotation.Nullable NetworkIPv6 ipv6) { + this.ipv6 = ipv6; } public Network labels(@javax.annotation.Nullable Object labels) { @@ -199,7 +197,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -230,193 +229,114 @@ public void setName(@javax.annotation.Nonnull String name) { this.name = name; } - public Network nameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; - return this; - } - - public Network addNameserversItem(String nameserversItem) { - if (this.nameservers == null) { - this.nameservers = new ArrayList<>(); - } - this.nameservers.add(nameserversItem); + public Network routed(@javax.annotation.Nullable Boolean routed) { + this.routed = routed; return this; } /** - * A list containing DNS Servers/Nameservers for IPv4. + * Shows if the network is routed and therefore accessible from other networks. * - * @return nameservers + * @return routed */ - @javax.annotation.Nullable public List getNameservers() { - return nameservers; - } - - public void setNameservers(@javax.annotation.Nullable List nameservers) { - this.nameservers = nameservers; + @javax.annotation.Nullable public Boolean getRouted() { + return routed; } - public Network nameserversV6(@javax.annotation.Nullable List nameserversV6) { - this.nameserversV6 = nameserversV6; - return this; + public void setRouted(@javax.annotation.Nullable Boolean routed) { + this.routed = routed; } - public Network addNameserversV6Item(String nameserversV6Item) { - if (this.nameserversV6 == null) { - this.nameserversV6 = new ArrayList<>(); - } - this.nameserversV6.add(nameserversV6Item); + public Network routingTableId(@javax.annotation.Nullable UUID routingTableId) { + this.routingTableId = routingTableId; return this; } /** - * A list containing DNS Servers/Nameservers for IPv6. + * Universally Unique Identifier (UUID). * - * @return nameserversV6 + * @return routingTableId */ - @javax.annotation.Nullable public List getNameserversV6() { - return nameserversV6; + @javax.annotation.Nullable public UUID getRoutingTableId() { + return routingTableId; } - public void setNameserversV6(@javax.annotation.Nullable List nameserversV6) { - this.nameserversV6 = nameserversV6; + public void setRoutingTableId(@javax.annotation.Nullable UUID routingTableId) { + this.routingTableId = routingTableId; } - public Network networkId(@javax.annotation.Nonnull UUID networkId) { - this.networkId = networkId; + public Network status(@javax.annotation.Nonnull String status) { + this.status = status; return this; } /** - * Universally Unique Identifier (UUID). + * The state of a resource object. Possible values: `CREATING`, `CREATED`, + * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, + * `UPDATING`. * - * @return networkId + * @return status */ @javax.annotation.Nonnull - public UUID getNetworkId() { - return networkId; + public String getStatus() { + return status; } - public void setNetworkId(@javax.annotation.Nonnull UUID networkId) { - this.networkId = networkId; - } - - public Network prefixes(@javax.annotation.Nullable List prefixes) { - this.prefixes = prefixes; - return this; - } - - public Network addPrefixesItem(String prefixesItem) { - if (this.prefixes == null) { - this.prefixes = new ArrayList<>(); - } - this.prefixes.add(prefixesItem); - return this; + public void setStatus(@javax.annotation.Nonnull String status) { + this.status = status; } /** - * Get prefixes - * - * @return prefixes - */ - @javax.annotation.Nullable public List getPrefixes() { - return prefixes; - } - - public void setPrefixes(@javax.annotation.Nullable List prefixes) { - this.prefixes = prefixes; - } - - public Network prefixesV6(@javax.annotation.Nullable List prefixesV6) { - this.prefixesV6 = prefixesV6; - return this; - } - - public Network addPrefixesV6Item(String prefixesV6Item) { - if (this.prefixesV6 == null) { - this.prefixesV6 = new ArrayList<>(); - } - this.prefixesV6.add(prefixesV6Item); - return this; - } - - /** - * Get prefixesV6 + * Date-time when resource was last updated. * - * @return prefixesV6 + * @return updatedAt */ - @javax.annotation.Nullable public List getPrefixesV6() { - return prefixesV6; - } - - public void setPrefixesV6(@javax.annotation.Nullable List prefixesV6) { - this.prefixesV6 = prefixesV6; - } - - public Network publicIp(@javax.annotation.Nullable String publicIp) { - this.publicIp = publicIp; - return this; + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; } /** - * Object that represents an IP address. - * - * @return publicIp + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. */ - @javax.annotation.Nullable public String getPublicIp() { - return publicIp; - } - - public void setPublicIp(@javax.annotation.Nullable String publicIp) { - this.publicIp = publicIp; - } - - public Network routed(@javax.annotation.Nullable Boolean routed) { - this.routed = routed; - return this; - } + private Map additionalProperties; /** - * Shows if the network is routed and therefore accessible from other networks. + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. * - * @return routed + * @param key name of the property + * @param value value of the property + * @return the Network instance itself */ - @javax.annotation.Nullable public Boolean getRouted() { - return routed; - } - - public void setRouted(@javax.annotation.Nullable Boolean routed) { - this.routed = routed; - } - - public Network state(@javax.annotation.Nonnull String state) { - this.state = state; + public Network putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); return this; } /** - * The state of a resource object. Possible values: `CREATING`, `CREATED`, - * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, - * `UPDATING`. + * Return the additional (undeclared) property. * - * @return state + * @return a map of objects */ - @javax.annotation.Nonnull - public String getState() { - return state; - } - - public void setState(@javax.annotation.Nonnull String state) { - this.state = state; + public Map getAdditionalProperties() { + return additionalProperties; } /** - * Date-time when resource was last updated. + * Return the additional (undeclared) property with the specified name. * - * @return updatedAt + * @param key name of the property + * @return an object */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); } @Override @@ -430,28 +350,16 @@ public boolean equals(Object o) { Network network = (Network) o; return Objects.equals(this.createdAt, network.createdAt) && Objects.equals(this.dhcp, network.dhcp) - && Objects.equals(this.gateway, network.gateway) - && Objects.equals(this.gatewayv6, network.gatewayv6) + && Objects.equals(this.id, network.id) + && Objects.equals(this.ipv4, network.ipv4) + && Objects.equals(this.ipv6, network.ipv6) && Objects.equals(this.labels, network.labels) && Objects.equals(this.name, network.name) - && Objects.equals(this.nameservers, network.nameservers) - && Objects.equals(this.nameserversV6, network.nameserversV6) - && Objects.equals(this.networkId, network.networkId) - && Objects.equals(this.prefixes, network.prefixes) - && Objects.equals(this.prefixesV6, network.prefixesV6) - && Objects.equals(this.publicIp, network.publicIp) && Objects.equals(this.routed, network.routed) - && Objects.equals(this.state, network.state) - && Objects.equals(this.updatedAt, network.updatedAt); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); + && Objects.equals(this.routingTableId, network.routingTableId) + && Objects.equals(this.status, network.status) + && Objects.equals(this.updatedAt, network.updatedAt) + && Objects.equals(this.additionalProperties, network.additionalProperties); } @Override @@ -459,26 +367,16 @@ public int hashCode() { return Objects.hash( createdAt, dhcp, - gateway, - gatewayv6, + id, + ipv4, + ipv6, labels, name, - nameservers, - nameserversV6, - networkId, - prefixes, - prefixesV6, - publicIp, routed, - state, - updatedAt); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + routingTableId, + status, + updatedAt, + additionalProperties); } @Override @@ -487,19 +385,18 @@ public String toString() { sb.append("class Network {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); - sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); - sb.append(" gatewayv6: ").append(toIndentedString(gatewayv6)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); + sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); - sb.append(" nameserversV6: ").append(toIndentedString(nameserversV6)).append("\n"); - sb.append(" networkId: ").append(toIndentedString(networkId)).append("\n"); - sb.append(" prefixes: ").append(toIndentedString(prefixes)).append("\n"); - sb.append(" prefixesV6: ").append(toIndentedString(prefixesV6)).append("\n"); - sb.append(" publicIp: ").append(toIndentedString(publicIp)).append("\n"); sb.append(" routed: ").append(toIndentedString(routed)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" routingTableId: ").append(toIndentedString(routingTableId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -525,22 +422,18 @@ private String toIndentedString(Object o) { Arrays.asList( "createdAt", "dhcp", - "gateway", - "gatewayv6", + "id", + "ipv4", + "ipv6", "labels", "name", - "nameservers", - "nameserversV6", - "networkId", - "prefixes", - "prefixesV6", - "publicIp", "routed", - "state", + "routingTableId", + "status", "updatedAt")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("name", "networkId", "state")); + openapiRequiredFields = new HashSet(Arrays.asList("id", "name", "status")); } /** @@ -555,106 +448,60 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Network is not found in the empty JSON string", Network.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Network.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Network` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Network.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) - && !jsonObj.get("gateway").isJsonPrimitive()) { + if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("gateway").toString())); + 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("gatewayv6") != null && !jsonObj.get("gatewayv6").isJsonNull()) - && !jsonObj.get("gatewayv6").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `gatewayv6` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("gatewayv6").toString())); + // validate the optional field `ipv4` + if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { + NetworkIPv4.validateJsonElement(jsonObj.get("ipv4")); + } + // validate the optional field `ipv6` + if (jsonObj.get("ipv6") != null && !jsonObj.get("ipv6").isJsonNull()) { + NetworkIPv6.validateJsonElement(jsonObj.get("ipv6")); } 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())); } - // ensure the optional json data is an array if present - if (jsonObj.get("nameservers") != null - && !jsonObj.get("nameservers").isJsonNull() - && !jsonObj.get("nameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `nameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("nameservers").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("nameserversV6") != null - && !jsonObj.get("nameserversV6").isJsonNull() - && !jsonObj.get("nameserversV6").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `nameserversV6` to be an array in the JSON string but got `%s`", - jsonObj.get("nameserversV6").toString())); - } - if (!jsonObj.get("networkId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `networkId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("networkId").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("prefixes") != null - && !jsonObj.get("prefixes").isJsonNull() - && !jsonObj.get("prefixes").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `prefixes` to be an array in the JSON string but got `%s`", - jsonObj.get("prefixes").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("prefixesV6") != null - && !jsonObj.get("prefixesV6").isJsonNull() - && !jsonObj.get("prefixesV6").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `prefixesV6` to be an array in the JSON string but got `%s`", - jsonObj.get("prefixesV6").toString())); - } - if ((jsonObj.get("publicIp") != null && !jsonObj.get("publicIp").isJsonNull()) - && !jsonObj.get("publicIp").isJsonPrimitive()) { + if ((jsonObj.get("routingTableId") != null && !jsonObj.get("routingTableId").isJsonNull()) + && !jsonObj.get("routingTableId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `publicIp` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("publicIp").toString())); + java.util.Locale.ROOT, + "Expected the field `routingTableId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("routingTableId").toString())); } - if (!jsonObj.get("state").isJsonPrimitive()) { + if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `state` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("state").toString())); + java.util.Locale.ROOT, + "Expected the field `status` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("status").toString())); } } @@ -674,6 +521,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Network 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); } @@ -681,7 +552,41 @@ public void write(JsonWriter out, Network value) throws IOException { public Network read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Network 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkArea.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkArea.java index 113b83f8..babf1c63 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkArea.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkArea.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,32 +25,27 @@ 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.Set; import java.util.UUID; /** Object that represents a network area. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class NetworkArea { - public static final String SERIALIZED_NAME_AREA_ID = "areaId"; - - @SerializedName(SERIALIZED_NAME_AREA_ID) - @javax.annotation.Nonnull - private UUID areaId; - 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_IPV4 = "ipv4"; + public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private NetworkAreaIPv4 ipv4; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -66,14 +61,7 @@ public class NetworkArea { public static final String SERIALIZED_NAME_PROJECT_COUNT = "projectCount"; @SerializedName(SERIALIZED_NAME_PROJECT_COUNT) - @javax.annotation.Nonnull - private Long projectCount; - - public static final String SERIALIZED_NAME_STATE = "state"; - - @SerializedName(SERIALIZED_NAME_STATE) - @javax.annotation.Nonnull - private String state; + @javax.annotation.Nullable private Long projectCount; public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; @@ -82,31 +70,15 @@ public class NetworkArea { public NetworkArea() {} - public NetworkArea(OffsetDateTime createdAt, OffsetDateTime updatedAt) { + public NetworkArea( + OffsetDateTime createdAt, UUID id, Long projectCount, OffsetDateTime updatedAt) { this(); this.createdAt = createdAt; + this.id = id; + this.projectCount = projectCount; this.updatedAt = updatedAt; } - public NetworkArea areaId(@javax.annotation.Nonnull UUID areaId) { - this.areaId = areaId; - return this; - } - - /** - * Universally Unique Identifier (UUID). - * - * @return areaId - */ - @javax.annotation.Nonnull - public UUID getAreaId() { - return areaId; - } - - public void setAreaId(@javax.annotation.Nonnull UUID areaId) { - this.areaId = areaId; - } - /** * Date-time when resource was created. * @@ -116,22 +88,13 @@ public void setAreaId(@javax.annotation.Nonnull UUID areaId) { return createdAt; } - public NetworkArea ipv4(@javax.annotation.Nullable NetworkAreaIPv4 ipv4) { - this.ipv4 = ipv4; - return this; - } - /** - * Get ipv4 + * Universally Unique Identifier (UUID). * - * @return ipv4 + * @return id */ - @javax.annotation.Nullable public NetworkAreaIPv4 getIpv4() { - return ipv4; - } - - public void setIpv4(@javax.annotation.Nullable NetworkAreaIPv4 ipv4) { - this.ipv4 = ipv4; + @javax.annotation.Nullable public UUID getId() { + return id; } public NetworkArea labels(@javax.annotation.Nullable Object labels) { @@ -143,7 +106,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -174,53 +138,66 @@ public void setName(@javax.annotation.Nonnull String name) { this.name = name; } - public NetworkArea projectCount(@javax.annotation.Nonnull Long projectCount) { - this.projectCount = projectCount; - return this; - } - /** * The amount of projects currently referencing a specific area. minimum: 0 * * @return projectCount */ - @javax.annotation.Nonnull - public Long getProjectCount() { + @javax.annotation.Nullable public Long getProjectCount() { return projectCount; } - public void setProjectCount(@javax.annotation.Nonnull Long projectCount) { - this.projectCount = projectCount; + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; } - public NetworkArea state(@javax.annotation.Nonnull String state) { - this.state = state; - return this; - } + /** + * 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; /** - * The state of a resource object. Possible values: `CREATING`, `CREATED`, - * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, - * `UPDATING`. + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. * - * @return state + * @param key name of the property + * @param value value of the property + * @return the NetworkArea instance itself */ - @javax.annotation.Nonnull - public String getState() { - return state; + public NetworkArea putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; } - public void setState(@javax.annotation.Nonnull String state) { - this.state = state; + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; } /** - * Date-time when resource was last updated. + * Return the additional (undeclared) property with the specified name. * - * @return updatedAt + * @param key name of the property + * @return an object */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); } @Override @@ -232,33 +209,34 @@ public boolean equals(Object o) { return false; } NetworkArea networkArea = (NetworkArea) o; - return Objects.equals(this.areaId, networkArea.areaId) - && Objects.equals(this.createdAt, networkArea.createdAt) - && Objects.equals(this.ipv4, networkArea.ipv4) + return Objects.equals(this.createdAt, networkArea.createdAt) + && Objects.equals(this.id, networkArea.id) && Objects.equals(this.labels, networkArea.labels) && Objects.equals(this.name, networkArea.name) && Objects.equals(this.projectCount, networkArea.projectCount) - && Objects.equals(this.state, networkArea.state) - && Objects.equals(this.updatedAt, networkArea.updatedAt); + && Objects.equals(this.updatedAt, networkArea.updatedAt) + && Objects.equals(this.additionalProperties, networkArea.additionalProperties); } @Override public int hashCode() { - return Objects.hash(areaId, createdAt, ipv4, labels, name, projectCount, state, updatedAt); + return Objects.hash( + createdAt, id, labels, name, projectCount, updatedAt, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NetworkArea {\n"); - sb.append(" areaId: ").append(toIndentedString(areaId)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" projectCount: ").append(toIndentedString(projectCount)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -282,18 +260,10 @@ private String toIndentedString(Object o) { openapiFields = new HashSet( Arrays.asList( - "areaId", - "createdAt", - "ipv4", - "labels", - "name", - "projectCount", - "state", - "updatedAt")); + "createdAt", "id", "labels", "name", "projectCount", "updatedAt")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = - new HashSet(Arrays.asList("areaId", "name", "projectCount", "state")); + openapiRequiredFields = new HashSet(Arrays.asList("name")); } /** @@ -308,54 +278,39 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in NetworkArea is not found in the empty JSON string", NetworkArea.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NetworkArea.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `NetworkArea` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NetworkArea.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("areaId").isJsonPrimitive()) { + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `areaId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("areaId").toString())); - } - // validate the optional field `ipv4` - if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - NetworkAreaIPv4.validateJsonElement(jsonObj.get("ipv4")); + 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("state").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `state` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("state").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -374,6 +329,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, NetworkArea 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); } @@ -381,7 +360,41 @@ public void write(JsonWriter out, NetworkArea value) throws IOException { public NetworkArea read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NetworkArea 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkAreaIPv4.java deleted file mode 100644 index 83924559..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkAreaIPv4.java +++ /dev/null @@ -1,438 +0,0 @@ -/* - * IaaS-API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 1 - * 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.model; - -import cloud.stackit.sdk.iaas.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.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The IPv4 properties of a network area. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class NetworkAreaIPv4 { - public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_NAMESERVERS) - @javax.annotation.Nullable private List defaultNameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_NETWORK_RANGES = "networkRanges"; - - @SerializedName(SERIALIZED_NAME_NETWORK_RANGES) - @javax.annotation.Nullable private List networkRanges = new ArrayList<>(); - - public static final String SERIALIZED_NAME_ROUTES = "routes"; - - @SerializedName(SERIALIZED_NAME_ROUTES) - @javax.annotation.Nullable private List routes = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TRANSFER_NETWORK = "transferNetwork"; - - @SerializedName(SERIALIZED_NAME_TRANSFER_NETWORK) - @javax.annotation.Nullable private String transferNetwork; - - public static final String SERIALIZED_NAME_DEFAULT_PREFIX_LEN = "defaultPrefixLen"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_PREFIX_LEN) - @javax.annotation.Nullable private Integer defaultPrefixLen = 25; - - public static final String SERIALIZED_NAME_MAX_PREFIX_LEN = "maxPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MAX_PREFIX_LEN) - @javax.annotation.Nullable private Integer maxPrefixLen = 29; - - public static final String SERIALIZED_NAME_MIN_PREFIX_LEN = "minPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MIN_PREFIX_LEN) - @javax.annotation.Nullable private Integer minPrefixLen = 24; - - public NetworkAreaIPv4() {} - - public NetworkAreaIPv4 defaultNameservers( - @javax.annotation.Nullable List defaultNameservers) { - this.defaultNameservers = defaultNameservers; - return this; - } - - public NetworkAreaIPv4 addDefaultNameserversItem(String defaultNameserversItem) { - if (this.defaultNameservers == null) { - this.defaultNameservers = new ArrayList<>(); - } - this.defaultNameservers.add(defaultNameserversItem); - return this; - } - - /** - * A list containing DNS Servers/Nameservers for IPv4. - * - * @return defaultNameservers - */ - @javax.annotation.Nullable public List getDefaultNameservers() { - return defaultNameservers; - } - - public void setDefaultNameservers(@javax.annotation.Nullable List defaultNameservers) { - this.defaultNameservers = defaultNameservers; - } - - public NetworkAreaIPv4 networkRanges( - @javax.annotation.Nullable List networkRanges) { - this.networkRanges = networkRanges; - return this; - } - - public NetworkAreaIPv4 addNetworkRangesItem(NetworkRange networkRangesItem) { - if (this.networkRanges == null) { - this.networkRanges = new ArrayList<>(); - } - this.networkRanges.add(networkRangesItem); - return this; - } - - /** - * A list of network ranges. - * - * @return networkRanges - */ - @javax.annotation.Nullable public List getNetworkRanges() { - return networkRanges; - } - - public void setNetworkRanges(@javax.annotation.Nullable List networkRanges) { - this.networkRanges = networkRanges; - } - - public NetworkAreaIPv4 routes(@javax.annotation.Nullable List routes) { - this.routes = routes; - return this; - } - - public NetworkAreaIPv4 addRoutesItem(Route routesItem) { - if (this.routes == null) { - this.routes = new ArrayList<>(); - } - this.routes.add(routesItem); - return this; - } - - /** - * A list of routes. - * - * @return routes - */ - @javax.annotation.Nullable public List getRoutes() { - return routes; - } - - public void setRoutes(@javax.annotation.Nullable List routes) { - this.routes = routes; - } - - public NetworkAreaIPv4 transferNetwork(@javax.annotation.Nullable String transferNetwork) { - this.transferNetwork = transferNetwork; - return this; - } - - /** - * Classless Inter-Domain Routing (CIDR). - * - * @return transferNetwork - */ - @javax.annotation.Nullable public String getTransferNetwork() { - return transferNetwork; - } - - public void setTransferNetwork(@javax.annotation.Nullable String transferNetwork) { - this.transferNetwork = transferNetwork; - } - - public NetworkAreaIPv4 defaultPrefixLen(@javax.annotation.Nullable Integer defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - return this; - } - - /** - * The default prefix length for networks in the network area. minimum: 24 maximum: 29 - * - * @return defaultPrefixLen - */ - @javax.annotation.Nullable public Integer getDefaultPrefixLen() { - return defaultPrefixLen; - } - - public void setDefaultPrefixLen(@javax.annotation.Nullable Integer defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - } - - public NetworkAreaIPv4 maxPrefixLen(@javax.annotation.Nullable Integer maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - return this; - } - - /** - * The maximal prefix length for networks in the network area. minimum: 24 maximum: 29 - * - * @return maxPrefixLen - */ - @javax.annotation.Nullable public Integer getMaxPrefixLen() { - return maxPrefixLen; - } - - public void setMaxPrefixLen(@javax.annotation.Nullable Integer maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - } - - public NetworkAreaIPv4 minPrefixLen(@javax.annotation.Nullable Integer minPrefixLen) { - this.minPrefixLen = minPrefixLen; - return this; - } - - /** - * The minimal prefix length for networks in the network area. minimum: 8 maximum: 29 - * - * @return minPrefixLen - */ - @javax.annotation.Nullable public Integer getMinPrefixLen() { - return minPrefixLen; - } - - public void setMinPrefixLen(@javax.annotation.Nullable Integer minPrefixLen) { - this.minPrefixLen = minPrefixLen; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NetworkAreaIPv4 networkAreaIPv4 = (NetworkAreaIPv4) o; - return Objects.equals(this.defaultNameservers, networkAreaIPv4.defaultNameservers) - && Objects.equals(this.networkRanges, networkAreaIPv4.networkRanges) - && Objects.equals(this.routes, networkAreaIPv4.routes) - && Objects.equals(this.transferNetwork, networkAreaIPv4.transferNetwork) - && Objects.equals(this.defaultPrefixLen, networkAreaIPv4.defaultPrefixLen) - && Objects.equals(this.maxPrefixLen, networkAreaIPv4.maxPrefixLen) - && Objects.equals(this.minPrefixLen, networkAreaIPv4.minPrefixLen); - } - - @Override - public int hashCode() { - return Objects.hash( - defaultNameservers, - networkRanges, - routes, - transferNetwork, - defaultPrefixLen, - maxPrefixLen, - minPrefixLen); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NetworkAreaIPv4 {\n"); - sb.append(" defaultNameservers: ") - .append(toIndentedString(defaultNameservers)) - .append("\n"); - sb.append(" networkRanges: ").append(toIndentedString(networkRanges)).append("\n"); - sb.append(" routes: ").append(toIndentedString(routes)).append("\n"); - sb.append(" transferNetwork: ").append(toIndentedString(transferNetwork)).append("\n"); - sb.append(" defaultPrefixLen: ").append(toIndentedString(defaultPrefixLen)).append("\n"); - sb.append(" maxPrefixLen: ").append(toIndentedString(maxPrefixLen)).append("\n"); - sb.append(" minPrefixLen: ").append(toIndentedString(minPrefixLen)).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( - "defaultNameservers", - "networkRanges", - "routes", - "transferNetwork", - "defaultPrefixLen", - "maxPrefixLen", - "minPrefixLen")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NetworkAreaIPv4 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!NetworkAreaIPv4.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in NetworkAreaIPv4 is not found in the empty JSON string", - NetworkAreaIPv4.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NetworkAreaIPv4.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `NetworkAreaIPv4` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("defaultNameservers") != null - && !jsonObj.get("defaultNameservers").isJsonNull() - && !jsonObj.get("defaultNameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `defaultNameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("defaultNameservers").toString())); - } - if (jsonObj.get("networkRanges") != null && !jsonObj.get("networkRanges").isJsonNull()) { - JsonArray jsonArraynetworkRanges = jsonObj.getAsJsonArray("networkRanges"); - if (jsonArraynetworkRanges != null) { - // ensure the json data is an array - if (!jsonObj.get("networkRanges").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `networkRanges` to be an array in the JSON string but got `%s`", - jsonObj.get("networkRanges").toString())); - } - - // validate the optional field `networkRanges` (array) - for (int i = 0; i < jsonArraynetworkRanges.size(); i++) { - NetworkRange.validateJsonElement(jsonArraynetworkRanges.get(i)); - } - ; - } - } - if (jsonObj.get("routes") != null && !jsonObj.get("routes").isJsonNull()) { - JsonArray jsonArrayroutes = jsonObj.getAsJsonArray("routes"); - if (jsonArrayroutes != null) { - // ensure the json data is an array - if (!jsonObj.get("routes").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `routes` to be an array in the JSON string but got `%s`", - jsonObj.get("routes").toString())); - } - - // validate the optional field `routes` (array) - for (int i = 0; i < jsonArrayroutes.size(); i++) { - Route.validateJsonElement(jsonArrayroutes.get(i)); - } - ; - } - } - if ((jsonObj.get("transferNetwork") != null && !jsonObj.get("transferNetwork").isJsonNull()) - && !jsonObj.get("transferNetwork").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transferNetwork` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("transferNetwork").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!NetworkAreaIPv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'NetworkAreaIPv4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(NetworkAreaIPv4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, NetworkAreaIPv4 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public NetworkAreaIPv4 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of NetworkAreaIPv4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of NetworkAreaIPv4 - * @throws IOException if the JSON string is invalid with respect to NetworkAreaIPv4 - */ - public static NetworkAreaIPv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, NetworkAreaIPv4.class); - } - - /** - * Convert an instance of NetworkAreaIPv4 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/model/NetworkAreaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkAreaListResponse.java index 1916cef8..4a4f7030 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkAreaListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkAreaListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Network area list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class NetworkAreaListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 NetworkAreaListResponse instance itself + */ + public NetworkAreaListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } NetworkAreaListResponse networkAreaListResponse = (NetworkAreaListResponse) o; - return Objects.equals(this.items, networkAreaListResponse.items); + return Objects.equals(this.items, networkAreaListResponse.items) + && Objects.equals( + this.additionalProperties, networkAreaListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NetworkAreaListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in NetworkAreaListResponse is not found in the empty JSON string", NetworkAreaListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NetworkAreaListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `NetworkAreaListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NetworkAreaListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -192,6 +234,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, NetworkAreaListResponse 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); } @@ -199,7 +265,41 @@ public void write(JsonWriter out, NetworkAreaListResponse value) public NetworkAreaListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NetworkAreaListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkIPv4.java new file mode 100644 index 00000000..a697efcc --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkIPv4.java @@ -0,0 +1,444 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Object that represents the IPv4 part of a network. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class NetworkIPv4 { + public static final String SERIALIZED_NAME_GATEWAY = "gateway"; + + @SerializedName(SERIALIZED_NAME_GATEWAY) + @javax.annotation.Nullable private String gateway; + + public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; + + @SerializedName(SERIALIZED_NAME_NAMESERVERS) + @javax.annotation.Nullable private List nameservers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PREFIXES = "prefixes"; + + @SerializedName(SERIALIZED_NAME_PREFIXES) + @javax.annotation.Nonnull + private List prefixes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PUBLIC_IP = "publicIp"; + + @SerializedName(SERIALIZED_NAME_PUBLIC_IP) + @javax.annotation.Nullable private String publicIp; + + public NetworkIPv4() {} + + public NetworkIPv4(String publicIp) { + this(); + this.publicIp = publicIp; + } + + public NetworkIPv4 gateway(@javax.annotation.Nullable String gateway) { + this.gateway = gateway; + return this; + } + + /** + * The IPv4 gateway of a network. If not specified the first IP of the network will be assigned + * as the gateway. If 'null' is sent, then the network doesn't have a gateway. + * + * @return gateway + */ + @javax.annotation.Nullable public String getGateway() { + return gateway; + } + + public void setGateway(@javax.annotation.Nullable String gateway) { + this.gateway = gateway; + } + + public NetworkIPv4 nameservers(@javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + return this; + } + + public NetworkIPv4 addNameserversItem(String nameserversItem) { + if (this.nameservers == null) { + this.nameservers = new ArrayList<>(); + } + this.nameservers.add(nameserversItem); + return this; + } + + /** + * A list containing DNS Servers/Nameservers for IPv4. + * + * @return nameservers + */ + @javax.annotation.Nullable public List getNameservers() { + return nameservers; + } + + public void setNameservers(@javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + } + + public NetworkIPv4 prefixes(@javax.annotation.Nonnull List prefixes) { + this.prefixes = prefixes; + return this; + } + + public NetworkIPv4 addPrefixesItem(String prefixesItem) { + if (this.prefixes == null) { + this.prefixes = new ArrayList<>(); + } + this.prefixes.add(prefixesItem); + return this; + } + + /** + * Get prefixes + * + * @return prefixes + */ + @javax.annotation.Nonnull + public List getPrefixes() { + return prefixes; + } + + public void setPrefixes(@javax.annotation.Nonnull List prefixes) { + this.prefixes = prefixes; + } + + /** + * String that represents an IPv4 address. + * + * @return publicIp + */ + @javax.annotation.Nullable public String getPublicIp() { + return publicIp; + } + + /** + * 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 NetworkIPv4 instance itself + */ + public NetworkIPv4 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; + } + NetworkIPv4 networkIPv4 = (NetworkIPv4) o; + return Objects.equals(this.gateway, networkIPv4.gateway) + && Objects.equals(this.nameservers, networkIPv4.nameservers) + && Objects.equals(this.prefixes, networkIPv4.prefixes) + && Objects.equals(this.publicIp, networkIPv4.publicIp) + && Objects.equals(this.additionalProperties, networkIPv4.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gateway, nameservers, prefixes, publicIp, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NetworkIPv4 {\n"); + sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); + sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); + sb.append(" prefixes: ").append(toIndentedString(prefixes)).append("\n"); + sb.append(" publicIp: ").append(toIndentedString(publicIp)).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("gateway", "nameservers", "prefixes", "publicIp")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("prefixes")); + } + + /** + * 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 NetworkIPv4 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NetworkIPv4.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 NetworkIPv4 is not found in the empty JSON string", + NetworkIPv4.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NetworkIPv4.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("gateway") != null && !jsonObj.get("gateway").isJsonNull()) + && !jsonObj.get("gateway").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("gateway").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("nameservers") != null + && !jsonObj.get("nameservers").isJsonNull() + && !jsonObj.get("nameservers").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `nameservers` to be an array in the JSON string but got `%s`", + jsonObj.get("nameservers").toString())); + } + // ensure the required json array is present + if (jsonObj.get("prefixes") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("prefixes").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `prefixes` to be an array in the JSON string but got `%s`", + jsonObj.get("prefixes").toString())); + } + if ((jsonObj.get("publicIp") != null && !jsonObj.get("publicIp").isJsonNull()) + && !jsonObj.get("publicIp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `publicIp` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("publicIp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NetworkIPv4.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NetworkIPv4' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NetworkIPv4.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NetworkIPv4 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 NetworkIPv4 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NetworkIPv4 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 NetworkIPv4 given an JSON string + * + * @param jsonString JSON string + * @return An instance of NetworkIPv4 + * @throws IOException if the JSON string is invalid with respect to NetworkIPv4 + */ + public static NetworkIPv4 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NetworkIPv4.class); + } + + /** + * Convert an instance of NetworkIPv4 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/model/NetworkIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkIPv6.java new file mode 100644 index 00000000..5fc2d028 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkIPv6.java @@ -0,0 +1,413 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Object that represents the IPv6 part of a network. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class NetworkIPv6 { + public static final String SERIALIZED_NAME_GATEWAY = "gateway"; + + @SerializedName(SERIALIZED_NAME_GATEWAY) + @javax.annotation.Nullable private String gateway; + + public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; + + @SerializedName(SERIALIZED_NAME_NAMESERVERS) + @javax.annotation.Nullable private List nameservers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PREFIXES = "prefixes"; + + @SerializedName(SERIALIZED_NAME_PREFIXES) + @javax.annotation.Nonnull + private List prefixes = new ArrayList<>(); + + public NetworkIPv6() {} + + public NetworkIPv6 gateway(@javax.annotation.Nullable String gateway) { + this.gateway = gateway; + return this; + } + + /** + * The IPv6 gateway of a network. If not specified the first IP of the network will be assigned + * as the gateway. If 'null' is sent, then the network doesn't have a gateway. + * + * @return gateway + */ + @javax.annotation.Nullable public String getGateway() { + return gateway; + } + + public void setGateway(@javax.annotation.Nullable String gateway) { + this.gateway = gateway; + } + + public NetworkIPv6 nameservers(@javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + return this; + } + + public NetworkIPv6 addNameserversItem(String nameserversItem) { + if (this.nameservers == null) { + this.nameservers = new ArrayList<>(); + } + this.nameservers.add(nameserversItem); + return this; + } + + /** + * A list containing DNS Servers/Nameservers for IPv6. + * + * @return nameservers + */ + @javax.annotation.Nullable public List getNameservers() { + return nameservers; + } + + public void setNameservers(@javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + } + + public NetworkIPv6 prefixes(@javax.annotation.Nonnull List prefixes) { + this.prefixes = prefixes; + return this; + } + + public NetworkIPv6 addPrefixesItem(String prefixesItem) { + if (this.prefixes == null) { + this.prefixes = new ArrayList<>(); + } + this.prefixes.add(prefixesItem); + return this; + } + + /** + * Get prefixes + * + * @return prefixes + */ + @javax.annotation.Nonnull + public List getPrefixes() { + return prefixes; + } + + public void setPrefixes(@javax.annotation.Nonnull List prefixes) { + this.prefixes = prefixes; + } + + /** + * 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 NetworkIPv6 instance itself + */ + public NetworkIPv6 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; + } + NetworkIPv6 networkIPv6 = (NetworkIPv6) o; + return Objects.equals(this.gateway, networkIPv6.gateway) + && Objects.equals(this.nameservers, networkIPv6.nameservers) + && Objects.equals(this.prefixes, networkIPv6.prefixes) + && Objects.equals(this.additionalProperties, networkIPv6.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gateway, nameservers, prefixes, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NetworkIPv6 {\n"); + sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); + sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); + sb.append(" prefixes: ").append(toIndentedString(prefixes)).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("gateway", "nameservers", "prefixes")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("prefixes")); + } + + /** + * 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 NetworkIPv6 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NetworkIPv6.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 NetworkIPv6 is not found in the empty JSON string", + NetworkIPv6.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NetworkIPv6.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("gateway") != null && !jsonObj.get("gateway").isJsonNull()) + && !jsonObj.get("gateway").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("gateway").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("nameservers") != null + && !jsonObj.get("nameservers").isJsonNull() + && !jsonObj.get("nameservers").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `nameservers` to be an array in the JSON string but got `%s`", + jsonObj.get("nameservers").toString())); + } + // ensure the required json array is present + if (jsonObj.get("prefixes") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("prefixes").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `prefixes` to be an array in the JSON string but got `%s`", + jsonObj.get("prefixes").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NetworkIPv6.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NetworkIPv6' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NetworkIPv6.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NetworkIPv6 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 NetworkIPv6 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NetworkIPv6 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 NetworkIPv6 given an JSON string + * + * @param jsonString JSON string + * @return An instance of NetworkIPv6 + * @throws IOException if the JSON string is invalid with respect to NetworkIPv6 + */ + public static NetworkIPv6 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NetworkIPv6.class); + } + + /** + * Convert an instance of NetworkIPv6 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/model/NetworkListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkListResponse.java index 839d7767..dc2a1435 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Network list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class NetworkListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 NetworkListResponse instance itself + */ + public NetworkListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } NetworkListResponse networkListResponse = (NetworkListResponse) o; - return Objects.equals(this.items, networkListResponse.items); + return Objects.equals(this.items, networkListResponse.items) + && Objects.equals( + this.additionalProperties, networkListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NetworkListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in NetworkListResponse is not found in the empty JSON string", NetworkListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NetworkListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `NetworkListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NetworkListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -191,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, NetworkListResponse 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); } @@ -198,7 +264,41 @@ public void write(JsonWriter out, NetworkListResponse value) public NetworkListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NetworkListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRange.java index 9b98e509..16297a7c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRange.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRange.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,26 +25,27 @@ 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.Set; import java.util.UUID; /** Object that represents a network range. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class NetworkRange { 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_NETWORK_RANGE_ID = "networkRangeId"; + public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_NETWORK_RANGE_ID) - @javax.annotation.Nullable private UUID networkRangeId; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; public static final String SERIALIZED_NAME_PREFIX = "prefix"; @@ -59,10 +60,10 @@ public class NetworkRange { public NetworkRange() {} - public NetworkRange(OffsetDateTime createdAt, UUID networkRangeId, OffsetDateTime updatedAt) { + public NetworkRange(OffsetDateTime createdAt, UUID id, OffsetDateTime updatedAt) { this(); this.createdAt = createdAt; - this.networkRangeId = networkRangeId; + this.id = id; this.updatedAt = updatedAt; } @@ -78,10 +79,10 @@ public NetworkRange(OffsetDateTime createdAt, UUID networkRangeId, OffsetDateTim /** * Universally Unique Identifier (UUID). * - * @return networkRangeId + * @return id */ - @javax.annotation.Nullable public UUID getNetworkRangeId() { - return networkRangeId; + @javax.annotation.Nullable public UUID getId() { + return id; } public NetworkRange prefix(@javax.annotation.Nonnull String prefix) { @@ -112,6 +113,50 @@ public void setPrefix(@javax.annotation.Nonnull String prefix) { 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 NetworkRange instance itself + */ + public NetworkRange 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) { @@ -122,14 +167,15 @@ public boolean equals(Object o) { } NetworkRange networkRange = (NetworkRange) o; return Objects.equals(this.createdAt, networkRange.createdAt) - && Objects.equals(this.networkRangeId, networkRange.networkRangeId) + && Objects.equals(this.id, networkRange.id) && Objects.equals(this.prefix, networkRange.prefix) - && Objects.equals(this.updatedAt, networkRange.updatedAt); + && Objects.equals(this.updatedAt, networkRange.updatedAt) + && Objects.equals(this.additionalProperties, networkRange.additionalProperties); } @Override public int hashCode() { - return Objects.hash(createdAt, networkRangeId, prefix, updatedAt); + return Objects.hash(createdAt, id, prefix, updatedAt, additionalProperties); } @Override @@ -137,9 +183,12 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NetworkRange {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" networkRangeId: ").append(toIndentedString(networkRangeId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -161,8 +210,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet( - Arrays.asList("createdAt", "networkRangeId", "prefix", "updatedAt")); + new HashSet(Arrays.asList("createdAt", "id", "prefix", "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("prefix")); @@ -180,42 +228,36 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in NetworkRange is not found in the empty JSON string", NetworkRange.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NetworkRange.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `NetworkRange` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NetworkRange.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("networkRangeId") != null && !jsonObj.get("networkRangeId").isJsonNull()) - && !jsonObj.get("networkRangeId").isJsonPrimitive()) { + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `networkRangeId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("networkRangeId").toString())); + 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("prefix").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prefix").toString())); } @@ -237,6 +279,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, NetworkRange 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); } @@ -244,7 +310,41 @@ public void write(JsonWriter out, NetworkRange value) throws IOException { public NetworkRange read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NetworkRange 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRangeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRangeListResponse.java index f9db55e6..d4aa5f25 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRangeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRangeListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Network Range list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class NetworkRangeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 NetworkRangeListResponse instance itself + */ + public NetworkRangeListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } NetworkRangeListResponse networkRangeListResponse = (NetworkRangeListResponse) o; - return Objects.equals(this.items, networkRangeListResponse.items); + return Objects.equals(this.items, networkRangeListResponse.items) + && Objects.equals( + this.additionalProperties, networkRangeListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NetworkRangeListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in NetworkRangeListResponse is not found in the empty JSON string", NetworkRangeListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NetworkRangeListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `NetworkRangeListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NetworkRangeListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -192,6 +234,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, NetworkRangeListResponse 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); } @@ -199,7 +265,41 @@ public void write(JsonWriter out, NetworkRangeListResponse value) public NetworkRangeListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NetworkRangeListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopBlackhole.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopBlackhole.java new file mode 100644 index 00000000..afcbed13 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopBlackhole.java @@ -0,0 +1,307 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 a blackhole route. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class NexthopBlackhole { + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public NexthopBlackhole() {} + + public NexthopBlackhole type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @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 NexthopBlackhole instance itself + */ + public NexthopBlackhole 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; + } + NexthopBlackhole nexthopBlackhole = (NexthopBlackhole) o; + return Objects.equals(this.type, nexthopBlackhole.type) + && Objects.equals(this.additionalProperties, nexthopBlackhole.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NexthopBlackhole {\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("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 NexthopBlackhole + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NexthopBlackhole.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 NexthopBlackhole is not found in the empty JSON string", + NexthopBlackhole.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NexthopBlackhole.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("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 (!NexthopBlackhole.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NexthopBlackhole' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NexthopBlackhole.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NexthopBlackhole 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 NexthopBlackhole read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NexthopBlackhole 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 NexthopBlackhole given an JSON string + * + * @param jsonString JSON string + * @return An instance of NexthopBlackhole + * @throws IOException if the JSON string is invalid with respect to NexthopBlackhole + */ + public static NexthopBlackhole fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NexthopBlackhole.class); + } + + /** + * Convert an instance of NexthopBlackhole 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/model/NexthopIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopIPv4.java new file mode 100644 index 00000000..335a4702 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopIPv4.java @@ -0,0 +1,340 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 an IPv4 address. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class NexthopIPv4 { + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_VALUE = "value"; + + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public NexthopIPv4() {} + + public NexthopIPv4 type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + public NexthopIPv4 value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * An IPv4 address. + * + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + /** + * 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 NexthopIPv4 instance itself + */ + public NexthopIPv4 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; + } + NexthopIPv4 nexthopIPv4 = (NexthopIPv4) o; + return Objects.equals(this.type, nexthopIPv4.type) + && Objects.equals(this.value, nexthopIPv4.value) + && Objects.equals(this.additionalProperties, nexthopIPv4.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NexthopIPv4 {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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("type", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "value")); + } + + /** + * 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 NexthopIPv4 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NexthopIPv4.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 NexthopIPv4 is not found in the empty JSON string", + NexthopIPv4.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NexthopIPv4.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("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("value").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `value` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NexthopIPv4.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NexthopIPv4' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NexthopIPv4.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NexthopIPv4 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 NexthopIPv4 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NexthopIPv4 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 NexthopIPv4 given an JSON string + * + * @param jsonString JSON string + * @return An instance of NexthopIPv4 + * @throws IOException if the JSON string is invalid with respect to NexthopIPv4 + */ + public static NexthopIPv4 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NexthopIPv4.class); + } + + /** + * Convert an instance of NexthopIPv4 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/model/NexthopIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopIPv6.java new file mode 100644 index 00000000..5e2b29a3 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopIPv6.java @@ -0,0 +1,340 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 an IPv6 address. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class NexthopIPv6 { + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_VALUE = "value"; + + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public NexthopIPv6() {} + + public NexthopIPv6 type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + public NexthopIPv6 value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * An IPv6 address. + * + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + /** + * 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 NexthopIPv6 instance itself + */ + public NexthopIPv6 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; + } + NexthopIPv6 nexthopIPv6 = (NexthopIPv6) o; + return Objects.equals(this.type, nexthopIPv6.type) + && Objects.equals(this.value, nexthopIPv6.value) + && Objects.equals(this.additionalProperties, nexthopIPv6.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NexthopIPv6 {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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("type", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "value")); + } + + /** + * 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 NexthopIPv6 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NexthopIPv6.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 NexthopIPv6 is not found in the empty JSON string", + NexthopIPv6.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NexthopIPv6.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("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("value").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `value` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NexthopIPv6.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NexthopIPv6' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NexthopIPv6.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NexthopIPv6 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 NexthopIPv6 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NexthopIPv6 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 NexthopIPv6 given an JSON string + * + * @param jsonString JSON string + * @return An instance of NexthopIPv6 + * @throws IOException if the JSON string is invalid with respect to NexthopIPv6 + */ + public static NexthopIPv6 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NexthopIPv6.class); + } + + /** + * Convert an instance of NexthopIPv6 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/model/NexthopInternet.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopInternet.java new file mode 100644 index 00000000..56d91532 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NexthopInternet.java @@ -0,0 +1,307 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 a route to the internet. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class NexthopInternet { + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public NexthopInternet() {} + + public NexthopInternet type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @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 NexthopInternet instance itself + */ + public NexthopInternet 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; + } + NexthopInternet nexthopInternet = (NexthopInternet) o; + return Objects.equals(this.type, nexthopInternet.type) + && Objects.equals(this.additionalProperties, nexthopInternet.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NexthopInternet {\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("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 NexthopInternet + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NexthopInternet.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 NexthopInternet is not found in the empty JSON string", + NexthopInternet.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NexthopInternet.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("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 (!NexthopInternet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NexthopInternet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NexthopInternet.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NexthopInternet 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 NexthopInternet read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + NexthopInternet 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 NexthopInternet given an JSON string + * + * @param jsonString JSON string + * @return An instance of NexthopInternet + * @throws IOException if the JSON string is invalid with respect to NexthopInternet + */ + public static NexthopInternet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NexthopInternet.class); + } + + /** + * Convert an instance of NexthopInternet 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/model/PartialUpdateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkAreaPayload.java index 914ef5ee..1b2aff15 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkAreaPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,21 +24,17 @@ 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; -import java.util.Set; -/** PartialUpdateNetworkAreaPayload */ +/** Object that represents the network area update request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class PartialUpdateNetworkAreaPayload { - public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "addressFamily"; - - @SerializedName(SERIALIZED_NAME_ADDRESS_FAMILY) - @javax.annotation.Nullable private UpdateAreaAddressFamily addressFamily; - public static final String SERIALIZED_NAME_LABELS = "labels"; @SerializedName(SERIALIZED_NAME_LABELS) @@ -51,25 +47,6 @@ public class PartialUpdateNetworkAreaPayload { public PartialUpdateNetworkAreaPayload() {} - public PartialUpdateNetworkAreaPayload addressFamily( - @javax.annotation.Nullable UpdateAreaAddressFamily addressFamily) { - this.addressFamily = addressFamily; - return this; - } - - /** - * Get addressFamily - * - * @return addressFamily - */ - @javax.annotation.Nullable public UpdateAreaAddressFamily getAddressFamily() { - return addressFamily; - } - - public void setAddressFamily(@javax.annotation.Nullable UpdateAreaAddressFamily addressFamily) { - this.addressFamily = addressFamily; - } - public PartialUpdateNetworkAreaPayload labels(@javax.annotation.Nullable Object labels) { this.labels = labels; return this; @@ -79,7 +56,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -97,7 +75,7 @@ public PartialUpdateNetworkAreaPayload name(@javax.annotation.Nullable String na } /** - * The name for a General Object. Matches Names and also UUIDs. + * Get name * * @return name */ @@ -109,6 +87,50 @@ public void setName(@javax.annotation.Nullable String name) { this.name = name; } + /** + * 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 PartialUpdateNetworkAreaPayload instance itself + */ + public PartialUpdateNetworkAreaPayload 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) { @@ -119,23 +141,27 @@ public boolean equals(Object o) { } PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload = (PartialUpdateNetworkAreaPayload) o; - return Objects.equals(this.addressFamily, partialUpdateNetworkAreaPayload.addressFamily) - && Objects.equals(this.labels, partialUpdateNetworkAreaPayload.labels) - && Objects.equals(this.name, partialUpdateNetworkAreaPayload.name); + return Objects.equals(this.labels, partialUpdateNetworkAreaPayload.labels) + && Objects.equals(this.name, partialUpdateNetworkAreaPayload.name) + && Objects.equals( + this.additionalProperties, + partialUpdateNetworkAreaPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(addressFamily, labels, name); + return Objects.hash(labels, name, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PartialUpdateNetworkAreaPayload {\n"); - sb.append(" addressFamily: ").append(toIndentedString(addressFamily)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -156,7 +182,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("addressFamily", "labels", "name")); + openapiFields = new HashSet(Arrays.asList("labels", "name")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -175,30 +201,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in PartialUpdateNetworkAreaPayload is not found in the empty JSON string", PartialUpdateNetworkAreaPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PartialUpdateNetworkAreaPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `PartialUpdateNetworkAreaPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `addressFamily` - if (jsonObj.get("addressFamily") != null && !jsonObj.get("addressFamily").isJsonNull()) { - UpdateAreaAddressFamily.validateJsonElement(jsonObj.get("addressFamily")); - } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !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())); } @@ -223,6 +236,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, PartialUpdateNetworkAreaPayload 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); } @@ -231,7 +268,42 @@ public PartialUpdateNetworkAreaPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PartialUpdateNetworkAreaPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkPayload.java index 2f765948..a38c34df 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,26 +24,33 @@ 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; -import java.util.Set; +import java.util.UUID; /** Object that represents the request body for a network update. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class PartialUpdateNetworkPayload { - public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "addressFamily"; - - @SerializedName(SERIALIZED_NAME_ADDRESS_FAMILY) - @javax.annotation.Nullable private UpdateNetworkAddressFamily addressFamily; - public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @javax.annotation.Nullable private Boolean dhcp; + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private UpdateNetworkIPv4Body ipv4; + + public static final String SERIALIZED_NAME_IPV6 = "ipv6"; + + @SerializedName(SERIALIZED_NAME_IPV6) + @javax.annotation.Nullable private UpdateNetworkIPv6Body ipv6; + public static final String SERIALIZED_NAME_LABELS = "labels"; @SerializedName(SERIALIZED_NAME_LABELS) @@ -59,44 +66,65 @@ public class PartialUpdateNetworkPayload { @SerializedName(SERIALIZED_NAME_ROUTED) @javax.annotation.Nullable private Boolean routed; + public static final String SERIALIZED_NAME_ROUTING_TABLE_ID = "routingTableId"; + + @SerializedName(SERIALIZED_NAME_ROUTING_TABLE_ID) + @javax.annotation.Nullable private UUID routingTableId; + public PartialUpdateNetworkPayload() {} - public PartialUpdateNetworkPayload addressFamily( - @javax.annotation.Nullable UpdateNetworkAddressFamily addressFamily) { - this.addressFamily = addressFamily; + public PartialUpdateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { + this.dhcp = dhcp; return this; } /** - * Get addressFamily + * Enable or disable DHCP for a network. * - * @return addressFamily + * @return dhcp */ - @javax.annotation.Nullable public UpdateNetworkAddressFamily getAddressFamily() { - return addressFamily; + @javax.annotation.Nullable public Boolean getDhcp() { + return dhcp; } - public void setAddressFamily( - @javax.annotation.Nullable UpdateNetworkAddressFamily addressFamily) { - this.addressFamily = addressFamily; + public void setDhcp(@javax.annotation.Nullable Boolean dhcp) { + this.dhcp = dhcp; } - public PartialUpdateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { - this.dhcp = dhcp; + public PartialUpdateNetworkPayload ipv4(@javax.annotation.Nullable UpdateNetworkIPv4Body ipv4) { + this.ipv4 = ipv4; return this; } /** - * Enable or disable DHCP for a network. + * Get ipv4 * - * @return dhcp + * @return ipv4 */ - @javax.annotation.Nullable public Boolean getDhcp() { - return dhcp; + @javax.annotation.Nullable public UpdateNetworkIPv4Body getIpv4() { + return ipv4; } - public void setDhcp(@javax.annotation.Nullable Boolean dhcp) { - this.dhcp = dhcp; + public void setIpv4(@javax.annotation.Nullable UpdateNetworkIPv4Body ipv4) { + this.ipv4 = ipv4; + } + + public PartialUpdateNetworkPayload ipv6(@javax.annotation.Nullable UpdateNetworkIPv6Body ipv6) { + this.ipv6 = ipv6; + return this; + } + + /** + * Get ipv6 + * + * @return ipv6 + */ + @javax.annotation.Nullable public UpdateNetworkIPv6Body getIpv6() { + return ipv6; + } + + public void setIpv6(@javax.annotation.Nullable UpdateNetworkIPv6Body ipv6) { + this.ipv6 = ipv6; } public PartialUpdateNetworkPayload labels(@javax.annotation.Nullable Object labels) { @@ -108,7 +136,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -156,6 +185,69 @@ public void setRouted(@javax.annotation.Nullable Boolean routed) { this.routed = routed; } + public PartialUpdateNetworkPayload routingTableId( + @javax.annotation.Nullable UUID routingTableId) { + this.routingTableId = routingTableId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return routingTableId + */ + @javax.annotation.Nullable public UUID getRoutingTableId() { + return routingTableId; + } + + public void setRoutingTableId(@javax.annotation.Nullable UUID routingTableId) { + this.routingTableId = routingTableId; + } + + /** + * 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 PartialUpdateNetworkPayload instance itself + */ + public PartialUpdateNetworkPayload 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) { @@ -165,27 +257,38 @@ public boolean equals(Object o) { return false; } PartialUpdateNetworkPayload partialUpdateNetworkPayload = (PartialUpdateNetworkPayload) o; - return Objects.equals(this.addressFamily, partialUpdateNetworkPayload.addressFamily) - && Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) + return Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) + && Objects.equals(this.ipv4, partialUpdateNetworkPayload.ipv4) + && Objects.equals(this.ipv6, partialUpdateNetworkPayload.ipv6) && Objects.equals(this.labels, partialUpdateNetworkPayload.labels) && Objects.equals(this.name, partialUpdateNetworkPayload.name) - && Objects.equals(this.routed, partialUpdateNetworkPayload.routed); + && Objects.equals(this.routed, partialUpdateNetworkPayload.routed) + && Objects.equals(this.routingTableId, partialUpdateNetworkPayload.routingTableId) + && Objects.equals( + this.additionalProperties, + partialUpdateNetworkPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(addressFamily, dhcp, labels, name, routed); + return Objects.hash( + dhcp, ipv4, ipv6, labels, name, routed, routingTableId, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PartialUpdateNetworkPayload {\n"); - sb.append(" addressFamily: ").append(toIndentedString(addressFamily)).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"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" routed: ").append(toIndentedString(routed)).append("\n"); + sb.append(" routingTableId: ").append(toIndentedString(routingTableId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -208,7 +311,14 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet( - Arrays.asList("addressFamily", "dhcp", "labels", "name", "routed")); + Arrays.asList( + "dhcp", + "ipv4", + "ipv6", + "labels", + "name", + "routed", + "routingTableId")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -227,33 +337,36 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in PartialUpdateNetworkPayload is not found in the empty JSON string", PartialUpdateNetworkPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PartialUpdateNetworkPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `PartialUpdateNetworkPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `addressFamily` - if (jsonObj.get("addressFamily") != null && !jsonObj.get("addressFamily").isJsonNull()) { - UpdateNetworkAddressFamily.validateJsonElement(jsonObj.get("addressFamily")); + // validate the optional field `ipv4` + if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { + UpdateNetworkIPv4Body.validateJsonElement(jsonObj.get("ipv4")); + } + // validate the optional field `ipv6` + if (jsonObj.get("ipv6") != null && !jsonObj.get("ipv6").isJsonNull()) { + UpdateNetworkIPv6Body.validateJsonElement(jsonObj.get("ipv6")); } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !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("routingTableId") != null && !jsonObj.get("routingTableId").isJsonNull()) + && !jsonObj.get("routingTableId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `routingTableId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("routingTableId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -274,6 +387,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, PartialUpdateNetworkPayload 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); } @@ -281,7 +418,42 @@ public void write(JsonWriter out, PartialUpdateNetworkPayload value) public PartialUpdateNetworkPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PartialUpdateNetworkPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PortRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PortRange.java index 0d79b7f7..7f70b358 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PortRange.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PortRange.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents a range of ports. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class PortRange { public static final String SERIALIZED_NAME_MAX = "max"; @@ -86,6 +87,50 @@ public void setMin(@javax.annotation.Nonnull Long min) { this.min = min; } + /** + * 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 PortRange instance itself + */ + public PortRange 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) { @@ -95,12 +140,14 @@ public boolean equals(Object o) { return false; } PortRange portRange = (PortRange) o; - return Objects.equals(this.max, portRange.max) && Objects.equals(this.min, portRange.min); + return Objects.equals(this.max, portRange.max) + && Objects.equals(this.min, portRange.min) + && Objects.equals(this.additionalProperties, portRange.additionalProperties); } @Override public int hashCode() { - return Objects.hash(max, min); + return Objects.hash(max, min, additionalProperties); } @Override @@ -109,6 +156,9 @@ public String toString() { sb.append("class PortRange {\n"); sb.append(" max: ").append(toIndentedString(max)).append("\n"); sb.append(" min: ").append(toIndentedString(min)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -147,29 +197,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in PortRange is not found in the empty JSON string", PortRange.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PortRange.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `PortRange` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PortRange.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -191,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PortRange 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); } @@ -198,7 +264,41 @@ public void write(JsonWriter out, PortRange value) throws IOException { public PortRange read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PortRange 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Project.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Project.java index a563a970..2a0753c3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Project.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Project.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,16 +25,17 @@ 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.Set; import java.util.UUID; /** Object that represents a STACKIT project. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Project { public static final String SERIALIZED_NAME_AREA_ID = "areaId"; @@ -47,27 +48,22 @@ public class Project { @SerializedName(SERIALIZED_NAME_CREATED_AT) @javax.annotation.Nullable private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private UUID id; + public static final String SERIALIZED_NAME_INTERNET_ACCESS = "internetAccess"; @SerializedName(SERIALIZED_NAME_INTERNET_ACCESS) @javax.annotation.Nullable private Boolean internetAccess; - public static final String SERIALIZED_NAME_OPENSTACK_PROJECT_ID = "openstackProjectId"; - - @SerializedName(SERIALIZED_NAME_OPENSTACK_PROJECT_ID) - @javax.annotation.Nullable private String openstackProjectId; - - public static final String SERIALIZED_NAME_PROJECT_ID = "projectId"; - - @SerializedName(SERIALIZED_NAME_PROJECT_ID) - @javax.annotation.Nonnull - private UUID projectId; - - public static final String SERIALIZED_NAME_STATE = "state"; + public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATE) + @SerializedName(SERIALIZED_NAME_STATUS) @javax.annotation.Nonnull - private String state; + private String status; public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; @@ -76,10 +72,9 @@ public class Project { public Project() {} - public Project(OffsetDateTime createdAt, String openstackProjectId, OffsetDateTime updatedAt) { + public Project(OffsetDateTime createdAt, OffsetDateTime updatedAt) { this(); this.createdAt = createdAt; - this.openstackProjectId = openstackProjectId; this.updatedAt = updatedAt; } @@ -111,6 +106,25 @@ public void setAreaId(@javax.annotation.Nonnull AreaId areaId) { return createdAt; } + public Project 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 Project internetAccess(@javax.annotation.Nullable Boolean internetAccess) { this.internetAccess = internetAccess; return this; @@ -129,62 +143,78 @@ public void setInternetAccess(@javax.annotation.Nullable Boolean internetAccess) this.internetAccess = internetAccess; } + public Project status(@javax.annotation.Nonnull String status) { + this.status = status; + return this; + } + /** - * The identifier (ID) of the OpenStack project in the main region eu01. + * The state of a resource object. Possible values: `CREATING`, `CREATED`, + * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, + * `UPDATING`. * - * @return openstackProjectId + * @return status */ - @javax.annotation.Nullable public String getOpenstackProjectId() { - return openstackProjectId; + @javax.annotation.Nonnull + public String getStatus() { + return status; } - public Project projectId(@javax.annotation.Nonnull UUID projectId) { - this.projectId = projectId; - return this; + public void setStatus(@javax.annotation.Nonnull String status) { + this.status = status; } /** - * Universally Unique Identifier (UUID). + * Date-time when resource was last updated. * - * @return projectId + * @return updatedAt */ - @javax.annotation.Nonnull - public UUID getProjectId() { - return projectId; + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; } - public void setProjectId(@javax.annotation.Nonnull UUID projectId) { - this.projectId = projectId; - } + /** + * 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; - public Project state(@javax.annotation.Nonnull String state) { - this.state = state; + /** + * 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 Project instance itself + */ + public Project putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); return this; } /** - * The state of a resource object. Possible values: `CREATING`, `CREATED`, - * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, - * `UPDATING`. + * Return the additional (undeclared) property. * - * @return state + * @return a map of objects */ - @javax.annotation.Nonnull - public String getState() { - return state; - } - - public void setState(@javax.annotation.Nonnull String state) { - this.state = state; + public Map getAdditionalProperties() { + return additionalProperties; } /** - * Date-time when resource was last updated. + * Return the additional (undeclared) property with the specified name. * - * @return updatedAt + * @param key name of the property + * @return an object */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); } @Override @@ -198,17 +228,17 @@ public boolean equals(Object o) { Project project = (Project) o; return Objects.equals(this.areaId, project.areaId) && Objects.equals(this.createdAt, project.createdAt) + && Objects.equals(this.id, project.id) && Objects.equals(this.internetAccess, project.internetAccess) - && Objects.equals(this.openstackProjectId, project.openstackProjectId) - && Objects.equals(this.projectId, project.projectId) - && Objects.equals(this.state, project.state) - && Objects.equals(this.updatedAt, project.updatedAt); + && Objects.equals(this.status, project.status) + && Objects.equals(this.updatedAt, project.updatedAt) + && Objects.equals(this.additionalProperties, project.additionalProperties); } @Override public int hashCode() { return Objects.hash( - areaId, createdAt, internetAccess, openstackProjectId, projectId, state, updatedAt); + areaId, createdAt, id, internetAccess, status, updatedAt, additionalProperties); } @Override @@ -217,13 +247,13 @@ public String toString() { sb.append("class Project {\n"); sb.append(" areaId: ").append(toIndentedString(areaId)).append("\n"); 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(" openstackProjectId: ") - .append(toIndentedString(openstackProjectId)) - .append("\n"); - sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -249,14 +279,13 @@ private String toIndentedString(Object o) { Arrays.asList( "areaId", "createdAt", + "id", "internetAccess", - "openstackProjectId", - "projectId", - "state", + "status", "updatedAt")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("areaId", "projectId", "state")); + openapiRequiredFields = new HashSet(Arrays.asList("areaId", "id", "status")); } /** @@ -271,53 +300,39 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Project is not found in the empty JSON string", Project.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Project.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Project` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Project.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `areaId` AreaId.validateJsonElement(jsonObj.get("areaId")); - if ((jsonObj.get("openstackProjectId") != null - && !jsonObj.get("openstackProjectId").isJsonNull()) - && !jsonObj.get("openstackProjectId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `openstackProjectId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("openstackProjectId").toString())); - } - if (!jsonObj.get("projectId").isJsonPrimitive()) { + if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `projectId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("projectId").toString())); + 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("state").isJsonPrimitive()) { + if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `state` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("state").toString())); + java.util.Locale.ROOT, + "Expected the field `status` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("status").toString())); } } @@ -337,6 +352,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Project 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); } @@ -344,7 +383,41 @@ public void write(JsonWriter out, Project value) throws IOException { public Project read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Project 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ProjectListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ProjectListResponse.java index 2d64ef32..13b86402 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ProjectListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ProjectListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,17 +25,17 @@ 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; -import java.util.Set; import java.util.UUID; /** Project list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ProjectListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 ProjectListResponse instance itself + */ + public ProjectListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } ProjectListResponse projectListResponse = (ProjectListResponse) o; - return Objects.equals(this.items, projectListResponse.items); + return Objects.equals(this.items, projectListResponse.items) + && Objects.equals( + this.additionalProperties, projectListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProjectListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ProjectListResponse is not found in the empty JSON string", ProjectListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ProjectListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ProjectListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -165,6 +206,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } else 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())); } @@ -187,6 +229,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, ProjectListResponse 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); } @@ -194,7 +260,41 @@ public void write(JsonWriter out, ProjectListResponse value) public ProjectListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProjectListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Protocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Protocol.java index 8b5f0c08..ac1dfedb 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Protocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Protocol.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** The schema for a protocol of a security group rule. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Protocol { public static final String SERIALIZED_NAME_NAME = "name"; @@ -87,6 +88,50 @@ public void setNumber(@javax.annotation.Nullable Long number) { this.number = number; } + /** + * 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 Protocol instance itself + */ + public Protocol 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) { @@ -97,12 +142,13 @@ public boolean equals(Object o) { } Protocol protocol = (Protocol) o; return Objects.equals(this.name, protocol.name) - && Objects.equals(this.number, protocol.number); + && Objects.equals(this.number, protocol.number) + && Objects.equals(this.additionalProperties, protocol.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, number); + return Objects.hash(name, number, additionalProperties); } @Override @@ -111,6 +157,9 @@ public String toString() { sb.append("class Protocol {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -149,26 +198,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Protocol is not found in the empty JSON string", Protocol.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Protocol.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Protocol` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !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())); } @@ -190,6 +230,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Protocol 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); } @@ -197,7 +261,41 @@ public void write(JsonWriter out, Protocol value) throws IOException { public Protocol read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Protocol 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIp.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIp.java index f0ab0d1d..c45f81ce 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIp.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIp.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,17 +24,18 @@ 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; -import java.util.Set; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class PublicIp { public static final String SERIALIZED_NAME_ID = "id"; @@ -74,7 +75,7 @@ public PublicIp(UUID id, String ip) { } /** - * Object that represents an IP address. + * String that represents an IPv4 address. * * @return ip */ @@ -91,7 +92,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -121,6 +123,50 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * 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 PublicIp instance itself + */ + public PublicIp 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) { @@ -133,7 +179,8 @@ public boolean equals(Object o) { return Objects.equals(this.id, publicIp.id) && Objects.equals(this.ip, publicIp.ip) && Objects.equals(this.labels, publicIp.labels) - && Objects.equals(this.networkInterface, publicIp.networkInterface); + && Objects.equals(this.networkInterface, publicIp.networkInterface) + && Objects.equals(this.additionalProperties, publicIp.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -147,7 +194,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface); + return Objects.hash(id, ip, labels, networkInterface, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -165,6 +212,9 @@ public String toString() { sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -204,26 +254,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in PublicIp is not found in the empty JSON string", PublicIp.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PublicIp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `PublicIp` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); 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())); } @@ -231,6 +272,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ip").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ip").toString())); } @@ -239,6 +281,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("networkInterface").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `networkInterface` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkInterface").toString())); } @@ -260,6 +303,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PublicIp 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); } @@ -267,7 +334,41 @@ public void write(JsonWriter out, PublicIp value) throws IOException { public PublicIp read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicIp 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIpListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIpListResponse.java index e8910647..f6181e2f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIpListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIpListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Public IP list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class PublicIpListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 PublicIpListResponse instance itself + */ + public PublicIpListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } PublicIpListResponse publicIpListResponse = (PublicIpListResponse) o; - return Objects.equals(this.items, publicIpListResponse.items); + return Objects.equals(this.items, publicIpListResponse.items) + && Objects.equals( + this.additionalProperties, publicIpListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PublicIpListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in PublicIpListResponse is not found in the empty JSON string", PublicIpListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PublicIpListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `PublicIpListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PublicIpListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -191,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, PublicIpListResponse 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); } @@ -198,7 +264,41 @@ public void write(JsonWriter out, PublicIpListResponse value) public PublicIpListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicIpListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetwork.java index 2e7de214..3c3b4809 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetwork.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetwork.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Public network. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class PublicNetwork { public static final String SERIALIZED_NAME_CIDR = "cidr"; @@ -40,6 +41,12 @@ public class PublicNetwork { @javax.annotation.Nonnull private String cidr; + public static final String SERIALIZED_NAME_REGION = "region"; + + @SerializedName(SERIALIZED_NAME_REGION) + @javax.annotation.Nonnull + private String region; + public PublicNetwork() {} public PublicNetwork cidr(@javax.annotation.Nonnull String cidr) { @@ -61,6 +68,69 @@ public void setCidr(@javax.annotation.Nonnull String cidr) { this.cidr = cidr; } + public PublicNetwork region(@javax.annotation.Nonnull String region) { + this.region = region; + return this; + } + + /** + * Name of the region. + * + * @return region + */ + @javax.annotation.Nonnull + public String getRegion() { + return region; + } + + public void setRegion(@javax.annotation.Nonnull String region) { + this.region = region; + } + + /** + * 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 PublicNetwork instance itself + */ + public PublicNetwork 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) { @@ -70,12 +140,14 @@ public boolean equals(Object o) { return false; } PublicNetwork publicNetwork = (PublicNetwork) o; - return Objects.equals(this.cidr, publicNetwork.cidr); + return Objects.equals(this.cidr, publicNetwork.cidr) + && Objects.equals(this.region, publicNetwork.region) + && Objects.equals(this.additionalProperties, publicNetwork.additionalProperties); } @Override public int hashCode() { - return Objects.hash(cidr); + return Objects.hash(cidr, region, additionalProperties); } @Override @@ -83,6 +155,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PublicNetwork {\n"); sb.append(" cidr: ").append(toIndentedString(cidr)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -103,10 +179,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("cidr")); + openapiFields = new HashSet(Arrays.asList("cidr", "region")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("cidr")); + openapiRequiredFields = new HashSet(Arrays.asList("cidr", "region")); } /** @@ -121,38 +197,38 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in PublicNetwork is not found in the empty JSON string", PublicNetwork.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PublicNetwork.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `PublicNetwork` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PublicNetwork.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("cidr").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `cidr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cidr").toString())); } + if (!jsonObj.get("region").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `region` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("region").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -171,6 +247,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, PublicNetwork 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); } @@ -178,7 +278,41 @@ public void write(JsonWriter out, PublicNetwork value) throws IOException { public PublicNetwork read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicNetwork 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetworkListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetworkListResponse.java index a2614c0f..f3f6ff47 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetworkListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetworkListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Public network list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class PublicNetworkListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 PublicNetworkListResponse instance itself + */ + public PublicNetworkListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } PublicNetworkListResponse publicNetworkListResponse = (PublicNetworkListResponse) o; - return Objects.equals(this.items, publicNetworkListResponse.items); + return Objects.equals(this.items, publicNetworkListResponse.items) + && Objects.equals( + this.additionalProperties, publicNetworkListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PublicNetworkListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in PublicNetworkListResponse is not found in the empty JSON string", PublicNetworkListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PublicNetworkListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `PublicNetworkListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PublicNetworkListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -192,6 +234,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, PublicNetworkListResponse 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); } @@ -199,7 +265,41 @@ public void write(JsonWriter out, PublicNetworkListResponse value) public PublicNetworkListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicNetworkListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Quota.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Quota.java index 839d74a6..a86fc701 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Quota.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Quota.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents a single resource quota. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Quota { public static final String SERIALIZED_NAME_LIMIT = "limit"; @@ -86,6 +87,50 @@ public void setUsage(@javax.annotation.Nonnull Long usage) { this.usage = usage; } + /** + * 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 Quota instance itself + */ + public Quota 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) { @@ -95,12 +140,14 @@ public boolean equals(Object o) { return false; } Quota quota = (Quota) o; - return Objects.equals(this.limit, quota.limit) && Objects.equals(this.usage, quota.usage); + return Objects.equals(this.limit, quota.limit) + && Objects.equals(this.usage, quota.usage) + && Objects.equals(this.additionalProperties, quota.additionalProperties); } @Override public int hashCode() { - return Objects.hash(limit, usage); + return Objects.hash(limit, usage, additionalProperties); } @Override @@ -109,6 +156,9 @@ public String toString() { sb.append("class Quota {\n"); sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -147,29 +197,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Quota is not found in the empty JSON string", Quota.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Quota.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Quota` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Quota.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -191,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Quota 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); } @@ -198,7 +264,41 @@ public void write(JsonWriter out, Quota value) throws IOException { public Quota read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Quota 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaList.java index 2a3875f6..fe03ddd6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaList.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaList.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents the quotas for a project. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class QuotaList { public static final String SERIALIZED_NAME_BACKUP_GIGABYTES = "backupGigabytes"; @@ -336,6 +337,50 @@ public void setVolumes(@javax.annotation.Nonnull Quota volumes) { this.volumes = volumes; } + /** + * 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 QuotaList instance itself + */ + public QuotaList 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) { @@ -356,7 +401,8 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, quotaList.securityGroups) && Objects.equals(this.snapshots, quotaList.snapshots) && Objects.equals(this.vcpu, quotaList.vcpu) - && Objects.equals(this.volumes, quotaList.volumes); + && Objects.equals(this.volumes, quotaList.volumes) + && Objects.equals(this.additionalProperties, quotaList.additionalProperties); } @Override @@ -373,7 +419,8 @@ public int hashCode() { securityGroups, snapshots, vcpu, - volumes); + volumes, + additionalProperties); } @Override @@ -394,6 +441,9 @@ public String toString() { sb.append(" snapshots: ").append(toIndentedString(snapshots)).append("\n"); sb.append(" vcpu: ").append(toIndentedString(vcpu)).append("\n"); sb.append(" volumes: ").append(toIndentedString(volumes)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -460,29 +510,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in QuotaList is not found in the empty JSON string", QuotaList.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QuotaList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `QuotaList` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : QuotaList.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -528,6 +570,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, QuotaList 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); } @@ -535,7 +601,41 @@ public void write(JsonWriter out, QuotaList value) throws IOException { public QuotaList read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + QuotaList 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaListResponse.java index 6407b61f..76392511 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Quotas list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class QuotaListResponse { public static final String SERIALIZED_NAME_QUOTAS = "quotas"; @@ -61,6 +62,50 @@ public void setQuotas(@javax.annotation.Nonnull QuotaList quotas) { this.quotas = quotas; } + /** + * 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 QuotaListResponse instance itself + */ + public QuotaListResponse 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) { @@ -70,12 +115,14 @@ public boolean equals(Object o) { return false; } QuotaListResponse quotaListResponse = (QuotaListResponse) o; - return Objects.equals(this.quotas, quotaListResponse.quotas); + return Objects.equals(this.quotas, quotaListResponse.quotas) + && Objects.equals( + this.additionalProperties, quotaListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(quotas); + return Objects.hash(quotas, additionalProperties); } @Override @@ -83,6 +130,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class QuotaListResponse {\n"); sb.append(" quotas: ").append(toIndentedString(quotas)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -121,29 +171,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in QuotaListResponse is not found in the empty JSON string", QuotaListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QuotaListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `QuotaListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : QuotaListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -168,6 +210,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, QuotaListResponse 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); } @@ -175,7 +241,41 @@ public void write(JsonWriter out, QuotaListResponse value) public QuotaListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + QuotaListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RegionalArea.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RegionalArea.java new file mode 100644 index 00000000..7cb577c5 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RegionalArea.java @@ -0,0 +1,320 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; + +/** The basic properties of a regional network area. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class RegionalArea { + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private RegionalAreaIPv4 ipv4; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public RegionalArea() {} + + public RegionalArea(String status) { + this(); + this.status = status; + } + + public RegionalArea ipv4(@javax.annotation.Nullable RegionalAreaIPv4 ipv4) { + this.ipv4 = ipv4; + return this; + } + + /** + * Get ipv4 + * + * @return ipv4 + */ + @javax.annotation.Nullable public RegionalAreaIPv4 getIpv4() { + return ipv4; + } + + public void setIpv4(@javax.annotation.Nullable RegionalAreaIPv4 ipv4) { + this.ipv4 = ipv4; + } + + /** + * The state of a resource object. Possible values: `CREATING`, `CREATED`, + * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, + * `UPDATING`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * 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 RegionalArea instance itself + */ + public RegionalArea 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; + } + RegionalArea regionalArea = (RegionalArea) o; + return Objects.equals(this.ipv4, regionalArea.ipv4) + && Objects.equals(this.status, regionalArea.status) + && Objects.equals(this.additionalProperties, regionalArea.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ipv4, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RegionalArea {\n"); + sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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("ipv4", "status")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RegionalArea + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RegionalArea.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 RegionalArea is not found in the empty JSON string", + RegionalArea.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `ipv4` + if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { + RegionalAreaIPv4.validateJsonElement(jsonObj.get("ipv4")); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `status` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RegionalArea.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RegionalArea' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RegionalArea.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RegionalArea 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 RegionalArea read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RegionalArea 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 RegionalArea given an JSON string + * + * @param jsonString JSON string + * @return An instance of RegionalArea + * @throws IOException if the JSON string is invalid with respect to RegionalArea + */ + public static RegionalArea fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RegionalArea.class); + } + + /** + * Convert an instance of RegionalArea 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/model/CreateAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RegionalAreaIPv4.java similarity index 53% rename from services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAreaIPv4.java rename to services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RegionalAreaIPv4.java index e5813f72..c10c99a0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAreaIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RegionalAreaIPv4.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,63 +26,61 @@ 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; -import java.util.Set; -/** The config object for a IPv4 network area. */ +/** The regional IPv4 config of a network area. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class CreateAreaIPv4 { + comments = "Generator version: 7.19.0") +public class RegionalAreaIPv4 { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; @SerializedName(SERIALIZED_NAME_DEFAULT_NAMESERVERS) @javax.annotation.Nullable private List defaultNameservers = new ArrayList<>(); - public static final String SERIALIZED_NAME_NETWORK_RANGES = "networkRanges"; - - @SerializedName(SERIALIZED_NAME_NETWORK_RANGES) - @javax.annotation.Nonnull - private List networkRanges = new ArrayList<>(); - - public static final String SERIALIZED_NAME_ROUTES = "routes"; - - @SerializedName(SERIALIZED_NAME_ROUTES) - @javax.annotation.Nullable private List routes = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TRANSFER_NETWORK = "transferNetwork"; - - @SerializedName(SERIALIZED_NAME_TRANSFER_NETWORK) - @javax.annotation.Nonnull - private String transferNetwork; - public static final String SERIALIZED_NAME_DEFAULT_PREFIX_LEN = "defaultPrefixLen"; @SerializedName(SERIALIZED_NAME_DEFAULT_PREFIX_LEN) - @javax.annotation.Nullable private Integer defaultPrefixLen = 25; + @javax.annotation.Nonnull + private Long defaultPrefixLen = 25l; public static final String SERIALIZED_NAME_MAX_PREFIX_LEN = "maxPrefixLen"; @SerializedName(SERIALIZED_NAME_MAX_PREFIX_LEN) - @javax.annotation.Nullable private Integer maxPrefixLen = 29; + @javax.annotation.Nonnull + private Long maxPrefixLen = 29l; public static final String SERIALIZED_NAME_MIN_PREFIX_LEN = "minPrefixLen"; @SerializedName(SERIALIZED_NAME_MIN_PREFIX_LEN) - @javax.annotation.Nullable private Integer minPrefixLen = 24; + @javax.annotation.Nonnull + private Long minPrefixLen = 24l; + + public static final String SERIALIZED_NAME_NETWORK_RANGES = "networkRanges"; + + @SerializedName(SERIALIZED_NAME_NETWORK_RANGES) + @javax.annotation.Nonnull + private List networkRanges = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TRANSFER_NETWORK = "transferNetwork"; + + @SerializedName(SERIALIZED_NAME_TRANSFER_NETWORK) + @javax.annotation.Nonnull + private String transferNetwork; - public CreateAreaIPv4() {} + public RegionalAreaIPv4() {} - public CreateAreaIPv4 defaultNameservers( + public RegionalAreaIPv4 defaultNameservers( @javax.annotation.Nullable List defaultNameservers) { this.defaultNameservers = defaultNameservers; return this; } - public CreateAreaIPv4 addDefaultNameserversItem(String defaultNameserversItem) { + public RegionalAreaIPv4 addDefaultNameserversItem(String defaultNameserversItem) { if (this.defaultNameservers == null) { this.defaultNameservers = new ArrayList<>(); } @@ -103,131 +101,152 @@ public void setDefaultNameservers(@javax.annotation.Nullable List defaul this.defaultNameservers = defaultNameservers; } - public CreateAreaIPv4 networkRanges( - @javax.annotation.Nonnull List networkRanges) { - this.networkRanges = networkRanges; - return this; - } - - public CreateAreaIPv4 addNetworkRangesItem(NetworkRange networkRangesItem) { - if (this.networkRanges == null) { - this.networkRanges = new ArrayList<>(); - } - this.networkRanges.add(networkRangesItem); + public RegionalAreaIPv4 defaultPrefixLen(@javax.annotation.Nonnull Long defaultPrefixLen) { + this.defaultPrefixLen = defaultPrefixLen; return this; } /** - * A list of network ranges. + * The default prefix length for networks in the network area. minimum: 24 maximum: 29 * - * @return networkRanges + * @return defaultPrefixLen */ @javax.annotation.Nonnull - public List getNetworkRanges() { - return networkRanges; - } - - public void setNetworkRanges(@javax.annotation.Nonnull List networkRanges) { - this.networkRanges = networkRanges; + public Long getDefaultPrefixLen() { + return defaultPrefixLen; } - public CreateAreaIPv4 routes(@javax.annotation.Nullable List routes) { - this.routes = routes; - return this; + public void setDefaultPrefixLen(@javax.annotation.Nonnull Long defaultPrefixLen) { + this.defaultPrefixLen = defaultPrefixLen; } - public CreateAreaIPv4 addRoutesItem(Route routesItem) { - if (this.routes == null) { - this.routes = new ArrayList<>(); - } - this.routes.add(routesItem); + public RegionalAreaIPv4 maxPrefixLen(@javax.annotation.Nonnull Long maxPrefixLen) { + this.maxPrefixLen = maxPrefixLen; return this; } /** - * A list of routes. + * The maximal prefix length for networks in the network area. minimum: 24 maximum: 29 * - * @return routes + * @return maxPrefixLen */ - @javax.annotation.Nullable public List getRoutes() { - return routes; + @javax.annotation.Nonnull + public Long getMaxPrefixLen() { + return maxPrefixLen; } - public void setRoutes(@javax.annotation.Nullable List routes) { - this.routes = routes; + public void setMaxPrefixLen(@javax.annotation.Nonnull Long maxPrefixLen) { + this.maxPrefixLen = maxPrefixLen; } - public CreateAreaIPv4 transferNetwork(@javax.annotation.Nonnull String transferNetwork) { - this.transferNetwork = transferNetwork; + public RegionalAreaIPv4 minPrefixLen(@javax.annotation.Nonnull Long minPrefixLen) { + this.minPrefixLen = minPrefixLen; return this; } /** - * Classless Inter-Domain Routing (CIDR). + * The minimal prefix length for networks in the network area. minimum: 8 maximum: 29 * - * @return transferNetwork + * @return minPrefixLen */ @javax.annotation.Nonnull - public String getTransferNetwork() { - return transferNetwork; + public Long getMinPrefixLen() { + return minPrefixLen; } - public void setTransferNetwork(@javax.annotation.Nonnull String transferNetwork) { - this.transferNetwork = transferNetwork; + public void setMinPrefixLen(@javax.annotation.Nonnull Long minPrefixLen) { + this.minPrefixLen = minPrefixLen; } - public CreateAreaIPv4 defaultPrefixLen(@javax.annotation.Nullable Integer defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; + public RegionalAreaIPv4 networkRanges( + @javax.annotation.Nonnull List networkRanges) { + this.networkRanges = networkRanges; + return this; + } + + public RegionalAreaIPv4 addNetworkRangesItem(NetworkRange networkRangesItem) { + if (this.networkRanges == null) { + this.networkRanges = new ArrayList<>(); + } + this.networkRanges.add(networkRangesItem); return this; } /** - * The default prefix length for networks in the network area. minimum: 24 maximum: 29 + * A list of network ranges. * - * @return defaultPrefixLen + * @return networkRanges */ - @javax.annotation.Nullable public Integer getDefaultPrefixLen() { - return defaultPrefixLen; + @javax.annotation.Nonnull + public List getNetworkRanges() { + return networkRanges; } - public void setDefaultPrefixLen(@javax.annotation.Nullable Integer defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; + public void setNetworkRanges(@javax.annotation.Nonnull List networkRanges) { + this.networkRanges = networkRanges; } - public CreateAreaIPv4 maxPrefixLen(@javax.annotation.Nullable Integer maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; + public RegionalAreaIPv4 transferNetwork(@javax.annotation.Nonnull String transferNetwork) { + this.transferNetwork = transferNetwork; return this; } /** - * The maximal prefix length for networks in the network area. minimum: 24 maximum: 29 + * IPv4 Classless Inter-Domain Routing (CIDR). * - * @return maxPrefixLen + * @return transferNetwork */ - @javax.annotation.Nullable public Integer getMaxPrefixLen() { - return maxPrefixLen; + @javax.annotation.Nonnull + public String getTransferNetwork() { + return transferNetwork; } - public void setMaxPrefixLen(@javax.annotation.Nullable Integer maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; + public void setTransferNetwork(@javax.annotation.Nonnull String transferNetwork) { + this.transferNetwork = transferNetwork; } - public CreateAreaIPv4 minPrefixLen(@javax.annotation.Nullable Integer minPrefixLen) { - this.minPrefixLen = minPrefixLen; + /** + * 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 RegionalAreaIPv4 instance itself + */ + public RegionalAreaIPv4 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); return this; } /** - * The minimal prefix length for networks in the network area. minimum: 8 maximum: 29 + * Return the additional (undeclared) property. * - * @return minPrefixLen + * @return a map of objects */ - @javax.annotation.Nullable public Integer getMinPrefixLen() { - return minPrefixLen; + public Map getAdditionalProperties() { + return additionalProperties; } - public void setMinPrefixLen(@javax.annotation.Nullable Integer minPrefixLen) { - this.minPrefixLen = minPrefixLen; + /** + * 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 @@ -238,41 +257,43 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CreateAreaIPv4 createAreaIPv4 = (CreateAreaIPv4) o; - return Objects.equals(this.defaultNameservers, createAreaIPv4.defaultNameservers) - && Objects.equals(this.networkRanges, createAreaIPv4.networkRanges) - && Objects.equals(this.routes, createAreaIPv4.routes) - && Objects.equals(this.transferNetwork, createAreaIPv4.transferNetwork) - && Objects.equals(this.defaultPrefixLen, createAreaIPv4.defaultPrefixLen) - && Objects.equals(this.maxPrefixLen, createAreaIPv4.maxPrefixLen) - && Objects.equals(this.minPrefixLen, createAreaIPv4.minPrefixLen); + RegionalAreaIPv4 regionalAreaIPv4 = (RegionalAreaIPv4) o; + return Objects.equals(this.defaultNameservers, regionalAreaIPv4.defaultNameservers) + && Objects.equals(this.defaultPrefixLen, regionalAreaIPv4.defaultPrefixLen) + && Objects.equals(this.maxPrefixLen, regionalAreaIPv4.maxPrefixLen) + && Objects.equals(this.minPrefixLen, regionalAreaIPv4.minPrefixLen) + && Objects.equals(this.networkRanges, regionalAreaIPv4.networkRanges) + && Objects.equals(this.transferNetwork, regionalAreaIPv4.transferNetwork) + && Objects.equals(this.additionalProperties, regionalAreaIPv4.additionalProperties); } @Override public int hashCode() { return Objects.hash( defaultNameservers, - networkRanges, - routes, - transferNetwork, defaultPrefixLen, maxPrefixLen, - minPrefixLen); + minPrefixLen, + networkRanges, + transferNetwork, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CreateAreaIPv4 {\n"); + sb.append("class RegionalAreaIPv4 {\n"); sb.append(" defaultNameservers: ") .append(toIndentedString(defaultNameservers)) .append("\n"); - sb.append(" networkRanges: ").append(toIndentedString(networkRanges)).append("\n"); - sb.append(" routes: ").append(toIndentedString(routes)).append("\n"); - sb.append(" transferNetwork: ").append(toIndentedString(transferNetwork)).append("\n"); sb.append(" defaultPrefixLen: ").append(toIndentedString(defaultPrefixLen)).append("\n"); sb.append(" maxPrefixLen: ").append(toIndentedString(maxPrefixLen)).append("\n"); sb.append(" minPrefixLen: ").append(toIndentedString(minPrefixLen)).append("\n"); + sb.append(" networkRanges: ").append(toIndentedString(networkRanges)).append("\n"); + sb.append(" transferNetwork: ").append(toIndentedString(transferNetwork)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -297,53 +318,50 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "defaultNameservers", - "networkRanges", - "routes", - "transferNetwork", "defaultPrefixLen", "maxPrefixLen", - "minPrefixLen")); + "minPrefixLen", + "networkRanges", + "transferNetwork")); // a set of required properties/fields (JSON key names) openapiRequiredFields = - new HashSet(Arrays.asList("networkRanges", "transferNetwork")); + new HashSet( + Arrays.asList( + "defaultPrefixLen", + "maxPrefixLen", + "minPrefixLen", + "networkRanges", + "transferNetwork")); } /** * 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 CreateAreaIPv4 + * @throws IOException if the JSON Element is invalid with respect to RegionalAreaIPv4 */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!CreateAreaIPv4.openapiRequiredFields + if (!RegionalAreaIPv4.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in CreateAreaIPv4 is not found in the empty JSON string", - CreateAreaIPv4.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateAreaIPv4.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `CreateAreaIPv4` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); + java.util.Locale.ROOT, + "The required field(s) %s in RegionalAreaIPv4 is not found in the empty JSON string", + RegionalAreaIPv4.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateAreaIPv4.openapiRequiredFields) { + for (String requiredField : RegionalAreaIPv4.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -353,6 +371,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("defaultNameservers").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `defaultNameservers` to be an array in the JSON string but got `%s`", jsonObj.get("defaultNameservers").toString())); } @@ -360,6 +379,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("networkRanges").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `networkRanges` to be an array in the JSON string but got `%s`", jsonObj.get("networkRanges").toString())); } @@ -370,27 +390,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NetworkRange.validateJsonElement(jsonArraynetworkRanges.get(i)); } ; - if (jsonObj.get("routes") != null && !jsonObj.get("routes").isJsonNull()) { - JsonArray jsonArrayroutes = jsonObj.getAsJsonArray("routes"); - if (jsonArrayroutes != null) { - // ensure the json data is an array - if (!jsonObj.get("routes").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `routes` to be an array in the JSON string but got `%s`", - jsonObj.get("routes").toString())); - } - - // validate the optional field `routes` (array) - for (int i = 0; i < jsonArrayroutes.size(); i++) { - Route.validateJsonElement(jsonArrayroutes.get(i)); - } - ; - } - } if (!jsonObj.get("transferNetwork").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `transferNetwork` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferNetwork").toString())); } @@ -400,44 +403,103 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateAreaIPv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateAreaIPv4' and its subtypes + if (!RegionalAreaIPv4.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RegionalAreaIPv4' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateAreaIPv4.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RegionalAreaIPv4.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, CreateAreaIPv4 value) throws IOException { + public void write(JsonWriter out, RegionalAreaIPv4 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 CreateAreaIPv4 read(JsonReader in) throws IOException { + public RegionalAreaIPv4 read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RegionalAreaIPv4 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 CreateAreaIPv4 given an JSON string + * Create an instance of RegionalAreaIPv4 given an JSON string * * @param jsonString JSON string - * @return An instance of CreateAreaIPv4 - * @throws IOException if the JSON string is invalid with respect to CreateAreaIPv4 + * @return An instance of RegionalAreaIPv4 + * @throws IOException if the JSON string is invalid with respect to RegionalAreaIPv4 */ - public static CreateAreaIPv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateAreaIPv4.class); + public static RegionalAreaIPv4 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RegionalAreaIPv4.class); } /** - * Convert an instance of CreateAreaIPv4 to an JSON string + * Convert an instance of RegionalAreaIPv4 to an JSON string * * @return JSON string */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RegionalAreaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RegionalAreaListResponse.java new file mode 100644 index 00000000..609e9b32 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RegionalAreaListResponse.java @@ -0,0 +1,311 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; + +/** Regional area list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class RegionalAreaListResponse { + public static final String SERIALIZED_NAME_REGIONS = "regions"; + + @SerializedName(SERIALIZED_NAME_REGIONS) + @javax.annotation.Nonnull + private Map regions = new HashMap<>(); + + public RegionalAreaListResponse() {} + + public RegionalAreaListResponse regions( + @javax.annotation.Nonnull Map regions) { + this.regions = regions; + return this; + } + + public RegionalAreaListResponse putRegionsItem(String key, RegionalArea regionsItem) { + if (this.regions == null) { + this.regions = new HashMap<>(); + } + this.regions.put(key, regionsItem); + return this; + } + + /** + * Get regions + * + * @return regions + */ + @javax.annotation.Nonnull + public Map getRegions() { + return regions; + } + + public void setRegions(@javax.annotation.Nonnull Map regions) { + this.regions = regions; + } + + /** + * 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 RegionalAreaListResponse instance itself + */ + public RegionalAreaListResponse 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; + } + RegionalAreaListResponse regionalAreaListResponse = (RegionalAreaListResponse) o; + return Objects.equals(this.regions, regionalAreaListResponse.regions) + && Objects.equals( + this.additionalProperties, regionalAreaListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(regions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RegionalAreaListResponse {\n"); + sb.append(" regions: ").append(toIndentedString(regions)).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("regions")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("regions")); + } + + /** + * 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 RegionalAreaListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RegionalAreaListResponse.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 RegionalAreaListResponse is not found in the empty JSON string", + RegionalAreaListResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RegionalAreaListResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The required field `%s` is not found in the JSON string: %s", + requiredField, + jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RegionalAreaListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RegionalAreaListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RegionalAreaListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RegionalAreaListResponse 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 RegionalAreaListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RegionalAreaListResponse 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 RegionalAreaListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RegionalAreaListResponse + * @throws IOException if the JSON string is invalid with respect to RegionalAreaListResponse + */ + public static RegionalAreaListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RegionalAreaListResponse.class); + } + + /** + * Convert an instance of RegionalAreaListResponse 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/model/Request.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Request.java index c726c883..9f654dcc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Request.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Request.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Object that represents a request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Request { public static final String SERIALIZED_NAME_DETAILS = "details"; @@ -201,6 +201,50 @@ public void setStatus(@javax.annotation.Nonnull String status) { this.status = status; } + /** + * 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 Request instance itself + */ + public Request 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) { @@ -215,12 +259,20 @@ public boolean equals(Object o) { && Objects.equals(this.requestId, request.requestId) && Objects.equals(this.requestType, request.requestType) && Objects.equals(this.resources, request.resources) - && Objects.equals(this.status, request.status); + && Objects.equals(this.status, request.status) + && Objects.equals(this.additionalProperties, request.additionalProperties); } @Override public int hashCode() { - return Objects.hash(details, requestAction, requestId, requestType, resources, status); + return Objects.hash( + details, + requestAction, + requestId, + requestType, + resources, + status, + additionalProperties); } @Override @@ -233,6 +285,9 @@ public String toString() { sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n"); sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -286,29 +341,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Request is not found in the empty JSON string", Request.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Request.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Request` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Request.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -316,24 +363,28 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("details").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("details").toString())); } if (!jsonObj.get("requestAction").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `requestAction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestAction").toString())); } if (!jsonObj.get("requestId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `requestId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestId").toString())); } if (!jsonObj.get("requestType").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `requestType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestType").toString())); } @@ -341,6 +392,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("resources").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `resources` to be an array in the JSON string but got `%s`", jsonObj.get("resources").toString())); } @@ -354,6 +406,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -375,6 +428,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Request 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); } @@ -382,7 +459,41 @@ public void write(JsonWriter out, Request value) throws IOException { public Request read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Request 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RequestResource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RequestResource.java index b8cc5833..cd708bef 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RequestResource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RequestResource.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,17 @@ 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; -import java.util.Set; import java.util.UUID; /** Object that represents a resource as part of a request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class RequestResource { public static final String SERIALIZED_NAME_ID = "id"; @@ -117,6 +118,50 @@ 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 RequestResource instance itself + */ + public RequestResource 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) { @@ -128,12 +173,13 @@ public boolean equals(Object o) { RequestResource requestResource = (RequestResource) o; return Objects.equals(this.id, requestResource.id) && Objects.equals(this.status, requestResource.status) - && Objects.equals(this.type, requestResource.type); + && Objects.equals(this.type, requestResource.type) + && Objects.equals(this.additionalProperties, requestResource.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, status, type); + return Objects.hash(id, status, type, additionalProperties); } @Override @@ -143,6 +189,9 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -181,47 +230,42 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in RequestResource is not found in the empty JSON string", RequestResource.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RequestResource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `RequestResource` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : RequestResource.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); 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())); } if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } 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())); } @@ -244,6 +288,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, RequestResource 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); } @@ -251,7 +319,41 @@ public void write(JsonWriter out, RequestResource value) public RequestResource read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RequestResource 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RescueServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RescueServerPayload.java index a6ad9bda..fd5ddcaf 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RescueServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RescueServerPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,17 @@ 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; -import java.util.Set; import java.util.UUID; /** RescueServerPayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class RescueServerPayload { public static final String SERIALIZED_NAME_IMAGE = "image"; @@ -62,6 +63,50 @@ public void setImage(@javax.annotation.Nonnull UUID image) { this.image = image; } + /** + * 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 RescueServerPayload instance itself + */ + public RescueServerPayload 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) { @@ -71,12 +116,14 @@ public boolean equals(Object o) { return false; } RescueServerPayload rescueServerPayload = (RescueServerPayload) o; - return Objects.equals(this.image, rescueServerPayload.image); + return Objects.equals(this.image, rescueServerPayload.image) + && Objects.equals( + this.additionalProperties, rescueServerPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(image); + return Objects.hash(image, additionalProperties); } @Override @@ -84,6 +131,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RescueServerPayload {\n"); sb.append(" image: ").append(toIndentedString(image)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -122,35 +172,28 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in RescueServerPayload is not found in the empty JSON string", RescueServerPayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RescueServerPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `RescueServerPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : RescueServerPayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("image").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `image` to be a primitive type in the JSON string but got `%s`", jsonObj.get("image").toString())); } @@ -173,6 +216,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, RescueServerPayload 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); } @@ -180,7 +247,41 @@ public void write(JsonWriter out, RescueServerPayload value) public RescueServerPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RescueServerPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeServerPayload.java index fa734bc5..b5ce897d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeServerPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** ResizeServerPayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ResizeServerPayload { public static final String SERIALIZED_NAME_MACHINE_TYPE = "machineType"; @@ -61,6 +62,50 @@ public void setMachineType(@javax.annotation.Nonnull String machineType) { this.machineType = machineType; } + /** + * 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 ResizeServerPayload instance itself + */ + public ResizeServerPayload 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) { @@ -70,12 +115,14 @@ public boolean equals(Object o) { return false; } ResizeServerPayload resizeServerPayload = (ResizeServerPayload) o; - return Objects.equals(this.machineType, resizeServerPayload.machineType); + return Objects.equals(this.machineType, resizeServerPayload.machineType) + && Objects.equals( + this.additionalProperties, resizeServerPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(machineType); + return Objects.hash(machineType, additionalProperties); } @Override @@ -83,6 +130,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ResizeServerPayload {\n"); sb.append(" machineType: ").append(toIndentedString(machineType)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -121,35 +171,28 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ResizeServerPayload is not found in the empty JSON string", ResizeServerPayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ResizeServerPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ResizeServerPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ResizeServerPayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("machineType").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `machineType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("machineType").toString())); } @@ -172,6 +215,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, ResizeServerPayload 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); } @@ -179,7 +246,41 @@ public void write(JsonWriter out, ResizeServerPayload value) public ResizeServerPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResizeServerPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeVolumePayload.java index a580373a..a7e5ec06 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeVolumePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** ResizeVolumePayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ResizeVolumePayload { public static final String SERIALIZED_NAME_SIZE = "size"; @@ -61,6 +62,50 @@ public void setSize(@javax.annotation.Nonnull Long size) { this.size = size; } + /** + * 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 ResizeVolumePayload instance itself + */ + public ResizeVolumePayload 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) { @@ -70,12 +115,14 @@ public boolean equals(Object o) { return false; } ResizeVolumePayload resizeVolumePayload = (ResizeVolumePayload) o; - return Objects.equals(this.size, resizeVolumePayload.size); + return Objects.equals(this.size, resizeVolumePayload.size) + && Objects.equals( + this.additionalProperties, resizeVolumePayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(size); + return Objects.hash(size, additionalProperties); } @Override @@ -83,6 +130,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ResizeVolumePayload {\n"); sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -121,29 +171,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ResizeVolumePayload is not found in the empty JSON string", ResizeVolumePayload.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ResizeVolumePayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ResizeVolumePayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ResizeVolumePayload.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -166,6 +208,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, ResizeVolumePayload 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); } @@ -173,7 +239,41 @@ public void write(JsonWriter out, ResizeVolumePayload value) public ResizeVolumePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResizeVolumePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Route.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Route.java index cbc4d073..bfdd1f60 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Route.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Route.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,22 +25,34 @@ 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.Set; import java.util.UUID; /** Object represents a network route. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Route { 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_DESTINATION = "destination"; + + @SerializedName(SERIALIZED_NAME_DESTINATION) + @javax.annotation.Nonnull + private RouteDestination destination; + + 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) @@ -50,18 +62,7 @@ public class Route { @SerializedName(SERIALIZED_NAME_NEXTHOP) @javax.annotation.Nonnull - private String nexthop; - - public static final String SERIALIZED_NAME_PREFIX = "prefix"; - - @SerializedName(SERIALIZED_NAME_PREFIX) - @javax.annotation.Nonnull - private String prefix; - - public static final String SERIALIZED_NAME_ROUTE_ID = "routeId"; - - @SerializedName(SERIALIZED_NAME_ROUTE_ID) - @javax.annotation.Nullable private UUID routeId; + private RouteNexthop nexthop; public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; @@ -70,10 +71,10 @@ public class Route { public Route() {} - public Route(OffsetDateTime createdAt, UUID routeId, OffsetDateTime updatedAt) { + public Route(OffsetDateTime createdAt, UUID id, OffsetDateTime updatedAt) { this(); this.createdAt = createdAt; - this.routeId = routeId; + this.id = id; this.updatedAt = updatedAt; } @@ -86,6 +87,34 @@ public Route(OffsetDateTime createdAt, UUID routeId, OffsetDateTime updatedAt) { return createdAt; } + public Route 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; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + public Route labels(@javax.annotation.Nullable Object labels) { this.labels = labels; return this; @@ -95,7 +124,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -107,60 +137,76 @@ public void setLabels(@javax.annotation.Nullable Object labels) { this.labels = labels; } - public Route nexthop(@javax.annotation.Nonnull String nexthop) { + public Route nexthop(@javax.annotation.Nonnull RouteNexthop nexthop) { this.nexthop = nexthop; return this; } /** - * Object that represents an IP address. + * Get nexthop * * @return nexthop */ @javax.annotation.Nonnull - public String getNexthop() { + public RouteNexthop getNexthop() { return nexthop; } - public void setNexthop(@javax.annotation.Nonnull String nexthop) { + public void setNexthop(@javax.annotation.Nonnull RouteNexthop nexthop) { this.nexthop = nexthop; } - public Route prefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; - return this; - } - /** - * Classless Inter-Domain Routing (CIDR). + * Date-time when resource was last updated. * - * @return prefix + * @return updatedAt */ - @javax.annotation.Nonnull - public String getPrefix() { - return prefix; + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; } - public void setPrefix(@javax.annotation.Nonnull String prefix) { - this.prefix = prefix; + /** + * 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 Route instance itself + */ + public Route putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; } /** - * Universally Unique Identifier (UUID). + * Return the additional (undeclared) property. * - * @return routeId + * @return a map of objects */ - @javax.annotation.Nullable public UUID getRouteId() { - return routeId; + public Map getAdditionalProperties() { + return additionalProperties; } /** - * Date-time when resource was last updated. + * Return the additional (undeclared) property with the specified name. * - * @return updatedAt + * @param key name of the property + * @return an object */ - @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { - return updatedAt; + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); } @Override @@ -173,16 +219,18 @@ public boolean equals(Object o) { } Route route = (Route) o; return Objects.equals(this.createdAt, route.createdAt) + && Objects.equals(this.destination, route.destination) + && Objects.equals(this.id, route.id) && Objects.equals(this.labels, route.labels) && Objects.equals(this.nexthop, route.nexthop) - && Objects.equals(this.prefix, route.prefix) - && Objects.equals(this.routeId, route.routeId) - && Objects.equals(this.updatedAt, route.updatedAt); + && Objects.equals(this.updatedAt, route.updatedAt) + && Objects.equals(this.additionalProperties, route.additionalProperties); } @Override public int hashCode() { - return Objects.hash(createdAt, labels, nexthop, prefix, routeId, updatedAt); + return Objects.hash( + createdAt, destination, id, labels, nexthop, updatedAt, additionalProperties); } @Override @@ -190,11 +238,14 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Route {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" destination: ").append(toIndentedString(destination)).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(" prefix: ").append(toIndentedString(prefix)).append("\n"); - sb.append(" routeId: ").append(toIndentedString(routeId)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -219,14 +270,14 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "createdAt", + "destination", + "id", "labels", "nexthop", - "prefix", - "routeId", "updatedAt")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("nexthop", "prefix")); + openapiRequiredFields = new HashSet(Arrays.asList("destination", "nexthop")); } /** @@ -241,51 +292,36 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Route is not found in the empty JSON string", Route.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Route.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Route` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Route.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("nexthop").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `nexthop` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("nexthop").toString())); - } - if (!jsonObj.get("prefix").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("prefix").toString())); - } - if ((jsonObj.get("routeId") != null && !jsonObj.get("routeId").isJsonNull()) - && !jsonObj.get("routeId").isJsonPrimitive()) { + // validate the required field `destination` + RouteDestination.validateJsonElement(jsonObj.get("destination")); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `routeId` to be a primitive type in the JSON string but got `%s`", - jsonObj.get("routeId").toString())); + 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 { @@ -304,6 +340,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Route 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); } @@ -311,7 +371,41 @@ public void write(JsonWriter out, Route value) throws IOException { public Route read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Route 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteDestination.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteDestination.java new file mode 100644 index 00000000..ed2db251 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteDestination.java @@ -0,0 +1,290 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class RouteDestination extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(RouteDestination.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RouteDestination.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RouteDestination' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterDestinationCIDRv4 = + gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv4.class)); + final TypeAdapter adapterDestinationCIDRv6 = + gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv6.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RouteDestination value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `DestinationCIDRv4` + if (value.getActualInstance() instanceof DestinationCIDRv4) { + JsonElement element = + adapterDestinationCIDRv4.toJsonTree( + (DestinationCIDRv4) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DestinationCIDRv6` + if (value.getActualInstance() instanceof DestinationCIDRv6) { + JsonElement element = + adapterDestinationCIDRv6.toJsonTree( + (DestinationCIDRv6) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas: DestinationCIDRv4, DestinationCIDRv6"); + } + + @Override + public RouteDestination read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize DestinationCIDRv4 + try { + // validate the JSON object to see if any exception is thrown + DestinationCIDRv4.validateJsonElement(jsonElement); + actualAdapter = adapterDestinationCIDRv4; + match++; + log.log( + Level.FINER, + "Input data matches schema 'DestinationCIDRv4'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for DestinationCIDRv4 failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'DestinationCIDRv4'", + e); + } + // deserialize DestinationCIDRv6 + try { + // validate the JSON object to see if any exception is thrown + DestinationCIDRv6.validateJsonElement(jsonElement); + actualAdapter = adapterDestinationCIDRv6; + match++; + log.log( + Level.FINER, + "Input data matches schema 'DestinationCIDRv6'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for DestinationCIDRv6 failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'DestinationCIDRv6'", + e); + } + + if (match == 1) { + RouteDestination ret = new RouteDestination(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + java.util.Locale.ROOT, + "Failed deserialization for RouteDestination: %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 RouteDestination() { + super("oneOf", Boolean.FALSE); + } + + public RouteDestination(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("DestinationCIDRv4", DestinationCIDRv4.class); + schemas.put("DestinationCIDRv6", DestinationCIDRv6.class); + } + + @Override + public Map> getSchemas() { + return RouteDestination.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: DestinationCIDRv4, DestinationCIDRv6 + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof DestinationCIDRv4) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DestinationCIDRv6) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be DestinationCIDRv4, DestinationCIDRv6"); + } + + /** + * Get the actual instance, which can be the following: DestinationCIDRv4, DestinationCIDRv6 + * + * @return The actual instance (DestinationCIDRv4, DestinationCIDRv6) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `DestinationCIDRv4`. If the actual instance is not + * `DestinationCIDRv4`, the ClassCastException will be thrown. + * + * @return The actual instance of `DestinationCIDRv4` + * @throws ClassCastException if the instance is not `DestinationCIDRv4` + */ + public DestinationCIDRv4 getDestinationCIDRv4() throws ClassCastException { + return (DestinationCIDRv4) super.getActualInstance(); + } + + /** + * Get the actual instance of `DestinationCIDRv6`. If the actual instance is not + * `DestinationCIDRv6`, the ClassCastException will be thrown. + * + * @return The actual instance of `DestinationCIDRv6` + * @throws ClassCastException if the instance is not `DestinationCIDRv6` + */ + public DestinationCIDRv6 getDestinationCIDRv6() throws ClassCastException { + return (DestinationCIDRv6) 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 RouteDestination + */ + 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 DestinationCIDRv4 + try { + DestinationCIDRv4.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for DestinationCIDRv4 failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with DestinationCIDRv6 + try { + DestinationCIDRv6.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for DestinationCIDRv6 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 RouteDestination with oneOf schemas: DestinationCIDRv4, DestinationCIDRv6. %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 RouteDestination given an JSON string + * + * @param jsonString JSON string + * @return An instance of RouteDestination + * @throws IOException if the JSON string is invalid with respect to RouteDestination + */ + public static RouteDestination fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RouteDestination.class); + } + + /** + * Convert an instance of RouteDestination 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/model/RouteListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteListResponse.java index f0264ad1..492a400e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Route list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class RouteListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 RouteListResponse instance itself + */ + public RouteListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } RouteListResponse routeListResponse = (RouteListResponse) o; - return Objects.equals(this.items, routeListResponse.items); + return Objects.equals(this.items, routeListResponse.items) + && Objects.equals( + this.additionalProperties, routeListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RouteListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in RouteListResponse is not found in the empty JSON string", RouteListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RouteListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `RouteListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : RouteListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -191,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, RouteListResponse 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); } @@ -198,7 +264,41 @@ public void write(JsonWriter out, RouteListResponse value) public RouteListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RouteListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteNexthop.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteNexthop.java new file mode 100644 index 00000000..e0dfdac4 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteNexthop.java @@ -0,0 +1,404 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class RouteNexthop extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(RouteNexthop.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RouteNexthop.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RouteNexthop' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterNexthopIPv4 = + gson.getDelegateAdapter(this, TypeToken.get(NexthopIPv4.class)); + final TypeAdapter adapterNexthopIPv6 = + gson.getDelegateAdapter(this, TypeToken.get(NexthopIPv6.class)); + final TypeAdapter adapterNexthopInternet = + gson.getDelegateAdapter(this, TypeToken.get(NexthopInternet.class)); + final TypeAdapter adapterNexthopBlackhole = + gson.getDelegateAdapter(this, TypeToken.get(NexthopBlackhole.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RouteNexthop value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `NexthopIPv4` + if (value.getActualInstance() instanceof NexthopIPv4) { + JsonElement element = + adapterNexthopIPv4.toJsonTree( + (NexthopIPv4) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `NexthopIPv6` + if (value.getActualInstance() instanceof NexthopIPv6) { + JsonElement element = + adapterNexthopIPv6.toJsonTree( + (NexthopIPv6) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `NexthopInternet` + if (value.getActualInstance() instanceof NexthopInternet) { + JsonElement element = + adapterNexthopInternet.toJsonTree( + (NexthopInternet) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `NexthopBlackhole` + if (value.getActualInstance() instanceof NexthopBlackhole) { + JsonElement element = + adapterNexthopBlackhole.toJsonTree( + (NexthopBlackhole) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet"); + } + + @Override + public RouteNexthop read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize NexthopIPv4 + try { + // validate the JSON object to see if any exception is thrown + NexthopIPv4.validateJsonElement(jsonElement); + actualAdapter = adapterNexthopIPv4; + match++; + log.log(Level.FINER, "Input data matches schema 'NexthopIPv4'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for NexthopIPv4 failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'NexthopIPv4'", + e); + } + // deserialize NexthopIPv6 + try { + // validate the JSON object to see if any exception is thrown + NexthopIPv6.validateJsonElement(jsonElement); + actualAdapter = adapterNexthopIPv6; + match++; + log.log(Level.FINER, "Input data matches schema 'NexthopIPv6'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for NexthopIPv6 failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'NexthopIPv6'", + e); + } + // deserialize NexthopInternet + try { + // validate the JSON object to see if any exception is thrown + NexthopInternet.validateJsonElement(jsonElement); + actualAdapter = adapterNexthopInternet; + match++; + log.log(Level.FINER, "Input data matches schema 'NexthopInternet'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for NexthopInternet failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'NexthopInternet'", + e); + } + // deserialize NexthopBlackhole + try { + // validate the JSON object to see if any exception is thrown + NexthopBlackhole.validateJsonElement(jsonElement); + actualAdapter = adapterNexthopBlackhole; + match++; + log.log( + Level.FINER, + "Input data matches schema 'NexthopBlackhole'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for NexthopBlackhole failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'NexthopBlackhole'", + e); + } + + if (match == 1) { + RouteNexthop ret = new RouteNexthop(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + java.util.Locale.ROOT, + "Failed deserialization for RouteNexthop: %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 RouteNexthop() { + super("oneOf", Boolean.FALSE); + } + + public RouteNexthop(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("NexthopIPv4", NexthopIPv4.class); + schemas.put("NexthopIPv6", NexthopIPv6.class); + schemas.put("NexthopInternet", NexthopInternet.class); + schemas.put("NexthopBlackhole", NexthopBlackhole.class); + } + + @Override + public Map> getSchemas() { + return RouteNexthop.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof NexthopIPv4) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof NexthopIPv6) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof NexthopInternet) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof NexthopBlackhole) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet"); + } + + /** + * Get the actual instance, which can be the following: NexthopBlackhole, NexthopIPv4, + * NexthopIPv6, NexthopInternet + * + * @return The actual instance (NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `NexthopIPv4`. If the actual instance is not `NexthopIPv4`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `NexthopIPv4` + * @throws ClassCastException if the instance is not `NexthopIPv4` + */ + public NexthopIPv4 getNexthopIPv4() throws ClassCastException { + return (NexthopIPv4) super.getActualInstance(); + } + + /** + * Get the actual instance of `NexthopIPv6`. If the actual instance is not `NexthopIPv6`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `NexthopIPv6` + * @throws ClassCastException if the instance is not `NexthopIPv6` + */ + public NexthopIPv6 getNexthopIPv6() throws ClassCastException { + return (NexthopIPv6) super.getActualInstance(); + } + + /** + * Get the actual instance of `NexthopInternet`. If the actual instance is not + * `NexthopInternet`, the ClassCastException will be thrown. + * + * @return The actual instance of `NexthopInternet` + * @throws ClassCastException if the instance is not `NexthopInternet` + */ + public NexthopInternet getNexthopInternet() throws ClassCastException { + return (NexthopInternet) super.getActualInstance(); + } + + /** + * Get the actual instance of `NexthopBlackhole`. If the actual instance is not + * `NexthopBlackhole`, the ClassCastException will be thrown. + * + * @return The actual instance of `NexthopBlackhole` + * @throws ClassCastException if the instance is not `NexthopBlackhole` + */ + public NexthopBlackhole getNexthopBlackhole() throws ClassCastException { + return (NexthopBlackhole) 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 RouteNexthop + */ + 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 NexthopIPv4 + try { + NexthopIPv4.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for NexthopIPv4 failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with NexthopIPv6 + try { + NexthopIPv6.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for NexthopIPv6 failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with NexthopInternet + try { + NexthopInternet.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for NexthopInternet failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with NexthopBlackhole + try { + NexthopBlackhole.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for NexthopBlackhole 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 RouteNexthop with oneOf schemas: NexthopBlackhole, NexthopIPv4, NexthopIPv6, NexthopInternet. %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 RouteNexthop given an JSON string + * + * @param jsonString JSON string + * @return An instance of RouteNexthop + * @throws IOException if the JSON string is invalid with respect to RouteNexthop + */ + public static RouteNexthop fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RouteNexthop.class); + } + + /** + * Convert an instance of RouteNexthop 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/model/RoutingTable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RoutingTable.java new file mode 100644 index 00000000..98144abc --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RoutingTable.java @@ -0,0 +1,525 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; + +/** An object representing a routing table. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class RoutingTable { + 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_DEFAULT = "default"; + + @SerializedName(SERIALIZED_NAME_DEFAULT) + @javax.annotation.Nullable private Boolean _default = true; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + + public static final String SERIALIZED_NAME_DYNAMIC_ROUTES = "dynamicRoutes"; + + @SerializedName(SERIALIZED_NAME_DYNAMIC_ROUTES) + @javax.annotation.Nullable private Boolean dynamicRoutes = true; + + 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_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_SYSTEM_ROUTES = "systemRoutes"; + + @SerializedName(SERIALIZED_NAME_SYSTEM_ROUTES) + @javax.annotation.Nullable private Boolean systemRoutes = true; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public RoutingTable() {} + + public RoutingTable( + OffsetDateTime createdAt, Boolean _default, UUID id, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this._default = _default; + this.id = id; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * This is the default routing table. It can't be deleted and is used if the user does not + * specify it otherwise. + * + * @return _default + */ + @javax.annotation.Nullable public Boolean getDefault() { + return _default; + } + + public RoutingTable 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 RoutingTable dynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { + this.dynamicRoutes = dynamicRoutes; + return this; + } + + /** + * A config setting for a routing table which allows propagation of dynamic routes to this + * routing table. + * + * @return dynamicRoutes + */ + @javax.annotation.Nullable public Boolean getDynamicRoutes() { + return dynamicRoutes; + } + + public void setDynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { + this.dynamicRoutes = dynamicRoutes; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public RoutingTable labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * 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. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public RoutingTable 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; + } + + public RoutingTable systemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { + this.systemRoutes = systemRoutes; + return this; + } + + /** + * A config setting for a routing table which allows installation of automatic system routes for + * connectivity between projects in the same SNA. + * + * @return systemRoutes + */ + @javax.annotation.Nullable public Boolean getSystemRoutes() { + return systemRoutes; + } + + public void setSystemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { + this.systemRoutes = systemRoutes; + } + + /** + * 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 RoutingTable instance itself + */ + public RoutingTable 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; + } + RoutingTable routingTable = (RoutingTable) o; + return Objects.equals(this.createdAt, routingTable.createdAt) + && Objects.equals(this._default, routingTable._default) + && Objects.equals(this.description, routingTable.description) + && Objects.equals(this.dynamicRoutes, routingTable.dynamicRoutes) + && Objects.equals(this.id, routingTable.id) + && Objects.equals(this.labels, routingTable.labels) + && Objects.equals(this.name, routingTable.name) + && Objects.equals(this.systemRoutes, routingTable.systemRoutes) + && Objects.equals(this.updatedAt, routingTable.updatedAt) + && Objects.equals(this.additionalProperties, routingTable.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + _default, + description, + dynamicRoutes, + id, + labels, + name, + systemRoutes, + updatedAt, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RoutingTable {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" _default: ").append(toIndentedString(_default)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" dynamicRoutes: ").append(toIndentedString(dynamicRoutes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" systemRoutes: ").append(toIndentedString(systemRoutes)).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", + "default", + "description", + "dynamicRoutes", + "id", + "labels", + "name", + "systemRoutes", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("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 RoutingTable + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RoutingTable.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 RoutingTable is not found in the empty JSON string", + RoutingTable.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RoutingTable.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())); + } + 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RoutingTable.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RoutingTable' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RoutingTable.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RoutingTable 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 RoutingTable read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RoutingTable 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 RoutingTable given an JSON string + * + * @param jsonString JSON string + * @return An instance of RoutingTable + * @throws IOException if the JSON string is invalid with respect to RoutingTable + */ + public static RoutingTable fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RoutingTable.class); + } + + /** + * Convert an instance of RoutingTable 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/model/RoutingTableListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RoutingTableListResponse.java new file mode 100644 index 00000000..b14175f1 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RoutingTableListResponse.java @@ -0,0 +1,327 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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; + +/** Routing table response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class RoutingTableListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public RoutingTableListResponse() {} + + public RoutingTableListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public RoutingTableListResponse addItemsItem(RoutingTable itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of routing tables. + * + * @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 RoutingTableListResponse instance itself + */ + public RoutingTableListResponse 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; + } + RoutingTableListResponse routingTableListResponse = (RoutingTableListResponse) o; + return Objects.equals(this.items, routingTableListResponse.items) + && Objects.equals( + this.additionalProperties, routingTableListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(items, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RoutingTableListResponse {\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 RoutingTableListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RoutingTableListResponse.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 RoutingTableListResponse is not found in the empty JSON string", + RoutingTableListResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RoutingTableListResponse.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++) { + RoutingTable.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RoutingTableListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RoutingTableListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RoutingTableListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RoutingTableListResponse 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 RoutingTableListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RoutingTableListResponse 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 RoutingTableListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RoutingTableListResponse + * @throws IOException if the JSON string is invalid with respect to RoutingTableListResponse + */ + public static RoutingTableListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RoutingTableListResponse.class); + } + + /** + * Convert an instance of RoutingTableListResponse 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/model/SecurityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroup.java index 958ca939..38fe847c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroup.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,17 +26,17 @@ 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.Set; import java.util.UUID; /** Object that represents a security group. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class SecurityGroup { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -138,7 +138,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -206,6 +207,50 @@ public void setStateful(@javax.annotation.Nullable Boolean stateful) { 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 SecurityGroup instance itself + */ + public SecurityGroup 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) { @@ -222,12 +267,22 @@ public boolean equals(Object o) { && Objects.equals(this.name, securityGroup.name) && Objects.equals(this.rules, securityGroup.rules) && Objects.equals(this.stateful, securityGroup.stateful) - && Objects.equals(this.updatedAt, securityGroup.updatedAt); + && Objects.equals(this.updatedAt, securityGroup.updatedAt) + && Objects.equals(this.additionalProperties, securityGroup.additionalProperties); } @Override public int hashCode() { - return Objects.hash(createdAt, description, id, labels, name, rules, stateful, updatedAt); + return Objects.hash( + createdAt, + description, + id, + labels, + name, + rules, + stateful, + updatedAt, + additionalProperties); } @Override @@ -242,6 +297,9 @@ public String toString() { sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); sb.append(" stateful: ").append(toIndentedString(stateful)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -290,29 +348,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in SecurityGroup is not found in the empty JSON string", SecurityGroup.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SecurityGroup.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `SecurityGroup` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SecurityGroup.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -320,6 +370,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -327,12 +378,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -343,6 +396,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("rules").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `rules` to be an array in the JSON string but got `%s`", jsonObj.get("rules").toString())); } @@ -372,6 +426,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, SecurityGroup 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); } @@ -379,7 +457,41 @@ public void write(JsonWriter out, SecurityGroup value) throws IOException { public SecurityGroup read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecurityGroup 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupListResponse.java index 1092c538..7ef5d9c3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Security group list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class SecurityGroupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 SecurityGroupListResponse instance itself + */ + public SecurityGroupListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } SecurityGroupListResponse securityGroupListResponse = (SecurityGroupListResponse) o; - return Objects.equals(this.items, securityGroupListResponse.items); + return Objects.equals(this.items, securityGroupListResponse.items) + && Objects.equals( + this.additionalProperties, securityGroupListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SecurityGroupListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in SecurityGroupListResponse is not found in the empty JSON string", SecurityGroupListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SecurityGroupListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `SecurityGroupListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SecurityGroupListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -192,6 +234,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, SecurityGroupListResponse 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); } @@ -199,7 +265,41 @@ public void write(JsonWriter out, SecurityGroupListResponse value) public SecurityGroupListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecurityGroupListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRule.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRule.java index 562f0dc3..c29b6920 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRule.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRule.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,16 +25,17 @@ 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.Set; import java.util.UUID; /** Object that represents a security group rule. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class SecurityGroupRule { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -293,6 +294,50 @@ public void setProtocol(@javax.annotation.Nullable Protocol protocol) { this.protocol = protocol; } + /** + * 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 SecurityGroupRule instance itself + */ + public SecurityGroupRule 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) { @@ -314,7 +359,9 @@ public boolean equals(Object o) { this.remoteSecurityGroupId, securityGroupRule.remoteSecurityGroupId) && Objects.equals(this.securityGroupId, securityGroupRule.securityGroupId) && Objects.equals(this.updatedAt, securityGroupRule.updatedAt) - && Objects.equals(this.protocol, securityGroupRule.protocol); + && Objects.equals(this.protocol, securityGroupRule.protocol) + && Objects.equals( + this.additionalProperties, securityGroupRule.additionalProperties); } @Override @@ -331,7 +378,8 @@ public int hashCode() { remoteSecurityGroupId, securityGroupId, updatedAt, - protocol); + protocol, + additionalProperties); } @Override @@ -352,6 +400,9 @@ public String toString() { sb.append(" securityGroupId: ").append(toIndentedString(securityGroupId)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -404,29 +455,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in SecurityGroupRule is not found in the empty JSON string", SecurityGroupRule.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SecurityGroupRule.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `SecurityGroupRule` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SecurityGroupRule.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -434,12 +477,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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("direction").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `direction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("direction").toString())); } @@ -447,6 +492,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -458,6 +504,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -465,6 +512,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ipRange").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ipRange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipRange").toString())); } @@ -477,6 +525,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("remoteSecurityGroupId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `remoteSecurityGroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteSecurityGroupId").toString())); } @@ -484,6 +533,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("securityGroupId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `securityGroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("securityGroupId").toString())); } @@ -510,6 +560,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, SecurityGroupRule 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); } @@ -517,7 +591,41 @@ public void write(JsonWriter out, SecurityGroupRule value) public SecurityGroupRule read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecurityGroupRule 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleListResponse.java index 301149f2..a7f63f94 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Security group rule list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class SecurityGroupRuleListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -73,6 +73,50 @@ 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 SecurityGroupRuleListResponse instance itself + */ + public SecurityGroupRuleListResponse 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) { @@ -83,12 +127,15 @@ public boolean equals(Object o) { } SecurityGroupRuleListResponse securityGroupRuleListResponse = (SecurityGroupRuleListResponse) o; - return Objects.equals(this.items, securityGroupRuleListResponse.items); + return Objects.equals(this.items, securityGroupRuleListResponse.items) + && Objects.equals( + this.additionalProperties, + securityGroupRuleListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -96,6 +143,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SecurityGroupRuleListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -135,29 +185,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in SecurityGroupRuleListResponse is not found in the empty JSON string", SecurityGroupRuleListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SecurityGroupRuleListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `SecurityGroupRuleListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SecurityGroupRuleListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -165,6 +207,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -196,6 +239,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, SecurityGroupRuleListResponse 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); } @@ -204,7 +271,42 @@ public SecurityGroupRuleListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecurityGroupRuleListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleProtocol.java index 78a3d5b5..c20011ed 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleProtocol.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** The internet protocol which the rule matches. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class SecurityGroupRuleProtocol { public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; @@ -59,6 +60,50 @@ public void setProtocol(@javax.annotation.Nullable Protocol protocol) { this.protocol = protocol; } + /** + * 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 SecurityGroupRuleProtocol instance itself + */ + public SecurityGroupRuleProtocol 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) { @@ -68,12 +113,14 @@ public boolean equals(Object o) { return false; } SecurityGroupRuleProtocol securityGroupRuleProtocol = (SecurityGroupRuleProtocol) o; - return Objects.equals(this.protocol, securityGroupRuleProtocol.protocol); + return Objects.equals(this.protocol, securityGroupRuleProtocol.protocol) + && Objects.equals( + this.additionalProperties, securityGroupRuleProtocol.additionalProperties); } @Override public int hashCode() { - return Objects.hash(protocol); + return Objects.hash(protocol, additionalProperties); } @Override @@ -81,6 +128,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SecurityGroupRuleProtocol {\n"); sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -119,21 +169,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in SecurityGroupRuleProtocol is not found in the empty JSON string", SecurityGroupRuleProtocol.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SecurityGroupRuleProtocol.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `SecurityGroupRuleProtocol` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `protocol` if (jsonObj.get("protocol") != null && !jsonObj.get("protocol").isJsonNull()) { @@ -159,6 +199,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, SecurityGroupRuleProtocol 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); } @@ -166,7 +230,41 @@ public void write(JsonWriter out, SecurityGroupRuleProtocol value) public SecurityGroupRuleProtocol read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecurityGroupRuleProtocol 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Server.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Server.java index dec5cf90..201ea599 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Server.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Server.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,17 +27,17 @@ 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.Set; import java.util.UUID; /** Representation of a single server object. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Server { public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; @@ -119,7 +119,7 @@ public class Server { public static final String SERIALIZED_NAME_NETWORKING = "networking"; @SerializedName(SERIALIZED_NAME_NETWORKING) - @javax.annotation.Nullable private CreateServerPayloadNetworking networking; + @javax.annotation.Nullable private ServerNetworking networking; public static final String SERIALIZED_NAME_NICS = "nics"; @@ -332,7 +332,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -420,7 +421,7 @@ public void setName(@javax.annotation.Nonnull String name) { this.name = name; } - public Server networking(@javax.annotation.Nullable CreateServerPayloadNetworking networking) { + public Server networking(@javax.annotation.Nullable ServerNetworking networking) { this.networking = networking; return this; } @@ -430,11 +431,11 @@ public Server networking(@javax.annotation.Nullable CreateServerPayloadNetworkin * * @return networking */ - @javax.annotation.Nullable public CreateServerPayloadNetworking getNetworking() { + @javax.annotation.Nullable public ServerNetworking getNetworking() { return networking; } - public void setNetworking(@javax.annotation.Nullable CreateServerPayloadNetworking networking) { + public void setNetworking(@javax.annotation.Nullable ServerNetworking networking) { this.networking = networking; } @@ -580,6 +581,50 @@ public void setVolumes(@javax.annotation.Nullable List volumes) { this.volumes = volumes; } + /** + * 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 Server instance itself + */ + public Server 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) { @@ -612,7 +657,8 @@ public boolean equals(Object o) { && Objects.equals(this.status, server.status) && Objects.equals(this.updatedAt, server.updatedAt) && Arrays.equals(this.userData, server.userData) - && Objects.equals(this.volumes, server.volumes); + && Objects.equals(this.volumes, server.volumes) + && Objects.equals(this.additionalProperties, server.additionalProperties); } @Override @@ -641,7 +687,8 @@ public int hashCode() { status, updatedAt, Arrays.hashCode(userData), - volumes); + volumes, + additionalProperties); } @Override @@ -676,6 +723,9 @@ public String toString() { sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); sb.append(" volumes: ").append(toIndentedString(volumes)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -740,29 +790,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Server is not found in the empty JSON string", Server.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Server.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Server` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Server.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -770,6 +812,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("affinityGroup").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `affinityGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("affinityGroup").toString())); } @@ -782,6 +825,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("availabilityZone").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `availabilityZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("availabilityZone").toString())); } @@ -793,6 +837,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("errorMessage").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `errorMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorMessage").toString())); } @@ -800,6 +845,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -807,6 +853,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("imageId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `imageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imageId").toString())); } @@ -814,12 +861,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("keypairName").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `keypairName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keypairName").toString())); } if (!jsonObj.get("machineType").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `machineType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("machineType").toString())); } @@ -831,12 +880,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } // validate the optional field `networking` if (jsonObj.get("networking") != null && !jsonObj.get("networking").isJsonNull()) { - CreateServerPayloadNetworking.validateJsonElement(jsonObj.get("networking")); + ServerNetworking.validateJsonElement(jsonObj.get("networking")); } if (jsonObj.get("nics") != null && !jsonObj.get("nics").isJsonNull()) { JsonArray jsonArraynics = jsonObj.getAsJsonArray("nics"); @@ -845,6 +895,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("nics").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `nics` to be an array in the JSON string but got `%s`", jsonObj.get("nics").toString())); } @@ -860,6 +911,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("powerStatus").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `powerStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("powerStatus").toString())); } @@ -869,6 +921,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("securityGroups").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", jsonObj.get("securityGroups").toString())); } @@ -878,6 +931,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("serviceAccountMails").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `serviceAccountMails` to be an array in the JSON string but got `%s`", jsonObj.get("serviceAccountMails").toString())); } @@ -885,6 +939,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -894,6 +949,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("volumes").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `volumes` to be an array in the JSON string but got `%s`", jsonObj.get("volumes").toString())); } @@ -915,6 +971,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Server 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); } @@ -922,7 +1002,41 @@ public void write(JsonWriter out, Server value) throws IOException { public Server read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Server 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerAgent.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerAgent.java index 37d77c66..e735ba1e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerAgent.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerAgent.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** STACKIT server agent options for a server. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ServerAgent { public static final String SERIALIZED_NAME_PROVISIONED = "provisioned"; @@ -62,6 +63,50 @@ public void setProvisioned(@javax.annotation.Nullable Boolean provisioned) { this.provisioned = provisioned; } + /** + * 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 ServerAgent instance itself + */ + public ServerAgent 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) { @@ -71,12 +116,13 @@ public boolean equals(Object o) { return false; } ServerAgent serverAgent = (ServerAgent) o; - return Objects.equals(this.provisioned, serverAgent.provisioned); + return Objects.equals(this.provisioned, serverAgent.provisioned) + && Objects.equals(this.additionalProperties, serverAgent.additionalProperties); } @Override public int hashCode() { - return Objects.hash(provisioned); + return Objects.hash(provisioned, additionalProperties); } @Override @@ -84,6 +130,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ServerAgent {\n"); sb.append(" provisioned: ").append(toIndentedString(provisioned)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -122,21 +171,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ServerAgent is not found in the empty JSON string", ServerAgent.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ServerAgent.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ServerAgent` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } @@ -156,6 +195,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ServerAgent 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); } @@ -163,7 +226,41 @@ public void write(JsonWriter out, ServerAgent value) throws IOException { public ServerAgent read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ServerAgent 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerConsoleUrl.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerConsoleUrl.java index fcbc4735..8fd73242 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerConsoleUrl.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerConsoleUrl.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents a server console URL. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ServerConsoleUrl { public static final String SERIALIZED_NAME_URL = "url"; @@ -61,6 +62,50 @@ public void setUrl(@javax.annotation.Nonnull String url) { this.url = url; } + /** + * 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 ServerConsoleUrl instance itself + */ + public ServerConsoleUrl 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) { @@ -70,12 +115,13 @@ public boolean equals(Object o) { return false; } ServerConsoleUrl serverConsoleUrl = (ServerConsoleUrl) o; - return Objects.equals(this.url, serverConsoleUrl.url); + return Objects.equals(this.url, serverConsoleUrl.url) + && Objects.equals(this.additionalProperties, serverConsoleUrl.additionalProperties); } @Override public int hashCode() { - return Objects.hash(url); + return Objects.hash(url, additionalProperties); } @Override @@ -83,6 +129,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ServerConsoleUrl {\n"); sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -121,35 +170,28 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ServerConsoleUrl is not found in the empty JSON string", ServerConsoleUrl.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ServerConsoleUrl.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ServerConsoleUrl` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ServerConsoleUrl.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("url").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } @@ -172,6 +214,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, ServerConsoleUrl 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); } @@ -179,7 +245,41 @@ public void write(JsonWriter out, ServerConsoleUrl value) public ServerConsoleUrl read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ServerConsoleUrl 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerListResponse.java index 3c59aaa6..bd0f3994 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Response object for server list request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ServerListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 ServerListResponse instance itself + */ + public ServerListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } ServerListResponse serverListResponse = (ServerListResponse) o; - return Objects.equals(this.items, serverListResponse.items); + return Objects.equals(this.items, serverListResponse.items) + && Objects.equals( + this.additionalProperties, serverListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ServerListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ServerListResponse is not found in the empty JSON string", ServerListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ServerListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ServerListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ServerListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -191,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, ServerListResponse 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); } @@ -198,7 +264,41 @@ public void write(JsonWriter out, ServerListResponse value) public ServerListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ServerListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerMaintenance.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerMaintenance.java index c1136e62..45f030d6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerMaintenance.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerMaintenance.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,15 +25,16 @@ 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.Set; /** Object that represents the information about the next planned server maintenance window. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ServerMaintenance { public static final String SERIALIZED_NAME_DETAILS = "details"; @@ -135,6 +136,50 @@ public void setStatus(@javax.annotation.Nonnull String status) { this.status = status; } + /** + * 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 ServerMaintenance instance itself + */ + public ServerMaintenance 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) { @@ -147,12 +192,14 @@ public boolean equals(Object o) { return Objects.equals(this.details, serverMaintenance.details) && Objects.equals(this.endsAt, serverMaintenance.endsAt) && Objects.equals(this.startsAt, serverMaintenance.startsAt) - && Objects.equals(this.status, serverMaintenance.status); + && Objects.equals(this.status, serverMaintenance.status) + && Objects.equals( + this.additionalProperties, serverMaintenance.additionalProperties); } @Override public int hashCode() { - return Objects.hash(details, endsAt, startsAt, status); + return Objects.hash(details, endsAt, startsAt, status, additionalProperties); } @Override @@ -163,6 +210,9 @@ public String toString() { sb.append(" endsAt: ").append(toIndentedString(endsAt)).append("\n"); sb.append(" startsAt: ").append(toIndentedString(startsAt)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -202,29 +252,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ServerMaintenance is not found in the empty JSON string", ServerMaintenance.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ServerMaintenance.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ServerMaintenance` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ServerMaintenance.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -232,12 +274,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("details").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("details").toString())); } if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -260,6 +304,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, ServerMaintenance 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); } @@ -267,7 +335,41 @@ public void write(JsonWriter out, ServerMaintenance value) public ServerMaintenance read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ServerMaintenance 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerNetwork.java index 0a869ee5..37c0c63c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerNetwork.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerNetwork.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,17 +26,17 @@ 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; -import java.util.Set; import java.util.UUID; /** Describes the object that matches servers to its networks. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ServerNetwork { public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; @@ -298,6 +298,50 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou this.securityGroups = securityGroups; } + /** + * 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 ServerNetwork instance itself + */ + public ServerNetwork 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) { @@ -316,7 +360,8 @@ public boolean equals(Object o) { && Objects.equals(this.nicId, serverNetwork.nicId) && Objects.equals(this.nicSecurity, serverNetwork.nicSecurity) && Objects.equals(this.publicIp, serverNetwork.publicIp) - && Objects.equals(this.securityGroups, serverNetwork.securityGroups); + && Objects.equals(this.securityGroups, serverNetwork.securityGroups) + && Objects.equals(this.additionalProperties, serverNetwork.additionalProperties); } @Override @@ -331,7 +376,8 @@ public int hashCode() { nicId, nicSecurity, publicIp, - securityGroups); + securityGroups, + additionalProperties); } @Override @@ -348,6 +394,9 @@ public String toString() { sb.append(" nicSecurity: ").append(toIndentedString(nicSecurity)).append("\n"); sb.append(" publicIp: ").append(toIndentedString(publicIp)).append("\n"); sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -400,29 +449,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ServerNetwork is not found in the empty JSON string", ServerNetwork.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ServerNetwork.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ServerNetwork` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ServerNetwork.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -434,6 +475,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("allowedAddresses").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `allowedAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedAddresses").toString())); } @@ -449,6 +491,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ipv4").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ipv4` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipv4").toString())); } @@ -456,30 +499,35 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ipv6").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ipv6` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipv6").toString())); } if (!jsonObj.get("mac").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `mac` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mac").toString())); } if (!jsonObj.get("networkId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `networkId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkId").toString())); } if (!jsonObj.get("networkName").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `networkName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkName").toString())); } if (!jsonObj.get("nicId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `nicId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nicId").toString())); } @@ -487,6 +535,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("publicIp").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `publicIp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicIp").toString())); } @@ -496,6 +545,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("securityGroups").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", jsonObj.get("securityGroups").toString())); } @@ -517,6 +567,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, ServerNetwork 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); } @@ -524,7 +598,41 @@ public void write(JsonWriter out, ServerNetwork value) throws IOException { public ServerNetwork read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ServerNetwork 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayloadNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerNetworking.java similarity index 81% rename from services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayloadNetworking.java rename to services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerNetworking.java index cb560e2c..9a40c5b8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayloadNetworking.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerNetworking.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,18 +29,16 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class CreateServerPayloadNetworking extends AbstractOpenApiSchema { - private static final Logger log = - Logger.getLogger(CreateServerPayloadNetworking.class.getName()); + comments = "Generator version: 7.19.0") +public class ServerNetworking extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ServerNetworking.class.getName()); public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateServerPayloadNetworking.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateServerPayloadNetworking' and its - // subtypes + if (!ServerNetworking.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServerNetworking' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterCreateServerNetworking = @@ -51,9 +49,9 @@ public TypeAdapter create(Gson gson, TypeToken type) { this, TypeToken.get(CreateServerNetworkingWithNics.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, CreateServerPayloadNetworking value) + public void write(JsonWriter out, ServerNetworking value) throws IOException { if (value == null || value.getActualInstance() == null) { elementAdapter.write(out, null); @@ -84,8 +82,7 @@ public void write(JsonWriter out, CreateServerPayloadNetworking value) } @Override - public CreateServerPayloadNetworking read(JsonReader in) - throws IOException { + public ServerNetworking read(JsonReader in) throws IOException { Object deserialized = null; JsonElement jsonElement = elementAdapter.read(in); @@ -106,6 +103,7 @@ public CreateServerPayloadNetworking read(JsonReader in) // deserialization failed, continue errorMessages.add( String.format( + java.util.Locale.ROOT, "Deserialization for CreateServerNetworking failed with `%s`.", e.getMessage())); log.log( @@ -126,6 +124,7 @@ public CreateServerPayloadNetworking read(JsonReader in) // deserialization failed, continue errorMessages.add( String.format( + java.util.Locale.ROOT, "Deserialization for CreateServerNetworkingWithNics failed with `%s`.", e.getMessage())); log.log( @@ -135,16 +134,18 @@ public CreateServerPayloadNetworking read(JsonReader in) } if (match == 1) { - CreateServerPayloadNetworking ret = - new CreateServerPayloadNetworking(); + ServerNetworking ret = new ServerNetworking(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; } throw new IOException( String.format( - "Failed deserialization for CreateServerPayloadNetworking: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - match, errorMessages, jsonElement.toString())); + java.util.Locale.ROOT, + "Failed deserialization for ServerNetworking: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", + match, + errorMessages, + jsonElement.toString())); } }.nullSafe(); } @@ -153,11 +154,11 @@ public CreateServerPayloadNetworking read(JsonReader in) // store a list of schema names defined in oneOf public static final Map> schemas = new HashMap>(); - public CreateServerPayloadNetworking() { + public ServerNetworking() { super("oneOf", Boolean.FALSE); } - public CreateServerPayloadNetworking(Object o) { + public ServerNetworking(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } @@ -169,7 +170,7 @@ public CreateServerPayloadNetworking(Object o) { @Override public Map> getSchemas() { - return CreateServerPayloadNetworking.schemas; + return ServerNetworking.schemas; } /** @@ -233,8 +234,7 @@ public CreateServerNetworkingWithNics getCreateServerNetworkingWithNics() * 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 - * CreateServerPayloadNetworking + * @throws IOException if the JSON Element is invalid with respect to ServerNetworking */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { // validate oneOf schemas one by one @@ -247,6 +247,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } catch (Exception e) { errorMessages.add( String.format( + java.util.Locale.ROOT, "Deserialization for CreateServerNetworking failed with `%s`.", e.getMessage())); // continue to the next one @@ -258,6 +259,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } catch (Exception e) { errorMessages.add( String.format( + java.util.Locale.ROOT, "Deserialization for CreateServerNetworkingWithNics failed with `%s`.", e.getMessage())); // continue to the next one @@ -265,25 +267,27 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (validCount != 1) { throw new IOException( String.format( - "The JSON string is invalid for CreateServerPayloadNetworking with oneOf schemas: CreateServerNetworking, CreateServerNetworkingWithNics. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, errorMessages, jsonElement.toString())); + java.util.Locale.ROOT, + "The JSON string is invalid for ServerNetworking with oneOf schemas: CreateServerNetworking, CreateServerNetworkingWithNics. %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 CreateServerPayloadNetworking given an JSON string + * Create an instance of ServerNetworking given an JSON string * * @param jsonString JSON string - * @return An instance of CreateServerPayloadNetworking - * @throws IOException if the JSON string is invalid with respect to - * CreateServerPayloadNetworking + * @return An instance of ServerNetworking + * @throws IOException if the JSON string is invalid with respect to ServerNetworking */ - public static CreateServerPayloadNetworking fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateServerPayloadNetworking.class); + public static ServerNetworking fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServerNetworking.class); } /** - * Convert an instance of CreateServerPayloadNetworking to an JSON string + * Convert an instance of ServerNetworking to an JSON string * * @return JSON string */ diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServiceAccountMailListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServiceAccountMailListResponse.java index c5387b74..f2fa7f4b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServiceAccountMailListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServiceAccountMailListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,16 +25,16 @@ 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; -import java.util.Set; /** Service account mail list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class ServiceAccountMailListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -71,6 +71,50 @@ 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 ServiceAccountMailListResponse instance itself + */ + public ServiceAccountMailListResponse 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) { @@ -81,12 +125,15 @@ public boolean equals(Object o) { } ServiceAccountMailListResponse serviceAccountMailListResponse = (ServiceAccountMailListResponse) o; - return Objects.equals(this.items, serviceAccountMailListResponse.items); + return Objects.equals(this.items, serviceAccountMailListResponse.items) + && Objects.equals( + this.additionalProperties, + serviceAccountMailListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +141,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ServiceAccountMailListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -133,29 +183,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in ServiceAccountMailListResponse is not found in the empty JSON string", ServiceAccountMailListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ServiceAccountMailListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ServiceAccountMailListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ServiceAccountMailListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -166,6 +208,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } else 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())); } @@ -190,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, ServiceAccountMailListResponse 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); } @@ -198,7 +265,42 @@ public ServiceAccountMailListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ServiceAccountMailListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SetImageSharePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SetImageSharePayload.java index 3664a337..c3dd022d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SetImageSharePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SetImageSharePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,11 +25,11 @@ 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; -import java.util.Set; import java.util.UUID; /** @@ -37,7 +37,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class SetImageSharePayload { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -96,6 +96,50 @@ public void setProjects(@javax.annotation.Nullable List projects) { this.projects = projects; } + /** + * 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 SetImageSharePayload instance itself + */ + public SetImageSharePayload 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) { @@ -106,12 +150,14 @@ public boolean equals(Object o) { } SetImageSharePayload setImageSharePayload = (SetImageSharePayload) o; return Objects.equals(this.parentOrganization, setImageSharePayload.parentOrganization) - && Objects.equals(this.projects, setImageSharePayload.projects); + && Objects.equals(this.projects, setImageSharePayload.projects) + && Objects.equals( + this.additionalProperties, setImageSharePayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(parentOrganization, projects); + return Objects.hash(parentOrganization, projects, additionalProperties); } @Override @@ -122,6 +168,9 @@ public String toString() { .append(toIndentedString(parentOrganization)) .append("\n"); sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -160,21 +209,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in SetImageSharePayload is not found in the empty JSON string", SetImageSharePayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SetImageSharePayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `SetImageSharePayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the optional json data is an array if present if (jsonObj.get("projects") != null @@ -182,6 +221,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("projects").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `projects` to be an array in the JSON string but got `%s`", jsonObj.get("projects").toString())); } @@ -204,6 +244,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, SetImageSharePayload 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); } @@ -211,7 +275,41 @@ public void write(JsonWriter out, SetImageSharePayload value) public SetImageSharePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SetImageSharePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Snapshot.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Snapshot.java index ec58bc1b..c9d0a2e9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Snapshot.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Snapshot.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,22 +25,28 @@ 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.Set; import java.util.UUID; /** Object that represents a snapshot. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Snapshot { 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_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -98,6 +104,24 @@ public Snapshot( return createdAt; } + public Snapshot 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; + } + /** * Universally Unique Identifier (UUID). * @@ -116,7 +140,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -194,6 +219,50 @@ public void setVolumeId(@javax.annotation.Nonnull UUID volumeId) { this.volumeId = volumeId; } + /** + * 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 Snapshot instance itself + */ + public Snapshot 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) { @@ -204,18 +273,30 @@ public boolean equals(Object o) { } Snapshot snapshot = (Snapshot) o; return Objects.equals(this.createdAt, snapshot.createdAt) + && Objects.equals(this.description, snapshot.description) && Objects.equals(this.id, snapshot.id) && Objects.equals(this.labels, snapshot.labels) && Objects.equals(this.name, snapshot.name) && Objects.equals(this.size, snapshot.size) && Objects.equals(this.status, snapshot.status) && Objects.equals(this.updatedAt, snapshot.updatedAt) - && Objects.equals(this.volumeId, snapshot.volumeId); + && Objects.equals(this.volumeId, snapshot.volumeId) + && Objects.equals(this.additionalProperties, snapshot.additionalProperties); } @Override public int hashCode() { - return Objects.hash(createdAt, id, labels, name, size, status, updatedAt, volumeId); + return Objects.hash( + createdAt, + description, + id, + labels, + name, + size, + status, + updatedAt, + volumeId, + additionalProperties); } @Override @@ -223,6 +304,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Snapshot {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -230,6 +312,9 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" volumeId: ").append(toIndentedString(volumeId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -254,6 +339,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "createdAt", + "description", "id", "labels", "name", @@ -278,36 +364,37 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Snapshot is not found in the empty JSON string", Snapshot.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Snapshot.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Snapshot` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Snapshot.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())); + 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())); + } 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())); } @@ -315,6 +402,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -322,12 +410,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } if (!jsonObj.get("volumeId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeId").toString())); } @@ -349,6 +439,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Snapshot 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); } @@ -356,7 +470,41 @@ public void write(JsonWriter out, Snapshot value) throws IOException { public Snapshot read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Snapshot 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SnapshotListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SnapshotListResponse.java index de4ca5e3..014319ff 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SnapshotListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SnapshotListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Snapshot list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class SnapshotListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 SnapshotListResponse instance itself + */ + public SnapshotListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } SnapshotListResponse snapshotListResponse = (SnapshotListResponse) o; - return Objects.equals(this.items, snapshotListResponse.items); + return Objects.equals(this.items, snapshotListResponse.items) + && Objects.equals( + this.additionalProperties, snapshotListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SnapshotListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in SnapshotListResponse is not found in the empty JSON string", SnapshotListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SnapshotListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `SnapshotListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SnapshotListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -191,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, SnapshotListResponse 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); } @@ -198,7 +264,41 @@ public void write(JsonWriter out, SnapshotListResponse value) public SnapshotListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SnapshotListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/StaticAreaID.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/StaticAreaID.java index 484b8fc6..76fd7b81 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/StaticAreaID.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/StaticAreaID.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAreaAddressFamily.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAreaAddressFamily.java deleted file mode 100644 index 4dfc6d0b..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAreaAddressFamily.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * IaaS-API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 1 - * 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.model; - -import cloud.stackit.sdk.iaas.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.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The addressFamily object for a area update request. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class UpdateAreaAddressFamily { - public static final String SERIALIZED_NAME_IPV4 = "ipv4"; - - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private UpdateAreaIPv4 ipv4; - - public UpdateAreaAddressFamily() {} - - public UpdateAreaAddressFamily ipv4(@javax.annotation.Nullable UpdateAreaIPv4 ipv4) { - this.ipv4 = ipv4; - return this; - } - - /** - * Get ipv4 - * - * @return ipv4 - */ - @javax.annotation.Nullable public UpdateAreaIPv4 getIpv4() { - return ipv4; - } - - public void setIpv4(@javax.annotation.Nullable UpdateAreaIPv4 ipv4) { - this.ipv4 = ipv4; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateAreaAddressFamily updateAreaAddressFamily = (UpdateAreaAddressFamily) o; - return Objects.equals(this.ipv4, updateAreaAddressFamily.ipv4); - } - - @Override - public int hashCode() { - return Objects.hash(ipv4); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateAreaAddressFamily {\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).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("ipv4")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateAreaAddressFamily - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateAreaAddressFamily.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateAreaAddressFamily is not found in the empty JSON string", - UpdateAreaAddressFamily.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateAreaAddressFamily.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateAreaAddressFamily` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `ipv4` - if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - UpdateAreaIPv4.validateJsonElement(jsonObj.get("ipv4")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateAreaAddressFamily.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateAreaAddressFamily' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateAreaAddressFamily.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateAreaAddressFamily value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateAreaAddressFamily read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateAreaAddressFamily given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateAreaAddressFamily - * @throws IOException if the JSON string is invalid with respect to UpdateAreaAddressFamily - */ - public static UpdateAreaAddressFamily fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateAreaAddressFamily.class); - } - - /** - * Convert an instance of UpdateAreaAddressFamily 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/model/UpdateAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAreaIPv4.java deleted file mode 100644 index a08b4fef..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAreaIPv4.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * IaaS-API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 1 - * 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.model; - -import cloud.stackit.sdk.iaas.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.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The update object for a IPv4 network area. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class UpdateAreaIPv4 { - public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_NAMESERVERS) - @javax.annotation.Nullable private List defaultNameservers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_DEFAULT_PREFIX_LEN = "defaultPrefixLen"; - - @SerializedName(SERIALIZED_NAME_DEFAULT_PREFIX_LEN) - @javax.annotation.Nullable private Integer defaultPrefixLen; - - public static final String SERIALIZED_NAME_MAX_PREFIX_LEN = "maxPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MAX_PREFIX_LEN) - @javax.annotation.Nullable private Integer maxPrefixLen; - - public static final String SERIALIZED_NAME_MIN_PREFIX_LEN = "minPrefixLen"; - - @SerializedName(SERIALIZED_NAME_MIN_PREFIX_LEN) - @javax.annotation.Nullable private Integer minPrefixLen; - - public UpdateAreaIPv4() {} - - public UpdateAreaIPv4 defaultNameservers( - @javax.annotation.Nullable List defaultNameservers) { - this.defaultNameservers = defaultNameservers; - return this; - } - - public UpdateAreaIPv4 addDefaultNameserversItem(String defaultNameserversItem) { - if (this.defaultNameservers == null) { - this.defaultNameservers = new ArrayList<>(); - } - this.defaultNameservers.add(defaultNameserversItem); - return this; - } - - /** - * Get defaultNameservers - * - * @return defaultNameservers - */ - @javax.annotation.Nullable public List getDefaultNameservers() { - return defaultNameservers; - } - - public void setDefaultNameservers(@javax.annotation.Nullable List defaultNameservers) { - this.defaultNameservers = defaultNameservers; - } - - public UpdateAreaIPv4 defaultPrefixLen(@javax.annotation.Nullable Integer defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - return this; - } - - /** - * The default prefix length for networks in the network area. minimum: 24 maximum: 29 - * - * @return defaultPrefixLen - */ - @javax.annotation.Nullable public Integer getDefaultPrefixLen() { - return defaultPrefixLen; - } - - public void setDefaultPrefixLen(@javax.annotation.Nullable Integer defaultPrefixLen) { - this.defaultPrefixLen = defaultPrefixLen; - } - - public UpdateAreaIPv4 maxPrefixLen(@javax.annotation.Nullable Integer maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - return this; - } - - /** - * The maximal prefix length for networks in the network area. minimum: 24 maximum: 29 - * - * @return maxPrefixLen - */ - @javax.annotation.Nullable public Integer getMaxPrefixLen() { - return maxPrefixLen; - } - - public void setMaxPrefixLen(@javax.annotation.Nullable Integer maxPrefixLen) { - this.maxPrefixLen = maxPrefixLen; - } - - public UpdateAreaIPv4 minPrefixLen(@javax.annotation.Nullable Integer minPrefixLen) { - this.minPrefixLen = minPrefixLen; - return this; - } - - /** - * The minimal prefix length for networks in the network area. minimum: 8 maximum: 29 - * - * @return minPrefixLen - */ - @javax.annotation.Nullable public Integer getMinPrefixLen() { - return minPrefixLen; - } - - public void setMinPrefixLen(@javax.annotation.Nullable Integer minPrefixLen) { - this.minPrefixLen = minPrefixLen; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateAreaIPv4 updateAreaIPv4 = (UpdateAreaIPv4) o; - return Objects.equals(this.defaultNameservers, updateAreaIPv4.defaultNameservers) - && Objects.equals(this.defaultPrefixLen, updateAreaIPv4.defaultPrefixLen) - && Objects.equals(this.maxPrefixLen, updateAreaIPv4.maxPrefixLen) - && Objects.equals(this.minPrefixLen, updateAreaIPv4.minPrefixLen); - } - - @Override - public int hashCode() { - return Objects.hash(defaultNameservers, defaultPrefixLen, maxPrefixLen, minPrefixLen); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateAreaIPv4 {\n"); - sb.append(" defaultNameservers: ") - .append(toIndentedString(defaultNameservers)) - .append("\n"); - sb.append(" defaultPrefixLen: ").append(toIndentedString(defaultPrefixLen)).append("\n"); - sb.append(" maxPrefixLen: ").append(toIndentedString(maxPrefixLen)).append("\n"); - sb.append(" minPrefixLen: ").append(toIndentedString(minPrefixLen)).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( - "defaultNameservers", - "defaultPrefixLen", - "maxPrefixLen", - "minPrefixLen")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateAreaIPv4 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateAreaIPv4.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateAreaIPv4 is not found in the empty JSON string", - UpdateAreaIPv4.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateAreaIPv4.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateAreaIPv4` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("defaultNameservers") != null - && !jsonObj.get("defaultNameservers").isJsonNull() - && !jsonObj.get("defaultNameservers").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `defaultNameservers` to be an array in the JSON string but got `%s`", - jsonObj.get("defaultNameservers").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateAreaIPv4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateAreaIPv4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateAreaIPv4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateAreaIPv4 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateAreaIPv4 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateAreaIPv4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateAreaIPv4 - * @throws IOException if the JSON string is invalid with respect to UpdateAreaIPv4 - */ - public static UpdateAreaIPv4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateAreaIPv4.class); - } - - /** - * Convert an instance of UpdateAreaIPv4 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/model/UpdateAttachedVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAttachedVolumePayload.java index a78612ff..e41a6c83 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAttachedVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAttachedVolumePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,17 @@ 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; -import java.util.Set; import java.util.UUID; /** Object that represents a Volume attachment to a server. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateAttachedVolumePayload { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -95,6 +96,50 @@ public void setDeleteOnTermination(@javax.annotation.Nullable Boolean deleteOnTe return volumeId; } + /** + * 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 UpdateAttachedVolumePayload instance itself + */ + public UpdateAttachedVolumePayload 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) { @@ -107,12 +152,15 @@ public boolean equals(Object o) { return Objects.equals( this.deleteOnTermination, updateAttachedVolumePayload.deleteOnTermination) && Objects.equals(this.serverId, updateAttachedVolumePayload.serverId) - && Objects.equals(this.volumeId, updateAttachedVolumePayload.volumeId); + && Objects.equals(this.volumeId, updateAttachedVolumePayload.volumeId) + && Objects.equals( + this.additionalProperties, + updateAttachedVolumePayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(deleteOnTermination, serverId, volumeId); + return Objects.hash(deleteOnTermination, serverId, volumeId, additionalProperties); } @Override @@ -124,6 +172,9 @@ public String toString() { .append("\n"); sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); sb.append(" volumeId: ").append(toIndentedString(volumeId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -164,26 +215,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateAttachedVolumePayload is not found in the empty JSON string", UpdateAttachedVolumePayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateAttachedVolumePayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateAttachedVolumePayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("serverId") != null && !jsonObj.get("serverId").isJsonNull()) && !jsonObj.get("serverId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `serverId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverId").toString())); } @@ -191,6 +233,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("volumeId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeId").toString())); } @@ -214,6 +257,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateAttachedVolumePayload 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); } @@ -221,7 +288,42 @@ public void write(JsonWriter out, UpdateAttachedVolumePayload value) public UpdateAttachedVolumePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateAttachedVolumePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateBackupPayload.java index 813cff1b..5af8ec55 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateBackupPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,16 +25,17 @@ 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.Set; import java.util.UUID; /** Object that represents a backup. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateBackupPayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -46,6 +47,16 @@ public class UpdateBackupPayload { @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_ENCRYPTED = "encrypted"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED) + @javax.annotation.Nullable private Boolean encrypted; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -91,6 +102,7 @@ public UpdateBackupPayload() {} public UpdateBackupPayload( String availabilityZone, OffsetDateTime createdAt, + Boolean encrypted, UUID id, Long size, UUID snapshotId, @@ -100,6 +112,7 @@ public UpdateBackupPayload( this(); this.availabilityZone = availabilityZone; this.createdAt = createdAt; + this.encrypted = encrypted; this.id = id; this.size = size; this.snapshotId = snapshotId; @@ -126,6 +139,33 @@ public UpdateBackupPayload( return createdAt; } + public UpdateBackupPayload 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; + } + + /** + * Indicates if a volume is encrypted. + * + * @return encrypted + */ + @javax.annotation.Nullable public Boolean getEncrypted() { + return encrypted; + } + /** * Universally Unique Identifier (UUID). * @@ -144,7 +184,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -220,6 +261,50 @@ public void setName(@javax.annotation.Nullable String name) { return volumeId; } + /** + * 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 UpdateBackupPayload instance itself + */ + public UpdateBackupPayload 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) { @@ -231,6 +316,8 @@ public boolean equals(Object o) { UpdateBackupPayload updateBackupPayload = (UpdateBackupPayload) o; return Objects.equals(this.availabilityZone, updateBackupPayload.availabilityZone) && Objects.equals(this.createdAt, updateBackupPayload.createdAt) + && Objects.equals(this.description, updateBackupPayload.description) + && Objects.equals(this.encrypted, updateBackupPayload.encrypted) && Objects.equals(this.id, updateBackupPayload.id) && Objects.equals(this.labels, updateBackupPayload.labels) && Objects.equals(this.name, updateBackupPayload.name) @@ -238,7 +325,9 @@ public boolean equals(Object o) { && Objects.equals(this.snapshotId, updateBackupPayload.snapshotId) && Objects.equals(this.status, updateBackupPayload.status) && Objects.equals(this.updatedAt, updateBackupPayload.updatedAt) - && Objects.equals(this.volumeId, updateBackupPayload.volumeId); + && Objects.equals(this.volumeId, updateBackupPayload.volumeId) + && Objects.equals( + this.additionalProperties, updateBackupPayload.additionalProperties); } @Override @@ -246,6 +335,8 @@ public int hashCode() { return Objects.hash( availabilityZone, createdAt, + description, + encrypted, id, labels, name, @@ -253,7 +344,8 @@ public int hashCode() { snapshotId, status, updatedAt, - volumeId); + volumeId, + additionalProperties); } @Override @@ -262,6 +354,8 @@ public String toString() { sb.append("class UpdateBackupPayload {\n"); sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" encrypted: ").append(toIndentedString(encrypted)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -270,6 +364,9 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" volumeId: ").append(toIndentedString(volumeId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -295,6 +392,8 @@ private String toIndentedString(Object o) { Arrays.asList( "availabilityZone", "createdAt", + "description", + "encrypted", "id", "labels", "name", @@ -320,34 +419,34 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateBackupPayload is not found in the empty JSON string", UpdateBackupPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateBackupPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateBackupPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("availabilityZone") != null && !jsonObj.get("availabilityZone").isJsonNull()) && !jsonObj.get("availabilityZone").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `availabilityZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("availabilityZone").toString())); } + 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") != 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())); } @@ -355,6 +454,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -362,6 +462,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("snapshotId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `snapshotId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("snapshotId").toString())); } @@ -369,6 +470,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -376,6 +478,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("volumeId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeId").toString())); } @@ -398,6 +501,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateBackupPayload 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); } @@ -405,7 +532,41 @@ public void write(JsonWriter out, UpdateBackupPayload value) public UpdateBackupPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateBackupPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImagePayload.java index 1cd1c2f3..c28db87e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImagePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents an update request body of an Image. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateImagePayload { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -140,7 +141,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -224,6 +226,50 @@ public void setProtected(@javax.annotation.Nullable Boolean _protected) { this._protected = _protected; } + /** + * 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 UpdateImagePayload instance itself + */ + public UpdateImagePayload 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) { @@ -240,13 +286,23 @@ public boolean equals(Object o) { && Objects.equals(this.minDiskSize, updateImagePayload.minDiskSize) && Objects.equals(this.minRam, updateImagePayload.minRam) && Objects.equals(this.name, updateImagePayload.name) - && Objects.equals(this._protected, updateImagePayload._protected); + && Objects.equals(this._protected, updateImagePayload._protected) + && Objects.equals( + this.additionalProperties, updateImagePayload.additionalProperties); } @Override public int hashCode() { return Objects.hash( - agent, config, diskFormat, labels, minDiskSize, minRam, name, _protected); + agent, + config, + diskFormat, + labels, + minDiskSize, + minRam, + name, + _protected, + additionalProperties); } @Override @@ -261,6 +317,9 @@ public String toString() { sb.append(" minRam: ").append(toIndentedString(minRam)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" _protected: ").append(toIndentedString(_protected)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -309,21 +368,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateImagePayload is not found in the empty JSON string", UpdateImagePayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateImagePayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateImagePayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `agent` if (jsonObj.get("agent") != null && !jsonObj.get("agent").isJsonNull()) { @@ -337,6 +386,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("diskFormat").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `diskFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("diskFormat").toString())); } @@ -344,6 +394,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -366,6 +417,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateImagePayload 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); } @@ -373,7 +448,41 @@ public void write(JsonWriter out, UpdateImagePayload value) public UpdateImagePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateImagePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImageSharePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImageSharePayload.java index 54f1c344..11552c3d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImageSharePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImageSharePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,11 +25,11 @@ 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; -import java.util.Set; import java.util.UUID; /** @@ -37,7 +37,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateImageSharePayload { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -96,6 +96,50 @@ public void setProjects(@javax.annotation.Nullable List projects) { this.projects = projects; } + /** + * 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 UpdateImageSharePayload instance itself + */ + public UpdateImageSharePayload 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) { @@ -106,12 +150,14 @@ public boolean equals(Object o) { } UpdateImageSharePayload updateImageSharePayload = (UpdateImageSharePayload) o; return Objects.equals(this.parentOrganization, updateImageSharePayload.parentOrganization) - && Objects.equals(this.projects, updateImageSharePayload.projects); + && Objects.equals(this.projects, updateImageSharePayload.projects) + && Objects.equals( + this.additionalProperties, updateImageSharePayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(parentOrganization, projects); + return Objects.hash(parentOrganization, projects, additionalProperties); } @Override @@ -122,6 +168,9 @@ public String toString() { .append(toIndentedString(parentOrganization)) .append("\n"); sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -160,21 +209,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateImageSharePayload is not found in the empty JSON string", UpdateImageSharePayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateImageSharePayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateImageSharePayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the optional json data is an array if present if (jsonObj.get("projects") != null @@ -182,6 +221,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("projects").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `projects` to be an array in the JSON string but got `%s`", jsonObj.get("projects").toString())); } @@ -205,6 +245,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateImageSharePayload 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); } @@ -212,7 +276,41 @@ public void write(JsonWriter out, UpdateImageSharePayload value) public UpdateImageSharePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateImageSharePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateKeyPairPayload.java index d287e09d..1312df54 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateKeyPairPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents an update request body of a public key of an SSH keypair. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateKeyPairPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -50,7 +51,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -62,6 +64,50 @@ public void setLabels(@javax.annotation.Nullable Object labels) { this.labels = labels; } + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateKeyPairPayload instance itself + */ + public UpdateKeyPairPayload 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) { @@ -71,12 +117,14 @@ public boolean equals(Object o) { return false; } UpdateKeyPairPayload updateKeyPairPayload = (UpdateKeyPairPayload) o; - return Objects.equals(this.labels, updateKeyPairPayload.labels); + return Objects.equals(this.labels, updateKeyPairPayload.labels) + && Objects.equals( + this.additionalProperties, updateKeyPairPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(labels); + return Objects.hash(labels, additionalProperties); } @Override @@ -84,6 +132,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdateKeyPairPayload {\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -122,21 +173,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateKeyPairPayload is not found in the empty JSON string", UpdateKeyPairPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateKeyPairPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateKeyPairPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } @@ -157,6 +198,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateKeyPairPayload 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); } @@ -164,7 +229,41 @@ public void write(JsonWriter out, UpdateKeyPairPayload value) public UpdateKeyPairPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateKeyPairPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAddressFamily.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAddressFamily.java deleted file mode 100644 index 61923397..00000000 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAddressFamily.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * IaaS-API - * This API allows you to create and modify IaaS resources. - * - * The version of the OpenAPI document: 1 - * 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.model; - -import cloud.stackit.sdk.iaas.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.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The addressFamily object for a network update request. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") -public class UpdateNetworkAddressFamily { - public static final String SERIALIZED_NAME_IPV4 = "ipv4"; - - @SerializedName(SERIALIZED_NAME_IPV4) - @javax.annotation.Nullable private UpdateNetworkIPv4Body ipv4; - - public static final String SERIALIZED_NAME_IPV6 = "ipv6"; - - @SerializedName(SERIALIZED_NAME_IPV6) - @javax.annotation.Nullable private UpdateNetworkIPv6Body ipv6; - - public UpdateNetworkAddressFamily() {} - - public UpdateNetworkAddressFamily ipv4(@javax.annotation.Nullable UpdateNetworkIPv4Body ipv4) { - this.ipv4 = ipv4; - return this; - } - - /** - * Get ipv4 - * - * @return ipv4 - */ - @javax.annotation.Nullable public UpdateNetworkIPv4Body getIpv4() { - return ipv4; - } - - public void setIpv4(@javax.annotation.Nullable UpdateNetworkIPv4Body ipv4) { - this.ipv4 = ipv4; - } - - public UpdateNetworkAddressFamily ipv6(@javax.annotation.Nullable UpdateNetworkIPv6Body ipv6) { - this.ipv6 = ipv6; - return this; - } - - /** - * Get ipv6 - * - * @return ipv6 - */ - @javax.annotation.Nullable public UpdateNetworkIPv6Body getIpv6() { - return ipv6; - } - - public void setIpv6(@javax.annotation.Nullable UpdateNetworkIPv6Body ipv6) { - this.ipv6 = ipv6; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateNetworkAddressFamily updateNetworkAddressFamily = (UpdateNetworkAddressFamily) o; - return Objects.equals(this.ipv4, updateNetworkAddressFamily.ipv4) - && Objects.equals(this.ipv6, updateNetworkAddressFamily.ipv6); - } - - @Override - public int hashCode() { - return Objects.hash(ipv4, ipv6); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateNetworkAddressFamily {\n"); - sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); - sb.append(" ipv6: ").append(toIndentedString(ipv6)).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("ipv4", "ipv6")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateNetworkAddressFamily - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateNetworkAddressFamily.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateNetworkAddressFamily is not found in the empty JSON string", - UpdateNetworkAddressFamily.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateNetworkAddressFamily.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateNetworkAddressFamily` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `ipv4` - if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { - UpdateNetworkIPv4Body.validateJsonElement(jsonObj.get("ipv4")); - } - // validate the optional field `ipv6` - if (jsonObj.get("ipv6") != null && !jsonObj.get("ipv6").isJsonNull()) { - UpdateNetworkIPv6Body.validateJsonElement(jsonObj.get("ipv6")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateNetworkAddressFamily.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateNetworkAddressFamily' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateNetworkAddressFamily.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateNetworkAddressFamily value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateNetworkAddressFamily read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateNetworkAddressFamily given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateNetworkAddressFamily - * @throws IOException if the JSON string is invalid with respect to UpdateNetworkAddressFamily - */ - public static UpdateNetworkAddressFamily fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateNetworkAddressFamily.class); - } - - /** - * Convert an instance of UpdateNetworkAddressFamily 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/model/UpdateNetworkAreaRegionPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAreaRegionPayload.java new file mode 100644 index 00000000..2a2f8b97 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAreaRegionPayload.java @@ -0,0 +1,300 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 request body for a regional network area update. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class UpdateNetworkAreaRegionPayload { + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private UpdateRegionalAreaIPv4 ipv4; + + public UpdateNetworkAreaRegionPayload() {} + + public UpdateNetworkAreaRegionPayload ipv4( + @javax.annotation.Nullable UpdateRegionalAreaIPv4 ipv4) { + this.ipv4 = ipv4; + return this; + } + + /** + * Get ipv4 + * + * @return ipv4 + */ + @javax.annotation.Nullable public UpdateRegionalAreaIPv4 getIpv4() { + return ipv4; + } + + public void setIpv4(@javax.annotation.Nullable UpdateRegionalAreaIPv4 ipv4) { + this.ipv4 = ipv4; + } + + /** + * 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 UpdateNetworkAreaRegionPayload instance itself + */ + public UpdateNetworkAreaRegionPayload 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; + } + UpdateNetworkAreaRegionPayload updateNetworkAreaRegionPayload = + (UpdateNetworkAreaRegionPayload) o; + return Objects.equals(this.ipv4, updateNetworkAreaRegionPayload.ipv4) + && Objects.equals( + this.additionalProperties, + updateNetworkAreaRegionPayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ipv4, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateNetworkAreaRegionPayload {\n"); + sb.append(" ipv4: ").append(toIndentedString(ipv4)).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("ipv4")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateNetworkAreaRegionPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateNetworkAreaRegionPayload.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 UpdateNetworkAreaRegionPayload is not found in the empty JSON string", + UpdateNetworkAreaRegionPayload.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `ipv4` + if (jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) { + UpdateRegionalAreaIPv4.validateJsonElement(jsonObj.get("ipv4")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateNetworkAreaRegionPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateNetworkAreaRegionPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateNetworkAreaRegionPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateNetworkAreaRegionPayload 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 UpdateNetworkAreaRegionPayload read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateNetworkAreaRegionPayload 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 UpdateNetworkAreaRegionPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateNetworkAreaRegionPayload + * @throws IOException if the JSON string is invalid with respect to + * UpdateNetworkAreaRegionPayload + */ + public static UpdateNetworkAreaRegionPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateNetworkAreaRegionPayload.class); + } + + /** + * Convert an instance of UpdateNetworkAreaRegionPayload 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/model/UpdateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAreaRoutePayload.java index 772af00a..ce9089dd 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAreaRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAreaRoutePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents the request body for a route update. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateNetworkAreaRoutePayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -50,7 +51,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -62,6 +64,50 @@ public void setLabels(@javax.annotation.Nullable Object labels) { this.labels = labels; } + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateNetworkAreaRoutePayload instance itself + */ + public UpdateNetworkAreaRoutePayload 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) { @@ -72,12 +118,15 @@ public boolean equals(Object o) { } UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload = (UpdateNetworkAreaRoutePayload) o; - return Objects.equals(this.labels, updateNetworkAreaRoutePayload.labels); + return Objects.equals(this.labels, updateNetworkAreaRoutePayload.labels) + && Objects.equals( + this.additionalProperties, + updateNetworkAreaRoutePayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(labels); + return Objects.hash(labels, additionalProperties); } @Override @@ -85,6 +134,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdateNetworkAreaRoutePayload {\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -124,21 +176,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateNetworkAreaRoutePayload is not found in the empty JSON string", UpdateNetworkAreaRoutePayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateNetworkAreaRoutePayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateNetworkAreaRoutePayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } @@ -161,6 +203,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateNetworkAreaRoutePayload 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); } @@ -169,7 +235,42 @@ public UpdateNetworkAreaRoutePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateNetworkAreaRoutePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv4Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv4Body.java index 440f9588..69b4bc63 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv4Body.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv4Body.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,17 +25,17 @@ 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; -import java.util.Set; import org.openapitools.jackson.nullable.JsonNullable; /** The config object for a IPv4 network update. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateNetworkIPv4Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -55,8 +55,8 @@ public UpdateNetworkIPv4Body gateway(@javax.annotation.Nullable String gateway) } /** - * The gateway of a network. If not specified the first IP of the network will be assigned as - * the gateway. If 'null' is sent, then the network doesn't have a gateway. + * The IPv4 gateway of a network. If not specified the first IP of the network will be assigned + * as the gateway. If 'null' is sent, then the network doesn't have a gateway. * * @return gateway */ @@ -94,6 +94,50 @@ public void setNameservers(@javax.annotation.Nullable List nameservers) this.nameservers = nameservers; } + /** + * 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 UpdateNetworkIPv4Body instance itself + */ + public UpdateNetworkIPv4Body 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) { @@ -104,7 +148,9 @@ public boolean equals(Object o) { } UpdateNetworkIPv4Body updateNetworkIPv4Body = (UpdateNetworkIPv4Body) o; return Objects.equals(this.gateway, updateNetworkIPv4Body.gateway) - && Objects.equals(this.nameservers, updateNetworkIPv4Body.nameservers); + && Objects.equals(this.nameservers, updateNetworkIPv4Body.nameservers) + && Objects.equals( + this.additionalProperties, updateNetworkIPv4Body.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -118,7 +164,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(gateway, nameservers); + return Objects.hash(gateway, nameservers, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -134,6 +180,9 @@ public String toString() { sb.append("class UpdateNetworkIPv4Body {\n"); sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -172,26 +221,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateNetworkIPv4Body is not found in the empty JSON string", UpdateNetworkIPv4Body.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateNetworkIPv4Body.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateNetworkIPv4Body` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) && !jsonObj.get("gateway").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gateway").toString())); } @@ -201,6 +241,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("nameservers").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `nameservers` to be an array in the JSON string but got `%s`", jsonObj.get("nameservers").toString())); } @@ -223,6 +264,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateNetworkIPv4Body 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); } @@ -230,7 +295,41 @@ public void write(JsonWriter out, UpdateNetworkIPv4Body value) public UpdateNetworkIPv4Body read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateNetworkIPv4Body 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv6Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv6Body.java index 69d27850..e30b3247 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv6Body.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv6Body.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,17 +25,17 @@ 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; -import java.util.Set; import org.openapitools.jackson.nullable.JsonNullable; /** The config object for a IPv6 network update. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateNetworkIPv6Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -55,8 +55,8 @@ public UpdateNetworkIPv6Body gateway(@javax.annotation.Nullable String gateway) } /** - * The gateway of a network. If not specified the first IP of the network will be assigned as - * the gateway. If 'null' is sent, then the network doesn't have a gateway. + * The IPv6 gateway of a network. If not specified the first IP of the network will be assigned + * as the gateway. If 'null' is sent, then the network doesn't have a gateway. * * @return gateway */ @@ -94,6 +94,50 @@ public void setNameservers(@javax.annotation.Nullable List nameservers) this.nameservers = nameservers; } + /** + * 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 UpdateNetworkIPv6Body instance itself + */ + public UpdateNetworkIPv6Body 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) { @@ -104,7 +148,9 @@ public boolean equals(Object o) { } UpdateNetworkIPv6Body updateNetworkIPv6Body = (UpdateNetworkIPv6Body) o; return Objects.equals(this.gateway, updateNetworkIPv6Body.gateway) - && Objects.equals(this.nameservers, updateNetworkIPv6Body.nameservers); + && Objects.equals(this.nameservers, updateNetworkIPv6Body.nameservers) + && Objects.equals( + this.additionalProperties, updateNetworkIPv6Body.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -118,7 +164,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(gateway, nameservers); + return Objects.hash(gateway, nameservers, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -134,6 +180,9 @@ public String toString() { sb.append("class UpdateNetworkIPv6Body {\n"); sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); sb.append(" nameservers: ").append(toIndentedString(nameservers)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -172,26 +221,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateNetworkIPv6Body is not found in the empty JSON string", UpdateNetworkIPv6Body.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateNetworkIPv6Body.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateNetworkIPv6Body` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) && !jsonObj.get("gateway").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gateway").toString())); } @@ -201,6 +241,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("nameservers").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `nameservers` to be an array in the JSON string but got `%s`", jsonObj.get("nameservers").toString())); } @@ -223,6 +264,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateNetworkIPv6Body 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); } @@ -230,7 +295,41 @@ public void write(JsonWriter out, UpdateNetworkIPv6Body value) public UpdateNetworkIPv6Body read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateNetworkIPv6Body 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNicPayload.java index d0f7ff5e..2acbc0ae 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNicPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,17 +26,17 @@ 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; -import java.util.Set; import java.util.UUID; /** Object that represents a network interface update. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateNicPayload { public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; @@ -125,7 +125,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -199,6 +200,50 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou this.securityGroups = securityGroups; } + /** + * 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 UpdateNicPayload instance itself + */ + public UpdateNicPayload 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) { @@ -213,13 +258,20 @@ public boolean equals(Object o) { && Objects.equals(this.labels, updateNicPayload.labels) && Objects.equals(this.name, updateNicPayload.name) && Objects.equals(this.nicSecurity, updateNicPayload.nicSecurity) - && Objects.equals(this.securityGroups, updateNicPayload.securityGroups); + && Objects.equals(this.securityGroups, updateNicPayload.securityGroups) + && Objects.equals(this.additionalProperties, updateNicPayload.additionalProperties); } @Override public int hashCode() { return Objects.hash( - allowedAddresses, description, labels, name, nicSecurity, securityGroups); + allowedAddresses, + description, + labels, + name, + nicSecurity, + securityGroups, + additionalProperties); } @Override @@ -232,6 +284,9 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" nicSecurity: ").append(toIndentedString(nicSecurity)).append("\n"); sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -278,21 +333,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateNicPayload is not found in the empty JSON string", UpdateNicPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateNicPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateNicPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("allowedAddresses") != null && !jsonObj.get("allowedAddresses").isJsonNull()) { @@ -302,6 +347,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("allowedAddresses").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `allowedAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedAddresses").toString())); } @@ -317,6 +363,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -324,6 +371,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -333,6 +381,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("securityGroups").isJsonArray()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", jsonObj.get("securityGroups").toString())); } @@ -355,6 +404,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateNicPayload 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); } @@ -362,7 +435,41 @@ public void write(JsonWriter out, UpdateNicPayload value) public UpdateNicPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateNicPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdatePublicIPPayload.java index 96523e19..0f81aec8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdatePublicIPPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,17 +24,18 @@ 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; -import java.util.Set; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdatePublicIPPayload { public static final String SERIALIZED_NAME_ID = "id"; @@ -74,7 +75,7 @@ public UpdatePublicIPPayload(UUID id, String ip) { } /** - * Object that represents an IP address. + * String that represents an IPv4 address. * * @return ip */ @@ -91,7 +92,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -122,6 +124,50 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * 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 UpdatePublicIPPayload instance itself + */ + public UpdatePublicIPPayload 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) { @@ -134,7 +180,9 @@ public boolean equals(Object o) { return Objects.equals(this.id, updatePublicIPPayload.id) && Objects.equals(this.ip, updatePublicIPPayload.ip) && Objects.equals(this.labels, updatePublicIPPayload.labels) - && Objects.equals(this.networkInterface, updatePublicIPPayload.networkInterface); + && Objects.equals(this.networkInterface, updatePublicIPPayload.networkInterface) + && Objects.equals( + this.additionalProperties, updatePublicIPPayload.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -148,7 +196,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface); + return Objects.hash(id, ip, labels, networkInterface, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -166,6 +214,9 @@ public String toString() { sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" networkInterface: ").append(toIndentedString(networkInterface)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -205,26 +256,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdatePublicIPPayload is not found in the empty JSON string", UpdatePublicIPPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdatePublicIPPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdatePublicIPPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); 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())); } @@ -232,6 +274,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("ip").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `ip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ip").toString())); } @@ -240,6 +283,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("networkInterface").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `networkInterface` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkInterface").toString())); } @@ -262,6 +306,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdatePublicIPPayload 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); } @@ -269,7 +337,41 @@ public void write(JsonWriter out, UpdatePublicIPPayload value) public UpdatePublicIPPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdatePublicIPPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateRegionalAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateRegionalAreaIPv4.java new file mode 100644 index 00000000..b7edd1d6 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateRegionalAreaIPv4.java @@ -0,0 +1,398 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 that represents the request body for a regional network area IPv4 configuration update. + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class UpdateRegionalAreaIPv4 { + public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; + + @SerializedName(SERIALIZED_NAME_DEFAULT_NAMESERVERS) + @javax.annotation.Nullable private List defaultNameservers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DEFAULT_PREFIX_LEN = "defaultPrefixLen"; + + @SerializedName(SERIALIZED_NAME_DEFAULT_PREFIX_LEN) + @javax.annotation.Nullable private Long defaultPrefixLen; + + public static final String SERIALIZED_NAME_MAX_PREFIX_LEN = "maxPrefixLen"; + + @SerializedName(SERIALIZED_NAME_MAX_PREFIX_LEN) + @javax.annotation.Nullable private Long maxPrefixLen; + + public static final String SERIALIZED_NAME_MIN_PREFIX_LEN = "minPrefixLen"; + + @SerializedName(SERIALIZED_NAME_MIN_PREFIX_LEN) + @javax.annotation.Nullable private Long minPrefixLen; + + public UpdateRegionalAreaIPv4() {} + + public UpdateRegionalAreaIPv4 defaultNameservers( + @javax.annotation.Nullable List defaultNameservers) { + this.defaultNameservers = defaultNameservers; + return this; + } + + public UpdateRegionalAreaIPv4 addDefaultNameserversItem(String defaultNameserversItem) { + if (this.defaultNameservers == null) { + this.defaultNameservers = new ArrayList<>(); + } + this.defaultNameservers.add(defaultNameserversItem); + return this; + } + + /** + * Get defaultNameservers + * + * @return defaultNameservers + */ + @javax.annotation.Nullable public List getDefaultNameservers() { + return defaultNameservers; + } + + public void setDefaultNameservers(@javax.annotation.Nullable List defaultNameservers) { + this.defaultNameservers = defaultNameservers; + } + + public UpdateRegionalAreaIPv4 defaultPrefixLen( + @javax.annotation.Nullable Long defaultPrefixLen) { + this.defaultPrefixLen = defaultPrefixLen; + return this; + } + + /** + * The default prefix length for networks in the network area. minimum: 24 maximum: 29 + * + * @return defaultPrefixLen + */ + @javax.annotation.Nullable public Long getDefaultPrefixLen() { + return defaultPrefixLen; + } + + public void setDefaultPrefixLen(@javax.annotation.Nullable Long defaultPrefixLen) { + this.defaultPrefixLen = defaultPrefixLen; + } + + public UpdateRegionalAreaIPv4 maxPrefixLen(@javax.annotation.Nullable Long maxPrefixLen) { + this.maxPrefixLen = maxPrefixLen; + return this; + } + + /** + * The maximal prefix length for networks in the network area. minimum: 24 maximum: 29 + * + * @return maxPrefixLen + */ + @javax.annotation.Nullable public Long getMaxPrefixLen() { + return maxPrefixLen; + } + + public void setMaxPrefixLen(@javax.annotation.Nullable Long maxPrefixLen) { + this.maxPrefixLen = maxPrefixLen; + } + + public UpdateRegionalAreaIPv4 minPrefixLen(@javax.annotation.Nullable Long minPrefixLen) { + this.minPrefixLen = minPrefixLen; + return this; + } + + /** + * The minimal prefix length for networks in the network area. minimum: 8 maximum: 29 + * + * @return minPrefixLen + */ + @javax.annotation.Nullable public Long getMinPrefixLen() { + return minPrefixLen; + } + + public void setMinPrefixLen(@javax.annotation.Nullable Long minPrefixLen) { + this.minPrefixLen = minPrefixLen; + } + + /** + * 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 UpdateRegionalAreaIPv4 instance itself + */ + public UpdateRegionalAreaIPv4 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; + } + UpdateRegionalAreaIPv4 updateRegionalAreaIPv4 = (UpdateRegionalAreaIPv4) o; + return Objects.equals(this.defaultNameservers, updateRegionalAreaIPv4.defaultNameservers) + && Objects.equals(this.defaultPrefixLen, updateRegionalAreaIPv4.defaultPrefixLen) + && Objects.equals(this.maxPrefixLen, updateRegionalAreaIPv4.maxPrefixLen) + && Objects.equals(this.minPrefixLen, updateRegionalAreaIPv4.minPrefixLen) + && Objects.equals( + this.additionalProperties, updateRegionalAreaIPv4.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + defaultNameservers, + defaultPrefixLen, + maxPrefixLen, + minPrefixLen, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateRegionalAreaIPv4 {\n"); + sb.append(" defaultNameservers: ") + .append(toIndentedString(defaultNameservers)) + .append("\n"); + sb.append(" defaultPrefixLen: ").append(toIndentedString(defaultPrefixLen)).append("\n"); + sb.append(" maxPrefixLen: ").append(toIndentedString(maxPrefixLen)).append("\n"); + sb.append(" minPrefixLen: ").append(toIndentedString(minPrefixLen)).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( + "defaultNameservers", + "defaultPrefixLen", + "maxPrefixLen", + "minPrefixLen")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateRegionalAreaIPv4 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateRegionalAreaIPv4.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 UpdateRegionalAreaIPv4 is not found in the empty JSON string", + UpdateRegionalAreaIPv4.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("defaultNameservers") != null + && !jsonObj.get("defaultNameservers").isJsonNull() + && !jsonObj.get("defaultNameservers").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `defaultNameservers` to be an array in the JSON string but got `%s`", + jsonObj.get("defaultNameservers").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateRegionalAreaIPv4.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateRegionalAreaIPv4' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateRegionalAreaIPv4.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateRegionalAreaIPv4 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 UpdateRegionalAreaIPv4 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateRegionalAreaIPv4 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 UpdateRegionalAreaIPv4 given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateRegionalAreaIPv4 + * @throws IOException if the JSON string is invalid with respect to UpdateRegionalAreaIPv4 + */ + public static UpdateRegionalAreaIPv4 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateRegionalAreaIPv4.class); + } + + /** + * Convert an instance of UpdateRegionalAreaIPv4 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/model/UpdateRouteOfRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateRouteOfRoutingTablePayload.java new file mode 100644 index 00000000..e32f702d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateRouteOfRoutingTablePayload.java @@ -0,0 +1,299 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 request body for a route update. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class UpdateRouteOfRoutingTablePayload { + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public UpdateRouteOfRoutingTablePayload() {} + + public UpdateRouteOfRoutingTablePayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * 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. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateRouteOfRoutingTablePayload instance itself + */ + public UpdateRouteOfRoutingTablePayload 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; + } + UpdateRouteOfRoutingTablePayload updateRouteOfRoutingTablePayload = + (UpdateRouteOfRoutingTablePayload) o; + return Objects.equals(this.labels, updateRouteOfRoutingTablePayload.labels) + && Objects.equals( + this.additionalProperties, + updateRouteOfRoutingTablePayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(labels, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateRouteOfRoutingTablePayload {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + 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("labels")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateRouteOfRoutingTablePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateRouteOfRoutingTablePayload.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 UpdateRouteOfRoutingTablePayload is not found in the empty JSON string", + UpdateRouteOfRoutingTablePayload.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateRouteOfRoutingTablePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateRouteOfRoutingTablePayload' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateRouteOfRoutingTablePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateRouteOfRoutingTablePayload 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 UpdateRouteOfRoutingTablePayload read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateRouteOfRoutingTablePayload 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 UpdateRouteOfRoutingTablePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateRouteOfRoutingTablePayload + * @throws IOException if the JSON string is invalid with respect to + * UpdateRouteOfRoutingTablePayload + */ + public static UpdateRouteOfRoutingTablePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateRouteOfRoutingTablePayload.class); + } + + /** + * Convert an instance of UpdateRouteOfRoutingTablePayload 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/model/UpdateRoutingTableOfAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateRoutingTableOfAreaPayload.java new file mode 100644 index 00000000..27ad89b8 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateRoutingTableOfAreaPayload.java @@ -0,0 +1,424 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * 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.model; + +import cloud.stackit.sdk.iaas.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 request body for a routing table update. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.19.0") +public class UpdateRoutingTableOfAreaPayload { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + + public static final String SERIALIZED_NAME_DYNAMIC_ROUTES = "dynamicRoutes"; + + @SerializedName(SERIALIZED_NAME_DYNAMIC_ROUTES) + @javax.annotation.Nullable private Boolean dynamicRoutes; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; + + public static final String SERIALIZED_NAME_SYSTEM_ROUTES = "systemRoutes"; + + @SerializedName(SERIALIZED_NAME_SYSTEM_ROUTES) + @javax.annotation.Nullable private Boolean systemRoutes; + + public UpdateRoutingTableOfAreaPayload() {} + + public UpdateRoutingTableOfAreaPayload 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 UpdateRoutingTableOfAreaPayload dynamicRoutes( + @javax.annotation.Nullable Boolean dynamicRoutes) { + this.dynamicRoutes = dynamicRoutes; + return this; + } + + /** + * The update config setting for a routing table which allows propagation of dynamic routes to + * this routing table. + * + * @return dynamicRoutes + */ + @javax.annotation.Nullable public Boolean getDynamicRoutes() { + return dynamicRoutes; + } + + public void setDynamicRoutes(@javax.annotation.Nullable Boolean dynamicRoutes) { + this.dynamicRoutes = dynamicRoutes; + } + + public UpdateRoutingTableOfAreaPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * 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. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public UpdateRoutingTableOfAreaPayload name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name for a General Object. Matches Names and also UUIDs. + * + * @return name + */ + @javax.annotation.Nullable public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + public UpdateRoutingTableOfAreaPayload systemRoutes( + @javax.annotation.Nullable Boolean systemRoutes) { + this.systemRoutes = systemRoutes; + return this; + } + + /** + * The update config setting for a routing table which allows installation of automatic system + * routes for connectivity between projects in the same SNA. + * + * @return systemRoutes + */ + @javax.annotation.Nullable public Boolean getSystemRoutes() { + return systemRoutes; + } + + public void setSystemRoutes(@javax.annotation.Nullable Boolean systemRoutes) { + this.systemRoutes = systemRoutes; + } + + /** + * 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 UpdateRoutingTableOfAreaPayload instance itself + */ + public UpdateRoutingTableOfAreaPayload 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; + } + UpdateRoutingTableOfAreaPayload updateRoutingTableOfAreaPayload = + (UpdateRoutingTableOfAreaPayload) o; + return Objects.equals(this.description, updateRoutingTableOfAreaPayload.description) + && Objects.equals(this.dynamicRoutes, updateRoutingTableOfAreaPayload.dynamicRoutes) + && Objects.equals(this.labels, updateRoutingTableOfAreaPayload.labels) + && Objects.equals(this.name, updateRoutingTableOfAreaPayload.name) + && Objects.equals(this.systemRoutes, updateRoutingTableOfAreaPayload.systemRoutes) + && Objects.equals( + this.additionalProperties, + updateRoutingTableOfAreaPayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + description, dynamicRoutes, labels, name, systemRoutes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateRoutingTableOfAreaPayload {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" dynamicRoutes: ").append(toIndentedString(dynamicRoutes)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" systemRoutes: ").append(toIndentedString(systemRoutes)).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( + "description", "dynamicRoutes", "labels", "name", "systemRoutes")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateRoutingTableOfAreaPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateRoutingTableOfAreaPayload.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 UpdateRoutingTableOfAreaPayload is not found in the empty JSON string", + UpdateRoutingTableOfAreaPayload.openapiRequiredFields.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())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateRoutingTableOfAreaPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateRoutingTableOfAreaPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateRoutingTableOfAreaPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateRoutingTableOfAreaPayload 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 UpdateRoutingTableOfAreaPayload read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateRoutingTableOfAreaPayload 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 UpdateRoutingTableOfAreaPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateRoutingTableOfAreaPayload + * @throws IOException if the JSON string is invalid with respect to + * UpdateRoutingTableOfAreaPayload + */ + public static UpdateRoutingTableOfAreaPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateRoutingTableOfAreaPayload.class); + } + + /** + * Convert an instance of UpdateRoutingTableOfAreaPayload 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/model/UpdateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSecurityGroupPayload.java index 7fa43087..06837978 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSecurityGroupPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents an update request body of a security group. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateSecurityGroupPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -78,7 +79,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -108,6 +110,50 @@ public void setName(@javax.annotation.Nullable String name) { this.name = name; } + /** + * 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 UpdateSecurityGroupPayload instance itself + */ + public UpdateSecurityGroupPayload 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) { @@ -119,12 +165,14 @@ public boolean equals(Object o) { UpdateSecurityGroupPayload updateSecurityGroupPayload = (UpdateSecurityGroupPayload) o; return Objects.equals(this.description, updateSecurityGroupPayload.description) && Objects.equals(this.labels, updateSecurityGroupPayload.labels) - && Objects.equals(this.name, updateSecurityGroupPayload.name); + && Objects.equals(this.name, updateSecurityGroupPayload.name) + && Objects.equals( + this.additionalProperties, updateSecurityGroupPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(description, labels, name); + return Objects.hash(description, labels, name, additionalProperties); } @Override @@ -134,6 +182,9 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -172,26 +223,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateSecurityGroupPayload is not found in the empty JSON string", UpdateSecurityGroupPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateSecurityGroupPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateSecurityGroupPayload` properties. JSON: %s", - entry.getKey(), 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())); } @@ -199,6 +241,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -222,6 +265,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateSecurityGroupPayload 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); } @@ -229,7 +296,41 @@ public void write(JsonWriter out, UpdateSecurityGroupPayload value) public UpdateSecurityGroupPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateSecurityGroupPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateServerPayload.java index 5e519ab3..14572e43 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateServerPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents an update request body of a server. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateServerPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -60,7 +61,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -110,6 +112,50 @@ public void setName(@javax.annotation.Nullable String name) { this.name = name; } + /** + * 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 UpdateServerPayload instance itself + */ + public UpdateServerPayload 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) { @@ -121,12 +167,14 @@ public boolean equals(Object o) { UpdateServerPayload updateServerPayload = (UpdateServerPayload) o; return Objects.equals(this.labels, updateServerPayload.labels) && Objects.equals(this.metadata, updateServerPayload.metadata) - && Objects.equals(this.name, updateServerPayload.name); + && Objects.equals(this.name, updateServerPayload.name) + && Objects.equals( + this.additionalProperties, updateServerPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(labels, metadata, name); + return Objects.hash(labels, metadata, name, additionalProperties); } @Override @@ -136,6 +184,9 @@ public String toString() { sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -174,26 +225,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateServerPayload is not found in the empty JSON string", UpdateServerPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateServerPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateServerPayload` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !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())); } @@ -216,6 +258,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateServerPayload 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); } @@ -223,7 +289,41 @@ public void write(JsonWriter out, UpdateServerPayload value) public UpdateServerPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateServerPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSnapshotPayload.java index 17d78dbb..2c2e6893 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSnapshotPayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,22 @@ 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; -import java.util.Set; /** Object that represents an update request body of a snapshot. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateSnapshotPayload { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_LABELS = "labels"; @SerializedName(SERIALIZED_NAME_LABELS) @@ -46,6 +52,24 @@ public class UpdateSnapshotPayload { public UpdateSnapshotPayload() {} + public UpdateSnapshotPayload 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 UpdateSnapshotPayload labels(@javax.annotation.Nullable Object labels) { this.labels = labels; return this; @@ -55,7 +79,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -85,6 +110,50 @@ public void setName(@javax.annotation.Nullable String name) { this.name = name; } + /** + * 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 UpdateSnapshotPayload instance itself + */ + public UpdateSnapshotPayload 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) { @@ -94,21 +163,28 @@ public boolean equals(Object o) { return false; } UpdateSnapshotPayload updateSnapshotPayload = (UpdateSnapshotPayload) o; - return Objects.equals(this.labels, updateSnapshotPayload.labels) - && Objects.equals(this.name, updateSnapshotPayload.name); + return Objects.equals(this.description, updateSnapshotPayload.description) + && Objects.equals(this.labels, updateSnapshotPayload.labels) + && Objects.equals(this.name, updateSnapshotPayload.name) + && Objects.equals( + this.additionalProperties, updateSnapshotPayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(labels, name); + return Objects.hash(description, labels, name, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdateSnapshotPayload {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -129,7 +205,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("labels", "name")); + openapiFields = new HashSet(Arrays.asList("description", "labels", "name")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -147,26 +223,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateSnapshotPayload is not found in the empty JSON string", UpdateSnapshotPayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateSnapshotPayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateSnapshotPayload` properties. JSON: %s", - entry.getKey(), 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())); + } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !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())); } @@ -189,6 +264,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateSnapshotPayload 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); } @@ -196,7 +295,41 @@ public void write(JsonWriter out, UpdateSnapshotPayload value) public UpdateSnapshotPayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateSnapshotPayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateVolumePayload.java index ca3ee760..7f30de64 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateVolumePayload.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents an update request body of a volume. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class UpdateVolumePayload { public static final String SERIALIZED_NAME_BOOTABLE = "bootable"; @@ -124,7 +125,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -154,6 +156,50 @@ public void setName(@javax.annotation.Nullable String name) { this.name = name; } + /** + * 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 UpdateVolumePayload instance itself + */ + public UpdateVolumePayload 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) { @@ -167,12 +213,14 @@ public boolean equals(Object o) { && Objects.equals(this.description, updateVolumePayload.description) && Objects.equals(this.imageConfig, updateVolumePayload.imageConfig) && Objects.equals(this.labels, updateVolumePayload.labels) - && Objects.equals(this.name, updateVolumePayload.name); + && Objects.equals(this.name, updateVolumePayload.name) + && Objects.equals( + this.additionalProperties, updateVolumePayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(bootable, description, imageConfig, labels, name); + return Objects.hash(bootable, description, imageConfig, labels, name, additionalProperties); } @Override @@ -184,6 +232,9 @@ public String toString() { sb.append(" imageConfig: ").append(toIndentedString(imageConfig)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -224,26 +275,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in UpdateVolumePayload is not found in the empty JSON string", UpdateVolumePayload.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateVolumePayload.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `UpdateVolumePayload` properties. JSON: %s", - entry.getKey(), 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())); } @@ -255,6 +297,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -277,6 +320,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, UpdateVolumePayload 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); } @@ -284,7 +351,41 @@ public void write(JsonWriter out, UpdateVolumePayload value) public UpdateVolumePayload read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateVolumePayload 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Volume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Volume.java index 64e08658..19d19875 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Volume.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Volume.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,10 +25,11 @@ 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.Set; import java.util.UUID; /** @@ -36,7 +37,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class Volume { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -259,7 +260,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -376,6 +378,50 @@ public void setSource(@javax.annotation.Nullable VolumeSource source) { 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 Volume instance itself + */ + public Volume 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) { @@ -400,7 +446,8 @@ public boolean equals(Object o) { && Objects.equals(this.size, volume.size) && Objects.equals(this.source, volume.source) && Objects.equals(this.status, volume.status) - && Objects.equals(this.updatedAt, volume.updatedAt); + && Objects.equals(this.updatedAt, volume.updatedAt) + && Objects.equals(this.additionalProperties, volume.additionalProperties); } @Override @@ -421,7 +468,8 @@ public int hashCode() { size, source, status, - updatedAt); + updatedAt, + additionalProperties); } @Override @@ -446,6 +494,9 @@ public String toString() { sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -502,35 +553,28 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in Volume is not found in the empty JSON string", Volume.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Volume.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Volume` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Volume.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("availabilityZone").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `availabilityZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("availabilityZone").toString())); } @@ -538,6 +582,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -550,6 +595,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -561,6 +607,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -569,6 +616,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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())); } @@ -576,6 +624,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("serverId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `serverId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverId").toString())); } @@ -587,6 +636,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } @@ -608,6 +658,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, Volume 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); } @@ -615,7 +689,41 @@ public void write(JsonWriter out, Volume value) throws IOException { public Volume read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Volume 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachment.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachment.java index 7e36ed79..96b3e7e4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachment.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachment.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,17 @@ 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; -import java.util.Set; import java.util.UUID; /** Object that represents a Volume attachment to a server. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class VolumeAttachment { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -95,6 +96,50 @@ public void setDeleteOnTermination(@javax.annotation.Nullable Boolean deleteOnTe return volumeId; } + /** + * 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 VolumeAttachment instance itself + */ + public VolumeAttachment 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) { @@ -106,12 +151,13 @@ public boolean equals(Object o) { VolumeAttachment volumeAttachment = (VolumeAttachment) o; return Objects.equals(this.deleteOnTermination, volumeAttachment.deleteOnTermination) && Objects.equals(this.serverId, volumeAttachment.serverId) - && Objects.equals(this.volumeId, volumeAttachment.volumeId); + && Objects.equals(this.volumeId, volumeAttachment.volumeId) + && Objects.equals(this.additionalProperties, volumeAttachment.additionalProperties); } @Override public int hashCode() { - return Objects.hash(deleteOnTermination, serverId, volumeId); + return Objects.hash(deleteOnTermination, serverId, volumeId, additionalProperties); } @Override @@ -123,6 +169,9 @@ public String toString() { .append("\n"); sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); sb.append(" volumeId: ").append(toIndentedString(volumeId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -162,26 +211,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in VolumeAttachment is not found in the empty JSON string", VolumeAttachment.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!VolumeAttachment.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `VolumeAttachment` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("serverId") != null && !jsonObj.get("serverId").isJsonNull()) && !jsonObj.get("serverId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `serverId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverId").toString())); } @@ -189,6 +229,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("volumeId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("volumeId").toString())); } @@ -211,6 +252,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, VolumeAttachment 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); } @@ -218,7 +283,41 @@ public void write(JsonWriter out, VolumeAttachment value) public VolumeAttachment read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VolumeAttachment 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachmentListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachmentListResponse.java index 5c0a8360..99d01b19 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachmentListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachmentListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Volume attachment list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class VolumeAttachmentListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -73,6 +73,50 @@ 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 VolumeAttachmentListResponse instance itself + */ + public VolumeAttachmentListResponse 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) { @@ -83,12 +127,15 @@ public boolean equals(Object o) { } VolumeAttachmentListResponse volumeAttachmentListResponse = (VolumeAttachmentListResponse) o; - return Objects.equals(this.items, volumeAttachmentListResponse.items); + return Objects.equals(this.items, volumeAttachmentListResponse.items) + && Objects.equals( + this.additionalProperties, + volumeAttachmentListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -96,6 +143,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class VolumeAttachmentListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -135,29 +185,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in VolumeAttachmentListResponse is not found in the empty JSON string", VolumeAttachmentListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!VolumeAttachmentListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `VolumeAttachmentListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : VolumeAttachmentListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -165,6 +207,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -196,6 +239,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, VolumeAttachmentListResponse 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); } @@ -203,7 +270,42 @@ public void write(JsonWriter out, VolumeAttachmentListResponse value) public VolumeAttachmentListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VolumeAttachmentListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeEncryptionParameter.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeEncryptionParameter.java index 55e3854d..e3df0a07 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeEncryptionParameter.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeEncryptionParameter.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,10 +24,11 @@ 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; -import java.util.Set; import java.util.UUID; /** @@ -38,7 +39,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class VolumeEncryptionParameter { public static final String SERIALIZED_NAME_KEK_KEY_ID = "kekKeyId"; @@ -193,6 +194,50 @@ public void setServiceAccount(@javax.annotation.Nonnull String serviceAccount) { this.serviceAccount = serviceAccount; } + /** + * 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 VolumeEncryptionParameter instance itself + */ + public VolumeEncryptionParameter 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) { @@ -207,7 +252,9 @@ public boolean equals(Object o) { && Objects.equals(this.kekKeyringId, volumeEncryptionParameter.kekKeyringId) && Objects.equals(this.kekProjectId, volumeEncryptionParameter.kekProjectId) && Arrays.equals(this.keyPayload, volumeEncryptionParameter.keyPayload) - && Objects.equals(this.serviceAccount, volumeEncryptionParameter.serviceAccount); + && Objects.equals(this.serviceAccount, volumeEncryptionParameter.serviceAccount) + && Objects.equals( + this.additionalProperties, volumeEncryptionParameter.additionalProperties); } @Override @@ -218,7 +265,8 @@ public int hashCode() { kekKeyringId, kekProjectId, Arrays.hashCode(keyPayload), - serviceAccount); + serviceAccount, + additionalProperties); } @Override @@ -231,6 +279,9 @@ public String toString() { sb.append(" kekProjectId: ").append(toIndentedString(kekProjectId)).append("\n"); sb.append(" keyPayload: ").append(toIndentedString(keyPayload)).append("\n"); sb.append(" serviceAccount: ").append(toIndentedString(serviceAccount)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -280,41 +331,35 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in VolumeEncryptionParameter is not found in the empty JSON string", VolumeEncryptionParameter.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!VolumeEncryptionParameter.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `VolumeEncryptionParameter` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : VolumeEncryptionParameter.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("kekKeyId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `kekKeyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kekKeyId").toString())); } if (!jsonObj.get("kekKeyringId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `kekKeyringId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kekKeyringId").toString())); } @@ -322,12 +367,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("kekProjectId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `kekProjectId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kekProjectId").toString())); } if (!jsonObj.get("serviceAccount").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "Expected the field `serviceAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serviceAccount").toString())); } @@ -351,6 +398,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, VolumeEncryptionParameter 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); } @@ -358,7 +429,41 @@ public void write(JsonWriter out, VolumeEncryptionParameter value) public VolumeEncryptionParameter read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VolumeEncryptionParameter 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeListResponse.java index 8325f0b5..2370efc7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Volume list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class VolumeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -72,6 +72,50 @@ 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 VolumeListResponse instance itself + */ + public VolumeListResponse 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) { @@ -81,12 +125,14 @@ public boolean equals(Object o) { return false; } VolumeListResponse volumeListResponse = (VolumeListResponse) o; - return Objects.equals(this.items, volumeListResponse.items); + return Objects.equals(this.items, volumeListResponse.items) + && Objects.equals( + this.additionalProperties, volumeListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -94,6 +140,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class VolumeListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -132,29 +181,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in VolumeListResponse is not found in the empty JSON string", VolumeListResponse.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!VolumeListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `VolumeListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : VolumeListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -162,6 +203,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -191,6 +233,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, VolumeListResponse 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); } @@ -198,7 +264,41 @@ public void write(JsonWriter out, VolumeListResponse value) public VolumeListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VolumeListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClass.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClass.java index 055e63c8..d662371f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClass.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClass.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,15 +24,16 @@ 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; -import java.util.Set; /** Object that represents a Volume performance class. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class VolumePerformanceClass { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -107,7 +108,8 @@ 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. + * `null` value for a key will remove that key. The `stackit-` prefix is + * reserved and cannot be used for Keys. * * @return labels */ @@ -156,6 +158,50 @@ public void setThroughput(@javax.annotation.Nullable Long throughput) { this.throughput = throughput; } + /** + * 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 VolumePerformanceClass instance itself + */ + public VolumePerformanceClass 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) { @@ -169,12 +215,14 @@ public boolean equals(Object o) { && Objects.equals(this.iops, volumePerformanceClass.iops) && Objects.equals(this.labels, volumePerformanceClass.labels) && Objects.equals(this.name, volumePerformanceClass.name) - && Objects.equals(this.throughput, volumePerformanceClass.throughput); + && Objects.equals(this.throughput, volumePerformanceClass.throughput) + && Objects.equals( + this.additionalProperties, volumePerformanceClass.additionalProperties); } @Override public int hashCode() { - return Objects.hash(description, iops, labels, name, throughput); + return Objects.hash(description, iops, labels, name, throughput, additionalProperties); } @Override @@ -186,6 +234,9 @@ public String toString() { sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" throughput: ").append(toIndentedString(throughput)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -226,29 +277,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in VolumePerformanceClass is not found in the empty JSON string", VolumePerformanceClass.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!VolumePerformanceClass.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `VolumePerformanceClass` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : VolumePerformanceClass.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -256,12 +299,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !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("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())); } @@ -284,6 +329,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, VolumePerformanceClass 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); } @@ -291,7 +360,41 @@ public void write(JsonWriter out, VolumePerformanceClass value) public VolumePerformanceClass read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VolumePerformanceClass 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClassListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClassListResponse.java index 7edf8c39..f48d4d12 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClassListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClassListResponse.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,16 +26,16 @@ 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; -import java.util.Set; /** Volume performance class list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class VolumePerformanceClassListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -73,6 +73,50 @@ public void setItems(@javax.annotation.Nonnull List item 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 VolumePerformanceClassListResponse instance itself + */ + public VolumePerformanceClassListResponse 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) { @@ -83,12 +127,15 @@ public boolean equals(Object o) { } VolumePerformanceClassListResponse volumePerformanceClassListResponse = (VolumePerformanceClassListResponse) o; - return Objects.equals(this.items, volumePerformanceClassListResponse.items); + return Objects.equals(this.items, volumePerformanceClassListResponse.items) + && Objects.equals( + this.additionalProperties, + volumePerformanceClassListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(items); + return Objects.hash(items, additionalProperties); } @Override @@ -96,6 +143,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class VolumePerformanceClassListResponse {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -135,30 +185,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in VolumePerformanceClassListResponse is not found in the empty JSON string", VolumePerformanceClassListResponse.openapiRequiredFields .toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!VolumePerformanceClassListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `VolumePerformanceClassListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : VolumePerformanceClassListResponse.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -166,6 +208,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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())); } @@ -197,6 +240,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { public void write(JsonWriter out, VolumePerformanceClassListResponse 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); } @@ -205,7 +272,42 @@ public VolumePerformanceClassListResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VolumePerformanceClassListResponse 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(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeSource.java index 2193609d..3011dfa8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeSource.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,16 +24,17 @@ 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; -import java.util.Set; import java.util.UUID; /** The source object of a volume. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.15.0") + comments = "Generator version: 7.19.0") public class VolumeSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -88,6 +89,50 @@ 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 VolumeSource instance itself + */ + public VolumeSource 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) { @@ -98,12 +143,13 @@ public boolean equals(Object o) { } VolumeSource volumeSource = (VolumeSource) o; return Objects.equals(this.id, volumeSource.id) - && Objects.equals(this.type, volumeSource.type); + && Objects.equals(this.type, volumeSource.type) + && Objects.equals(this.additionalProperties, volumeSource.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, type); + return Objects.hash(id, type, additionalProperties); } @Override @@ -112,6 +158,9 @@ public String toString() { sb.append("class VolumeSource {\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(); } @@ -150,41 +199,35 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( + java.util.Locale.ROOT, "The required field(s) %s in VolumeSource is not found in the empty JSON string", VolumeSource.openapiRequiredFields.toString())); } } - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!VolumeSource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `VolumeSource` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : VolumeSource.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())); + requiredField, + jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); 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())); } 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())); } @@ -206,6 +249,30 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, VolumeSource 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); } @@ -213,7 +280,41 @@ public void write(JsonWriter out, VolumeSource value) throws IOException { public VolumeSource read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VolumeSource 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(); } diff --git a/services/iaas/src/test/java/cloud/stackit/sdk/iaas/api/DefaultApiTest.java b/services/iaas/src/test/java/cloud/stackit/sdk/iaas/api/DefaultApiTest.java index 32dcd555..ea336350 100644 --- a/services/iaas/src/test/java/cloud/stackit/sdk/iaas/api/DefaultApiTest.java +++ b/services/iaas/src/test/java/cloud/stackit/sdk/iaas/api/DefaultApiTest.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,13 +10,12 @@ * Do not edit the class manually. */ -package cloud.stackit.sdk.iaas.api; +package cloud.stackit.sdk.iaas; import cloud.stackit.sdk.core.KeyFlowAuthenticator; import cloud.stackit.sdk.core.auth.SetupAuth; import cloud.stackit.sdk.core.config.CoreConfiguration; import cloud.stackit.sdk.core.utils.TestUtils; -import cloud.stackit.sdk.iaas.ApiClient; import java.io.IOException; import okhttp3.Authenticator; import okhttp3.OkHttpClient; diff --git a/services/iaas/src/test/java/cloud/stackit/sdk/iaas/api/IaasApiTest.java b/services/iaas/src/test/java/cloud/stackit/sdk/iaas/api/IaasApiTest.java index 6466b93d..9424a784 100644 --- a/services/iaas/src/test/java/cloud/stackit/sdk/iaas/api/IaasApiTest.java +++ b/services/iaas/src/test/java/cloud/stackit/sdk/iaas/api/IaasApiTest.java @@ -1,8 +1,8 @@ /* - * IaaS-API + * STACKIT IaaS API * This API allows you to create and modify IaaS resources. * - * The version of the OpenAPI document: 1 + * The version of the OpenAPI document: 2 * Contact: stackit-iaas@mail.schwarz * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). From 8a6d8c5d77435438133a67c652ec0250dd3d87cd Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Wed, 11 Mar 2026 15:00:57 +0100 Subject: [PATCH 2/4] migrate iaas examples --- .../examples/CustomHttpClientExample.java | 5 +- .../sdk/iaas/examples/IaaSExample.java | 226 ++++++++++-------- .../examples/ServerbackupExample.java | 2 +- 3 files changed, 130 insertions(+), 103 deletions(-) diff --git a/examples/custom-http-client/src/main/java/cloud/stackit/sdk/customhttpclient/examples/CustomHttpClientExample.java b/examples/custom-http-client/src/main/java/cloud/stackit/sdk/customhttpclient/examples/CustomHttpClientExample.java index e3ba7d5f..602cd789 100644 --- a/examples/custom-http-client/src/main/java/cloud/stackit/sdk/customhttpclient/examples/CustomHttpClientExample.java +++ b/examples/custom-http-client/src/main/java/cloud/stackit/sdk/customhttpclient/examples/CustomHttpClientExample.java @@ -46,9 +46,12 @@ public static void main(String[] args) throws IOException { } UUID projectId = UUID.fromString(projectIdString); + // specify which region should be queried + String region = "eu01"; + try { /* list all servers */ - ServerListResponse servers = iaasApi.listServers(projectId, false, null); + ServerListResponse servers = iaasApi.listServers(projectId, region, false, null); System.out.println("\nAvailable servers: "); for (Server server : servers.getItems()) { System.out.println("* " + server.getId() + " | " + server.getName()); diff --git a/examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSExample.java b/examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSExample.java index e44ef151..d31ba0af 100644 --- a/examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSExample.java +++ b/examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSExample.java @@ -11,6 +11,7 @@ import java.util.concurrent.TimeUnit; final class IaaSExample { + private static final String REGION = "eu01"; private IaaSExample() {} @@ -49,38 +50,40 @@ public static void main(String[] args) throws IOException { Network newNetwork = iaasApi.createNetwork( projectId, + REGION, new CreateNetworkPayload() .name("java-sdk-example-network-01") .dhcp(true) .routed(false) .labels(Collections.singletonMap("some-network-label", "bar")) - .addressFamily( - new CreateNetworkAddressFamily() - .ipv4( - new CreateNetworkIPv4Body() - .addNameserversItem( - "8.8.8.8")))); - + .ipv4( + new CreateNetworkIPv4( + new CreateNetworkIPv4WithPrefixLength() + .addNameserversItem("8.8.8.8") + .prefixLength(24L)))); /* update the network we just created */ iaasApi.partialUpdateNetwork( projectId, - newNetwork.getNetworkId(), + REGION, + newNetwork.getId(), new PartialUpdateNetworkPayload() .dhcp(false) .labels(Collections.singletonMap("some-network-label", "bar-updated"))); /* fetch the network we just created */ - Network fetchedNetwork = iaasApi.getNetwork(projectId, newNetwork.getNetworkId()); + Network fetchedNetwork = iaasApi.getNetwork(projectId, REGION, newNetwork.getId()); System.out.println("\nFetched network: "); System.out.println("* Network name: " + fetchedNetwork.getName()); - System.out.println("* Id: " + fetchedNetwork.getNetworkId()); + System.out.println("* Id: " + fetchedNetwork.getId()); System.out.println( "* DHCP: " + (Boolean.TRUE.equals(fetchedNetwork.getDhcp()) ? "YES" : "NO")); - System.out.println("* Gateway: " + fetchedNetwork.getGateway()); - System.out.println("* Public IP: " + fetchedNetwork.getPublicIp()); + if (fetchedNetwork.getIpv4() != null) { + System.out.println("* Gateway: " + fetchedNetwork.getIpv4().getGateway()); + System.out.println("* Public IP: " + fetchedNetwork.getIpv4().getPublicIp()); + } /* list all available networks in the project */ - NetworkListResponse networks = iaasApi.listNetworks(projectId, null); + NetworkListResponse networks = iaasApi.listNetworks(projectId, REGION, null); System.out.println("\nAvailable networks: "); for (Network network : networks.getItems()) { System.out.println("* " + network.getName()); @@ -93,7 +96,7 @@ public static void main(String[] args) throws IOException { * */ /* list all available images */ - ImageListResponse images = iaasApi.listImages(projectId, false, null); + ImageListResponse images = iaasApi.listImages(projectId, REGION, false, null); System.out.println("\nAvailable images: "); for (Image image : images.getItems()) { System.out.println(image.getId() + " | " + image.getName()); @@ -104,8 +107,8 @@ public static void main(String[] args) throws IOException { images.getItems() .get(0) .getId(); // we just use a random image id in our example - assert imageId != null; - Image fetchedImage = iaasApi.getImage(projectId, imageId); + Objects.requireNonNull(imageId != null); + Image fetchedImage = iaasApi.getImage(projectId, REGION, imageId); System.out.println("\nFetched image:"); System.out.println("* Image name: " + fetchedImage.getName()); System.out.println("* Image id: " + fetchedImage.getId()); @@ -137,7 +140,7 @@ public static void main(String[] args) throws IOException { System.out.println("\nKeypair created: " + newKeypair.getName()); /* update the keypair */ - assert newKeypair.getName() != null; + Objects.requireNonNull(newKeypair.getName()); iaasApi.updateKeyPair( newKeypair.getName(), new UpdateKeyPairPayload() @@ -160,7 +163,8 @@ public static void main(String[] args) throws IOException { * */ /* list all available machine types */ - MachineTypeListResponse machineTypes = iaasApi.listMachineTypes(projectId, null); + MachineTypeListResponse machineTypes = + iaasApi.listMachineTypes(projectId, REGION, null); System.out.println("\nAvailable machine types: "); for (MachineType machineType : machineTypes.getItems()) { System.out.println("* " + machineType.getName()); @@ -168,7 +172,8 @@ public static void main(String[] args) throws IOException { /* fetch details about a machine type */ MachineType fetchedMachineType = - iaasApi.getMachineType(projectId, machineTypes.getItems().get(0).getName()); + iaasApi.getMachineType( + projectId, REGION, machineTypes.getItems().get(0).getName()); System.out.println("\nFetched machine type: "); System.out.println("* Machine type name: " + fetchedMachineType.getName()); System.out.println("* Description: " + fetchedMachineType.getDescription()); @@ -177,88 +182,105 @@ public static void main(String[] args) throws IOException { System.out.println("* vCPUs: " + fetchedMachineType.getVcpus()); System.out.println("* Extra specs: " + fetchedMachineType.getExtraSpecs()); - /* - * create a server - * - * NOTE: see the following link for available machine types - * https://docs.stackit.cloud/products/compute-engine/server/basics/machine-types/ - * - * */ - Server newServer = - iaasApi.createServer( - projectId, - new CreateServerPayload() - .name("java-sdk-example-server-01") - .machineType("t2i.1") - .imageId(imageId) - .labels(Collections.singletonMap("foo", "bar")) - // add the keypair we created above - .keypairName(newKeypair.getName()) - // add the server to the network we created above - .networking( - new CreateServerPayloadNetworking( - new CreateServerNetworking() - .networkId( - newNetwork.getNetworkId())))); - assert newServer.getId() != null; - - /* wait for the server creation to complete */ - UUID serverId = newServer.getId(); - assert serverId != null; - while (Objects.equals( - iaasApi.getServer(projectId, serverId, false).getStatus(), "CREATING")) { - System.out.println("Waiting for server creation to complete ..."); - TimeUnit.SECONDS.sleep(5); - } + UUID serverId = null; + try { + + /* + * create a server + * + * NOTE: see the following link for available machine types + * https://docs.stackit.cloud/products/compute-engine/server/basics/machine-types/ + * + * */ + Server newServer = + iaasApi.createServer( + projectId, + REGION, + new CreateServerPayload() + .name("java-sdk-example-server-01") + .machineType("t2i.1") + .bootVolume( + new BootVolume() + .deleteOnTermination(true) + .size(32L) + .source( + new BootVolumeSource() + .id(imageId) + .type("image"))) + .labels(Collections.singletonMap("foo", "bar")) + // add the keypair we created above + .keypairName(newKeypair.getName()) + // add the server to the network we created above + .networking( + new CreateServerPayloadAllOfNetworking( + new CreateServerNetworking() + .networkId(newNetwork.getId())))); + Objects.requireNonNull(newServer.getId()); + + /* wait for the server creation to complete */ + serverId = newServer.getId(); + Objects.requireNonNull(serverId); + while (Objects.equals( + iaasApi.getServer(projectId, REGION, serverId, false).getStatus(), + "CREATING")) { + System.out.println("Waiting for server creation to complete ..."); + TimeUnit.SECONDS.sleep(5); + } - /* update the server we just created */ - iaasApi.updateServer( - projectId, - newServer.getId(), - new UpdateServerPayload() - .labels(Collections.singletonMap("foo", "bar-updated"))); - - /* list all servers */ - ServerListResponse servers = iaasApi.listServers(projectId, false, null); - System.out.println("\nAvailable servers: "); - for (Server server : servers.getItems()) { - System.out.println("* " + server.getId() + " | " + server.getName()); - } + /* update the server we just created */ + iaasApi.updateServer( + projectId, + REGION, + newServer.getId(), + new UpdateServerPayload() + .labels(Collections.singletonMap("foo", "bar-updated"))); + + /* list all servers */ + ServerListResponse servers = iaasApi.listServers(projectId, REGION, false, null); + System.out.println("\nAvailable servers: "); + for (Server server : servers.getItems()) { + System.out.println("* " + server.getId() + " | " + server.getName()); + } - /* fetch the server we just created */ - Server fetchedServer = iaasApi.getServer(projectId, serverId, false); - System.out.println("\nFetched server:"); - System.out.println("* Name: " + fetchedServer.getName()); - System.out.println("* Id: " + fetchedServer.getId()); - if (fetchedServer.getLabels() != null) { - System.out.println("* Labels: " + fetchedServer.getLabels().toString()); - } - System.out.println("* Machine type: " + fetchedServer.getMachineType()); - System.out.println("* Created at: " + fetchedServer.getCreatedAt()); - System.out.println("* Updated at: " + fetchedServer.getUpdatedAt()); - System.out.println("* Launched at: " + fetchedServer.getLaunchedAt()); - - /* stop the server we just created */ - iaasApi.stopServer(projectId, serverId); - /* wait for the server to stop */ - while (!Objects.equals( - iaasApi.getServer(projectId, serverId, false).getPowerStatus(), "STOPPED")) { - System.out.println("Waiting for server " + serverId + " to stop..."); - TimeUnit.SECONDS.sleep(5); - } + /* fetch the server we just created */ + Server fetchedServer = iaasApi.getServer(projectId, REGION, serverId, false); + System.out.println("\nFetched server:"); + System.out.println("* Name: " + fetchedServer.getName()); + System.out.println("* Id: " + fetchedServer.getId()); + if (fetchedServer.getLabels() != null) { + System.out.println("* Labels: " + fetchedServer.getLabels().toString()); + } + System.out.println("* Machine type: " + fetchedServer.getMachineType()); + System.out.println("* Created at: " + fetchedServer.getCreatedAt()); + System.out.println("* Updated at: " + fetchedServer.getUpdatedAt()); + System.out.println("* Launched at: " + fetchedServer.getLaunchedAt()); + + /* stop the server we just created */ + iaasApi.stopServer(projectId, REGION, serverId); + /* wait for the server to stop */ + while (!Objects.equals( + iaasApi.getServer(projectId, REGION, serverId, false).getPowerStatus(), + "STOPPED")) { + System.out.println("Waiting for server " + serverId + " to stop..."); + TimeUnit.SECONDS.sleep(5); + } - /* boot the server we just created */ - iaasApi.startServer(projectId, serverId); - /* wait for the server to boot */ - while (!Objects.equals( - iaasApi.getServer(projectId, serverId, false).getPowerStatus(), "RUNNING")) { - System.out.println("Waiting for server " + serverId + " to boot..."); - TimeUnit.SECONDS.sleep(5); - } + /* boot the server we just created */ + iaasApi.startServer(projectId, REGION, serverId); + /* wait for the server to boot */ + while (!Objects.equals( + iaasApi.getServer(projectId, REGION, serverId, false).getPowerStatus(), + "RUNNING")) { + System.out.println("Waiting for server " + serverId + " to boot..."); + TimeUnit.SECONDS.sleep(5); + } - /* reboot the server we just created */ - iaasApi.rebootServer(projectId, serverId, null); + /* reboot the server we just created */ + iaasApi.rebootServer(projectId, REGION, serverId, null); + } catch (ApiException e) { + System.out.println("server creation failed" + e); + } /* * /////////////////////////////////////////////////////// * // D E L E T I O N // @@ -266,13 +288,15 @@ public static void main(String[] args) throws IOException { * */ /* delete the server we just created */ - iaasApi.deleteServer(projectId, serverId); - System.out.println("Deleted server: " + serverId); + if (serverId != null) { + iaasApi.deleteServer(projectId, REGION, serverId); + System.out.println("Deleted server: " + serverId); + } /* wait for server deletion to complete */ while (true) { try { - iaasApi.getServer(projectId, serverId, false); + iaasApi.getServer(projectId, REGION, serverId, false); System.out.println("Waiting for server deletion to complete..."); TimeUnit.SECONDS.sleep(5); } catch (ApiException e) { @@ -287,8 +311,8 @@ public static void main(String[] args) throws IOException { System.out.println("Deleted key pair: " + newKeypair.getName()); /* delete the network we just created */ - iaasApi.deleteNetwork(projectId, newNetwork.getNetworkId()); - System.out.println("Deleted network: " + newNetwork.getNetworkId()); + iaasApi.deleteNetwork(projectId, REGION, newNetwork.getId()); + System.out.println("Deleted network: " + newNetwork.getId()); } catch (ApiException | InterruptedException e) { throw new RuntimeException(e); diff --git a/examples/serverbackup/src/main/java/cloud/stackit/sdk/serverbackup/examples/ServerbackupExample.java b/examples/serverbackup/src/main/java/cloud/stackit/sdk/serverbackup/examples/ServerbackupExample.java index 5bdefa25..03e1db49 100644 --- a/examples/serverbackup/src/main/java/cloud/stackit/sdk/serverbackup/examples/ServerbackupExample.java +++ b/examples/serverbackup/src/main/java/cloud/stackit/sdk/serverbackup/examples/ServerbackupExample.java @@ -47,7 +47,7 @@ public static void main(String[] args) throws IOException { UUID serverId = UUID.fromString(serverIdString); try { - Server server = iaasApi.getServer(projectId, serverId, true); + Server server = iaasApi.getServer(projectId, REGION, serverId, true); assert server.getId() != null; assert server.getVolumes() != null; From 5a3258111808148bd94e5cb29721379c1c2f1d8c Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Wed, 11 Mar 2026 15:17:06 +0100 Subject: [PATCH 3/4] add changelog --- CHANGELOG.md | 69 +++++++++++++++++++++++++++++++++++ services/iaas/CHANGELOG.md | 74 ++++++++++++++++++++++++++++++++++++++ services/iaas/VERSION | 2 +- 3 files changed, 144 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4634a294..de8c3082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,75 @@ - **Breaking change:** The `name` and `spaceHardLimitGigabytes` fields are now marked as required for `ShareExportPayload`, `SharePayload`. - [v0.1.0](services/sfs/CHANGELOG.md#v010) - Initial onboarding of STACKIT Java SDK for STACKIT File Storage (SFS) service +- `iaas`: [v1.0.0](services/iaas/CHANGELOG.md#v100) + - **Breaking Change:** Add required `region` parameter to most API methods in `DefaultApi` class. + - **Breaking Change:** Removal of API methods from `DefaultApi` class: `list_snapshots`, `update_image_scope_local`, `update_image_scope_public`. + - **Feature:** Add new API methods to `DefaultApi` class: + - `addRoutesToRoutingTable` + - `addRoutingTableToAreaPayload` + - `createNetworkAreaRegion` + - `deleteNetworkAreaRegion` + - `deleteRouteFromRoutingTable` + - `deleteRoutingTableFromArea` + - `getNetworkAreaRegion` + - `getRouteOfRoutingTable` + - `getRoutingTableOfArea` + - `imageFromVolume` + - `listNetworkAreaRegions` + - `listRoutesOfRoutingTable` + - `listRoutingTablesOfArea` + - `listSnapshotsInProject` + - `updateNetworkAreaRegion` + - `updateRouteOfRoutingTable` + - `updateRoutingTableOfArea` + - **Feature:** New model classes + - Network area: + - `RegionalArea`, `RegionalAreaListResponse` + - `CreateNetworkAreaRegionPayload` + - `RegionalAreaIPv4`, `UpdateRegionalAreaIPv4` + - Routing tables: + - `RoutingTable`, `RoutingTableListResponse` + - `AddRoutesToRoutingTablePayload` + - `AddRoutingTableToAreaPayload` + - `UpdateRouteOfRoutingTablePayload`, `UpdateRoutingTableOfAreaPayload` + - Routes: + - `RouteDestination`, `DestinationCIDRv4`, `DestinationCIDRv6` + - `RouteNexthop`, `NexthopInternet`, `NexthopIPv4`, `NexthopIPv6`, `NexthopBlackhole` + - Network (IPv4): `NetworkIPv4`, `CreateNetworkIPv4`, `CreateNetworkIPv4WithPrefix`, `CreateNetworkIPv4WithPrefixLength` + - Network (IPv6): `NetworkIPv6`, `CreateNetworkIPv6`, `CreateNetworkIPv6WithPrefix`, `CreateNetworkIPv6WithPrefixLength` + - other: `CreateServerPayloadAllOfNetworking`, `ImageFromVolumePayload`, `UpdateNetworkAreaRegionPayload`, `ServerNetworking` + - **Feature:** New attributes in model classes + - Add `region` attribute to `PublicNetwork` model class + - Add `destination` attribute to `Route` model class + - Add `import_progress` attribute to model classes `CreateImagePayload`, `Image` + - Add `encrypted` attribute to model class `Backup` + - Add `ipv4`, `ipv6`, `routing_table_id` attributes to model class `CreateNetworkPayload`, `PartialUpdateNetworkPayload` + - Add `ipv4`, `ipv6` `routing_table_id` attributes to model class `Network` + - Add `items` attribute to `CreateNetworkAreaRoutePayload` model class + - **Breaking Change:**: Removal of model classes + - Network area: `Area`, `AreaConfig`, `CreateAreaAddressFamily`, `UpdateAreaAddressFamily`, `AreaPrefixConfigIPv4`, `CreateAreaIPv4`, `UpdateAreaIPv4` + - Server: `CreateServerPayloadNetworking` + - Network: `CreateNetworkIPv4Body`, `NetworkAreaIPv4`, `CreateNetworkAddressFamily`, `UpdateNetworkAddressFamily`, `CreateNetworkIPv6Body` + - **Breaking Change:** Renaming of ID attributes in model classes + - Renaming of attribute `network_range_id` to `id` in `NetworkRange` model class + - Renaming of attribute `route_id` to `id` in `Route` model class + - Renaming of attribute `network_id` to `id` in `Network` model class + - Renaming of attribute `area_id` to `id` in `NetworkArea` model class + - Renaming of attribute `project_id` to `id` in `Project` model class + - **Breaking Change:** Renaming of `state` attribute to `status` in model classes `Network`, `NetworkArea`, `Project` + - **Breaking Change:** Type changes of attributes of model classes + - Change type of `networking` attribute from `CreateServerPayloadNetworking` to `ServerNetworking` in `Server` model class + - Change type of `networking` attribute from `CreateServerPayloadNetworking` to `CreateServerPayloadAllOfNetworking` in `CreateServerPayload` model class + - Change type of `nexthop` attribute from string to `RouteNexthop` in `Route` model class + - **Breaking Change:** + - Remove attribute `prefix` from `Route` model class + - Remove attribute `ipv4` from `NetworkArea`, `CreateNetworkAreaRoutePayload` model classes + - Remove attribute `address_family` from `CreateNetworkAreaPayload`, `CreateNetworkPayload`, `PartialUpdateNetworkAreaPayload`, `PartialUpdateNetworkPayload` model classes + - Remove attributes `gateway`, `gatewayv6`, `nameservers`, `nameservers_v6`, `prefixes`, `prefixes_v6`, `public_ip` from `Network` model class + - Remove attribute `openstack_project_id` from `Project` model class + - **Feature:** Add `CreateIsolatedNetwork` functionality + - **Feature:** Add `ImageFromVolumePayload` functionality + - **Feature:** Add `SystemRoutes` to `UpdateRoutingTableOfAreaPayload` ## Release (2026-01-27) - `core`: [v0.4.1](core/CHANGELOG.md/#v041) diff --git a/services/iaas/CHANGELOG.md b/services/iaas/CHANGELOG.md index 0ddc8c75..582a2fa7 100644 --- a/services/iaas/CHANGELOG.md +++ b/services/iaas/CHANGELOG.md @@ -1,3 +1,77 @@ +## v1.0.0 +- **Breaking Change:** Add required `region` parameter to most API methods in `DefaultApi` class. +- **Breaking Change:** Removal of API methods from `DefaultApi` class: `list_snapshots`, `update_image_scope_local`, `update_image_scope_public`. +- **Feature:** Add new API methods to `DefaultApi` class: + - `addRoutesToRoutingTable` + - `addRoutingTableToAreaPayload` + - `createNetworkAreaRegion` + - `deleteNetworkAreaRegion` + - `deleteRouteFromRoutingTable` + - `deleteRoutingTableFromArea` + - `getNetworkAreaRegion` + - `getRouteOfRoutingTable` + - `getRoutingTableOfArea` + - `imageFromVolume` + - `listNetworkAreaRegions` + - `listRoutesOfRoutingTable` + - `listRoutingTablesOfArea` + - `listSnapshotsInProject` + - `updateNetworkAreaRegion` + - `updateRouteOfRoutingTable` + - `updateRoutingTableOfArea` +- Update of regex validators for model class attributes + - Update regex validators for `ip` attribute in `PublicIp`, `UpdatePublicIPPayload`, `CreatePublicIPPayload` model classes + - Update regex validators for `gateway` attribute in `UpdateNetworkIPv4Body`, `UpdateNetworkIPv6Body` model classes +- **Feature:** New model classes + - Network area: + - `RegionalArea`, `RegionalAreaListResponse` + - `CreateNetworkAreaRegionPayload` + - `RegionalAreaIPv4`, `UpdateRegionalAreaIPv4` + - Routing tables: + - `RoutingTable`, `RoutingTableListResponse` + - `AddRoutesToRoutingTablePayload` + - `AddRoutingTableToAreaPayload` + - `UpdateRouteOfRoutingTablePayload`, `UpdateRoutingTableOfAreaPayload` + - Routes: + - `RouteDestination`, `DestinationCIDRv4`, `DestinationCIDRv6` + - `RouteNexthop`, `NexthopInternet`, `NexthopIPv4`, `NexthopIPv6`, `NexthopBlackhole` + - Network (IPv4): `NetworkIPv4`, `CreateNetworkIPv4`, `CreateNetworkIPv4WithPrefix`, `CreateNetworkIPv4WithPrefixLength` + - Network (IPv6): `NetworkIPv6`, `CreateNetworkIPv6`, `CreateNetworkIPv6WithPrefix`, `CreateNetworkIPv6WithPrefixLength` + - other: `CreateServerPayloadAllOfNetworking`, `ImageFromVolumePayload`, `UpdateNetworkAreaRegionPayload`, `ServerNetworking` +- **Feature:** New attributes in model classes + - Add `region` attribute to `PublicNetwork` model class + - Add `destination` attribute to `Route` model class + - Add `import_progress` attribute to model classes `CreateImagePayload`, `Image` + - Add `encrypted` attribute to model class `Backup` + - Add `ipv4`, `ipv6`, `routing_table_id` attributes to model class `CreateNetworkPayload`, `PartialUpdateNetworkPayload` + - Add `ipv4`, `ipv6` `routing_table_id` attributes to model class `Network` + - Add `items` attribute to `CreateNetworkAreaRoutePayload` model class +- **Breaking Change:**: Removal of model classes + - Network area: `Area`, `AreaConfig`, `CreateAreaAddressFamily`, `UpdateAreaAddressFamily`, `AreaPrefixConfigIPv4`, `CreateAreaIPv4`, `UpdateAreaIPv4` + - Server: `CreateServerPayloadNetworking` + - Network: `CreateNetworkIPv4Body`, `NetworkAreaIPv4`, `CreateNetworkAddressFamily`, `UpdateNetworkAddressFamily`, `CreateNetworkIPv6Body` +- **Breaking Change:** Renaming of ID attributes in model classes + - Renaming of attribute `network_range_id` to `id` in `NetworkRange` model class + - Renaming of attribute `route_id` to `id` in `Route` model class + - Renaming of attribute `network_id` to `id` in `Network` model class + - Renaming of attribute `area_id` to `id` in `NetworkArea` model class + - Renaming of attribute `project_id` to `id` in `Project` model class +- **Breaking Change:** Renaming of `state` attribute to `status` in model classes `Network`, `NetworkArea`, `Project` +- **Breaking Change:** Type changes of attributes of model classes + - Change type of `networking` attribute from `CreateServerPayloadNetworking` to `ServerNetworking` in `Server` model class + - Change type of `networking` attribute from `CreateServerPayloadNetworking` to `CreateServerPayloadAllOfNetworking` in `CreateServerPayload` model class + - Change type of `nexthop` attribute from string to `RouteNexthop` in `Route` model class +- **Breaking Change:** + - Remove attribute `prefix` from `Route` model class + - Remove attribute `ipv4` from `NetworkArea`, `CreateNetworkAreaRoutePayload` model classes + - Remove attribute `address_family` from `CreateNetworkAreaPayload`, `CreateNetworkPayload`, `PartialUpdateNetworkAreaPayload`, `PartialUpdateNetworkPayload` model classes + - Remove attributes `gateway`, `gatewayv6`, `nameservers`, `nameservers_v6`, `prefixes`, `prefixes_v6`, `public_ip` from `Network` model class + - Remove attribute `openstack_project_id` from `Project` model class +- **Feature:** Add `CreateIsolatedNetwork` functionality +- **Feature:** Add `ImageFromVolumePayload` functionality +- **Feature:** Add `SystemRoutes` to `UpdateRoutingTableOfAreaPayload` + + ## v0.3.1 - Bump dependency `cloud.stackit.sdk.core` to v0.4.1 diff --git a/services/iaas/VERSION b/services/iaas/VERSION index 9e11b32f..3eefcb9d 100644 --- a/services/iaas/VERSION +++ b/services/iaas/VERSION @@ -1 +1 @@ -0.3.1 +1.0.0 From 233d678973c583d9bcd911cf4dbc96fa412ea5a0 Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Thu, 12 Mar 2026 10:23:24 +0100 Subject: [PATCH 4/4] review feedback --- CHANGELOG.md | 25 +++++++++++++++---------- services/iaas/CHANGELOG.md | 22 ++++++++++++---------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de8c3082..d067d6f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,7 +50,7 @@ - Initial onboarding of STACKIT Java SDK for STACKIT File Storage (SFS) service - `iaas`: [v1.0.0](services/iaas/CHANGELOG.md#v100) - **Breaking Change:** Add required `region` parameter to most API methods in `DefaultApi` class. - - **Breaking Change:** Removal of API methods from `DefaultApi` class: `list_snapshots`, `update_image_scope_local`, `update_image_scope_public`. + - **Breaking Change:** Removal of API methods from `DefaultApi` class: `listSnapshots`, `updateImageScopeLocal`, `updateImageScopePublic`. - **Feature:** Add new API methods to `DefaultApi` class: - `addRoutesToRoutingTable` - `addRoutingTableToAreaPayload` @@ -69,6 +69,9 @@ - `updateNetworkAreaRegion` - `updateRouteOfRoutingTable` - `updateRoutingTableOfArea` + - Update of regex validators for model class attributes + - Update regex validators for `ip` attribute in `PublicIp`, `UpdatePublicIPPayload`, `CreatePublicIPPayload` model classes + - Update regex validators for `gateway` attribute in `UpdateNetworkIPv4Body`, `UpdateNetworkIPv6Body` model classes - **Feature:** New model classes - Network area: - `RegionalArea`, `RegionalAreaListResponse` @@ -88,21 +91,21 @@ - **Feature:** New attributes in model classes - Add `region` attribute to `PublicNetwork` model class - Add `destination` attribute to `Route` model class - - Add `import_progress` attribute to model classes `CreateImagePayload`, `Image` + - Add `importProgress` attribute to model classes `CreateImagePayload`, `Image` - Add `encrypted` attribute to model class `Backup` - - Add `ipv4`, `ipv6`, `routing_table_id` attributes to model class `CreateNetworkPayload`, `PartialUpdateNetworkPayload` - - Add `ipv4`, `ipv6` `routing_table_id` attributes to model class `Network` + - Add `ipv4`, `ipv6`, `routingTableId` attributes to model class `CreateNetworkPayload`, `PartialUpdateNetworkPayload` + - Add `ipv4`, `ipv6` `routingTableId` attributes to model class `Network` - Add `items` attribute to `CreateNetworkAreaRoutePayload` model class - **Breaking Change:**: Removal of model classes - Network area: `Area`, `AreaConfig`, `CreateAreaAddressFamily`, `UpdateAreaAddressFamily`, `AreaPrefixConfigIPv4`, `CreateAreaIPv4`, `UpdateAreaIPv4` - Server: `CreateServerPayloadNetworking` - Network: `CreateNetworkIPv4Body`, `NetworkAreaIPv4`, `CreateNetworkAddressFamily`, `UpdateNetworkAddressFamily`, `CreateNetworkIPv6Body` - **Breaking Change:** Renaming of ID attributes in model classes - - Renaming of attribute `network_range_id` to `id` in `NetworkRange` model class - - Renaming of attribute `route_id` to `id` in `Route` model class - - Renaming of attribute `network_id` to `id` in `Network` model class - - Renaming of attribute `area_id` to `id` in `NetworkArea` model class - - Renaming of attribute `project_id` to `id` in `Project` model class + - Renaming of attribute `networkRangeId` to `id` in `NetworkRange` model class + - Renaming of attribute `routeId` to `id` in `Route` model class + - Renaming of attribute `networkId` to `id` in `Network` model class + - Renaming of attribute `areaId` to `id` in `NetworkArea` model class + - Renaming of attribute `projectId` to `id` in `Project` model class - **Breaking Change:** Renaming of `state` attribute to `status` in model classes `Network`, `NetworkArea`, `Project` - **Breaking Change:** Type changes of attributes of model classes - Change type of `networking` attribute from `CreateServerPayloadNetworking` to `ServerNetworking` in `Server` model class @@ -112,11 +115,13 @@ - Remove attribute `prefix` from `Route` model class - Remove attribute `ipv4` from `NetworkArea`, `CreateNetworkAreaRoutePayload` model classes - Remove attribute `address_family` from `CreateNetworkAreaPayload`, `CreateNetworkPayload`, `PartialUpdateNetworkAreaPayload`, `PartialUpdateNetworkPayload` model classes - - Remove attributes `gateway`, `gatewayv6`, `nameservers`, `nameservers_v6`, `prefixes`, `prefixes_v6`, `public_ip` from `Network` model class + - Remove attributes `gateway`, `gatewayv6`, `nameservers`, `nameserversV6`, `prefixes`, `prefixesV6`, `publicIp` from `Network` model class - Remove attribute `openstack_project_id` from `Project` model class - **Feature:** Add `CreateIsolatedNetwork` functionality - **Feature:** Add `ImageFromVolumePayload` functionality - **Feature:** Add `SystemRoutes` to `UpdateRoutingTableOfAreaPayload` + - **Improvement:** Support additionalProperties in models + - This allows accessing new properties, even if they aren't yet defined in the model ## Release (2026-01-27) - `core`: [v0.4.1](core/CHANGELOG.md/#v041) diff --git a/services/iaas/CHANGELOG.md b/services/iaas/CHANGELOG.md index 582a2fa7..49698de5 100644 --- a/services/iaas/CHANGELOG.md +++ b/services/iaas/CHANGELOG.md @@ -1,6 +1,6 @@ ## v1.0.0 - **Breaking Change:** Add required `region` parameter to most API methods in `DefaultApi` class. -- **Breaking Change:** Removal of API methods from `DefaultApi` class: `list_snapshots`, `update_image_scope_local`, `update_image_scope_public`. +- **Breaking Change:** Removal of API methods from `DefaultApi` class: `listSnapshots`, `updateImageScopeLocal`, `updateImageScopePublic`. - **Feature:** Add new API methods to `DefaultApi` class: - `addRoutesToRoutingTable` - `addRoutingTableToAreaPayload` @@ -41,21 +41,21 @@ - **Feature:** New attributes in model classes - Add `region` attribute to `PublicNetwork` model class - Add `destination` attribute to `Route` model class - - Add `import_progress` attribute to model classes `CreateImagePayload`, `Image` + - Add `importProgress` attribute to model classes `CreateImagePayload`, `Image` - Add `encrypted` attribute to model class `Backup` - - Add `ipv4`, `ipv6`, `routing_table_id` attributes to model class `CreateNetworkPayload`, `PartialUpdateNetworkPayload` - - Add `ipv4`, `ipv6` `routing_table_id` attributes to model class `Network` + - Add `ipv4`, `ipv6`, `routingTableId` attributes to model class `CreateNetworkPayload`, `PartialUpdateNetworkPayload` + - Add `ipv4`, `ipv6` `routingTableId` attributes to model class `Network` - Add `items` attribute to `CreateNetworkAreaRoutePayload` model class - **Breaking Change:**: Removal of model classes - Network area: `Area`, `AreaConfig`, `CreateAreaAddressFamily`, `UpdateAreaAddressFamily`, `AreaPrefixConfigIPv4`, `CreateAreaIPv4`, `UpdateAreaIPv4` - Server: `CreateServerPayloadNetworking` - Network: `CreateNetworkIPv4Body`, `NetworkAreaIPv4`, `CreateNetworkAddressFamily`, `UpdateNetworkAddressFamily`, `CreateNetworkIPv6Body` - **Breaking Change:** Renaming of ID attributes in model classes - - Renaming of attribute `network_range_id` to `id` in `NetworkRange` model class - - Renaming of attribute `route_id` to `id` in `Route` model class - - Renaming of attribute `network_id` to `id` in `Network` model class - - Renaming of attribute `area_id` to `id` in `NetworkArea` model class - - Renaming of attribute `project_id` to `id` in `Project` model class + - Renaming of attribute `networkRangeId` to `id` in `NetworkRange` model class + - Renaming of attribute `routeId` to `id` in `Route` model class + - Renaming of attribute `networkId` to `id` in `Network` model class + - Renaming of attribute `areaId` to `id` in `NetworkArea` model class + - Renaming of attribute `projectId` to `id` in `Project` model class - **Breaking Change:** Renaming of `state` attribute to `status` in model classes `Network`, `NetworkArea`, `Project` - **Breaking Change:** Type changes of attributes of model classes - Change type of `networking` attribute from `CreateServerPayloadNetworking` to `ServerNetworking` in `Server` model class @@ -65,11 +65,13 @@ - Remove attribute `prefix` from `Route` model class - Remove attribute `ipv4` from `NetworkArea`, `CreateNetworkAreaRoutePayload` model classes - Remove attribute `address_family` from `CreateNetworkAreaPayload`, `CreateNetworkPayload`, `PartialUpdateNetworkAreaPayload`, `PartialUpdateNetworkPayload` model classes - - Remove attributes `gateway`, `gatewayv6`, `nameservers`, `nameservers_v6`, `prefixes`, `prefixes_v6`, `public_ip` from `Network` model class + - Remove attributes `gateway`, `gatewayv6`, `nameservers`, `nameserversV6`, `prefixes`, `prefixesV6`, `publicIp` from `Network` model class - Remove attribute `openstack_project_id` from `Project` model class - **Feature:** Add `CreateIsolatedNetwork` functionality - **Feature:** Add `ImageFromVolumePayload` functionality - **Feature:** Add `SystemRoutes` to `UpdateRoutingTableOfAreaPayload` +- **Improvement:** Support additionalProperties in models + - This allows accessing new properties, even if they aren't yet defined in the model ## v0.3.1