From 29adc1030147d4cedf25938cae1200dce08f98d6 Mon Sep 17 00:00:00 2001 From: Ruben Hoenle Date: Mon, 4 Aug 2025 12:29:04 +0200 Subject: [PATCH 1/4] feat(iaas): initial onboarding relates to STACKITSDK-209 --- build.gradle | 28 +- examples/iaas/build.gradle | 5 + examples/iaas/settings.gradle | 1 + .../sdk/iaas/examples/IaaSExample.java | 267 + services/iaas/README.md | 114 + services/iaas/build.gradle | 19 + services/iaas/settings.gradle | 1 + .../cloud/stackit/sdk/iaas/ApiCallback.java | 60 + .../cloud/stackit/sdk/iaas/ApiClient.java | 1512 + .../cloud/stackit/sdk/iaas/ApiResponse.java | 73 + .../sdk/iaas/GzipRequestInterceptor.java | 87 + .../java/cloud/stackit/sdk/iaas/JSON.java | 701 + .../java/cloud/stackit/sdk/iaas/Pair.java | 58 + .../stackit/sdk/iaas/ProgressRequestBody.java | 71 + .../sdk/iaas/ProgressResponseBody.java | 68 + .../stackit/sdk/iaas/ServerConfiguration.java | 79 + .../stackit/sdk/iaas/ServerVariable.java | 37 + .../cloud/stackit/sdk/iaas/StringUtil.java | 83 + .../stackit/sdk/iaas/api/DefaultApi.java | 24757 ++++++++++++++++ .../cloud/stackit/sdk/iaas/api/IaasApi.java | 14 + .../sdk/iaas/model/AbstractOpenApiSchema.java | 145 + .../iaas/model/AddVolumeToServerPayload.java | 248 + .../stackit/sdk/iaas/model/AffinityGroup.java | 302 + .../iaas/model/AffinityGroupListResponse.java | 227 + .../sdk/iaas/model/AllowedAddressesInner.java | 229 + .../cloud/stackit/sdk/iaas/model/Area.java | 350 + .../stackit/sdk/iaas/model/AreaConfig.java | 361 + .../cloud/stackit/sdk/iaas/model/AreaId.java | 268 + .../sdk/iaas/model/AreaPrefixConfigIPv4.java | 242 + .../model/AvailabilityZoneListResponse.java | 226 + .../cloud/stackit/sdk/iaas/model/Backup.java | 432 + .../sdk/iaas/model/BackupListResponse.java | 226 + .../stackit/sdk/iaas/model/BackupSource.java | 240 + .../sdk/iaas/model/BaseSecurityGroupRule.java | 474 + .../stackit/sdk/iaas/model/BootVolume.java | 309 + .../sdk/iaas/model/BootVolumeSource.java | 241 + .../model/CreateAffinityGroupPayload.java | 304 + .../iaas/model/CreateAreaAddressFamily.java | 194 + .../sdk/iaas/model/CreateAreaIPv4.java | 447 + .../sdk/iaas/model/CreateBackupPayload.java | 263 + .../sdk/iaas/model/CreateImagePayload.java | 622 + .../sdk/iaas/model/CreateKeyPairPayload.java | 340 + .../model/CreateNetworkAddressFamily.java | 223 + .../iaas/model/CreateNetworkAreaPayload.java | 266 + .../model/CreateNetworkAreaRangePayload.java | 224 + .../model/CreateNetworkAreaRoutePayload.java | 224 + .../sdk/iaas/model/CreateNetworkIPv4Body.java | 317 + .../sdk/iaas/model/CreateNetworkIPv6Body.java | 317 + .../sdk/iaas/model/CreateNetworkPayload.java | 318 + .../sdk/iaas/model/CreateNicPayload.java | 591 + .../sdk/iaas/model/CreateProtocol.java | 290 + .../sdk/iaas/model/CreatePublicIPPayload.java | 297 + .../model/CreateSecurityGroupPayload.java | 409 + .../model/CreateSecurityGroupRulePayload.java | 517 + .../CreateSecurityGroupRuleProtocol.java | 200 + .../iaas/model/CreateServerNetworking.java | 197 + .../model/CreateServerNetworkingWithNics.java | 215 + .../sdk/iaas/model/CreateServerPayload.java | 924 + .../model/CreateServerPayloadNetworking.java | 293 + .../sdk/iaas/model/CreateSnapshotPayload.java | 385 + .../sdk/iaas/model/CreateVolumePayload.java | 646 + .../cloud/stackit/sdk/iaas/model/Error.java | 232 + .../iaas/model/GetServerLog200Response.java | 197 + .../sdk/iaas/model/ICMPParameters.java | 227 + .../cloud/stackit/sdk/iaas/model/Image.java | 621 + .../stackit/sdk/iaas/model/ImageAgent.java | 216 + .../stackit/sdk/iaas/model/ImageChecksum.java | 240 + .../stackit/sdk/iaas/model/ImageConfig.java | 648 + .../sdk/iaas/model/ImageCreateResponse.java | 242 + .../sdk/iaas/model/ImageListResponse.java | 226 + .../stackit/sdk/iaas/model/ImageShare.java | 237 + .../sdk/iaas/model/ImageShareConsumer.java | 261 + .../sdk/iaas/model/KeyPairListResponse.java | 226 + .../cloud/stackit/sdk/iaas/model/Keypair.java | 338 + .../stackit/sdk/iaas/model/MachineType.java | 349 + .../iaas/model/MachineTypeListResponse.java | 227 + .../cloud/stackit/sdk/iaas/model/NIC.java | 589 + .../sdk/iaas/model/NICListResponse.java | 226 + .../cloud/stackit/sdk/iaas/model/Network.java | 709 + .../stackit/sdk/iaas/model/NetworkArea.java | 409 + .../sdk/iaas/model/NetworkAreaIPv4.java | 438 + .../iaas/model/NetworkAreaListResponse.java | 227 + .../sdk/iaas/model/NetworkListResponse.java | 226 + .../stackit/sdk/iaas/model/NetworkRange.java | 272 + .../iaas/model/NetworkRangeListResponse.java | 227 + .../PartialUpdateNetworkAreaPayload.java | 260 + .../model/PartialUpdateNetworkPayload.java | 309 + .../stackit/sdk/iaas/model/PortRange.java | 226 + .../cloud/stackit/sdk/iaas/model/Project.java | 372 + .../sdk/iaas/model/ProjectListResponse.java | 222 + .../stackit/sdk/iaas/model/Protocol.java | 225 + .../stackit/sdk/iaas/model/PublicIp.java | 295 + .../sdk/iaas/model/PublicIpListResponse.java | 226 + .../stackit/sdk/iaas/model/PublicNetwork.java | 206 + .../iaas/model/PublicNetworkListResponse.java | 227 + .../cloud/stackit/sdk/iaas/model/Quota.java | 226 + .../stackit/sdk/iaas/model/QuotaList.java | 563 + .../sdk/iaas/model/QuotaListResponse.java | 203 + .../cloud/stackit/sdk/iaas/model/Request.java | 410 + .../sdk/iaas/model/RequestResource.java | 279 + .../sdk/iaas/model/RescueServerPayload.java | 208 + .../sdk/iaas/model/ResizeServerPayload.java | 207 + .../sdk/iaas/model/ResizeVolumePayload.java | 201 + .../cloud/stackit/sdk/iaas/model/Route.java | 339 + .../sdk/iaas/model/RouteListResponse.java | 226 + .../stackit/sdk/iaas/model/SecurityGroup.java | 407 + .../iaas/model/SecurityGroupListResponse.java | 227 + .../sdk/iaas/model/SecurityGroupRule.java | 505 + .../model/SecurityGroupRuleListResponse.java | 233 + .../iaas/model/SecurityGroupRuleProtocol.java | 194 + .../cloud/stackit/sdk/iaas/model/Server.java | 919 + .../sdk/iaas/model/ServerConsoleUrl.java | 207 + .../sdk/iaas/model/ServerListResponse.java | 226 + .../sdk/iaas/model/ServerMaintenance.java | 295 + .../stackit/sdk/iaas/model/ServerNetwork.java | 552 + .../model/ServiceAccountMailListResponse.java | 227 + .../sdk/iaas/model/SetImageSharePayload.java | 239 + .../stackit/sdk/iaas/model/Snapshot.java | 384 + .../sdk/iaas/model/SnapshotListResponse.java | 226 + .../stackit/sdk/iaas/model/StaticAreaID.java | 73 + .../iaas/model/UpdateAreaAddressFamily.java | 194 + .../sdk/iaas/model/UpdateAreaIPv4.java | 291 + .../model/UpdateAttachedVolumePayload.java | 249 + .../sdk/iaas/model/UpdateBackupPayload.java | 433 + .../sdk/iaas/model/UpdateImagePayload.java | 401 + .../iaas/model/UpdateImageSharePayload.java | 240 + .../sdk/iaas/model/UpdateKeyPairPayload.java | 192 + .../model/UpdateNetworkAddressFamily.java | 223 + .../model/UpdateNetworkAreaRoutePayload.java | 198 + .../sdk/iaas/model/UpdateNetworkIPv4Body.java | 258 + .../sdk/iaas/model/UpdateNetworkIPv6Body.java | 258 + .../sdk/iaas/model/UpdateNicPayload.java | 356 + .../sdk/iaas/model/UpdatePublicIPPayload.java | 297 + .../model/UpdateSecurityGroupPayload.java | 257 + .../sdk/iaas/model/UpdateServerPayload.java | 251 + .../sdk/iaas/model/UpdateSnapshotPayload.java | 224 + .../sdk/iaas/model/UpdateVolumePayload.java | 312 + .../cloud/stackit/sdk/iaas/model/Volume.java | 643 + .../sdk/iaas/model/VolumeAttachment.java | 246 + .../model/VolumeAttachmentListResponse.java | 232 + .../iaas/model/VolumeEncryptionParameter.java | 386 + .../sdk/iaas/model/VolumeListResponse.java | 226 + .../iaas/model/VolumePerformanceClass.java | 319 + .../VolumePerformanceClassListResponse.java | 235 + .../stackit/sdk/iaas/model/VolumeSource.java | 241 + services/resourcemanager/build.gradle | 1 - .../sdk/resourcemanager/api/DefaultApi.java | 3 +- .../api/ResourceManagerApi.java | 14 + 148 files changed, 66903 insertions(+), 9 deletions(-) create mode 100644 examples/iaas/build.gradle create mode 100644 examples/iaas/settings.gradle create mode 100644 examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSExample.java create mode 100644 services/iaas/README.md create mode 100644 services/iaas/build.gradle create mode 100644 services/iaas/settings.gradle create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiCallback.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiClient.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/GzipRequestInterceptor.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/JSON.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/Pair.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressRequestBody.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressResponseBody.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerConfiguration.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerVariable.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/StringUtil.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/DefaultApi.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/IaasApi.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AbstractOpenApiSchema.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddVolumeToServerPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroup.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroupListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AllowedAddressesInner.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Area.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaConfig.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaId.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaPrefixConfigIPv4.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AvailabilityZoneListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Backup.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupSource.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BaseSecurityGroupRule.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolume.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolumeSource.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAffinityGroupPayload.java create 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/CreateAreaIPv4.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateBackupPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateImagePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateKeyPairPayload.java create 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/CreateNetworkAreaPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRangePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRoutePayload.java create 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/CreateNetworkIPv6Body.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNicPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateProtocol.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreatePublicIPPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRulePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRuleProtocol.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworking.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworkingWithNics.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayloadNetworking.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSnapshotPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateVolumePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Error.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/GetServerLog200Response.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ICMPParameters.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Image.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageAgent.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageChecksum.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageConfig.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageCreateResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShare.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShareConsumer.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/KeyPairListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Keypair.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineType.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineTypeListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NIC.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NICListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Network.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkArea.java create 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/NetworkAreaListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRange.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRangeListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkAreaPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PortRange.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Project.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ProjectListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Protocol.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIp.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIpListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetwork.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetworkListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Quota.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaList.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Request.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RequestResource.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RescueServerPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeServerPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeVolumePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Route.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroup.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRule.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleProtocol.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Server.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerConsoleUrl.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerMaintenance.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerNetwork.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServiceAccountMailListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SetImageSharePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Snapshot.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SnapshotListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/StaticAreaID.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAreaAddressFamily.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAreaIPv4.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAttachedVolumePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateBackupPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImagePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImageSharePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateKeyPairPayload.java create 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/UpdateNetworkAreaRoutePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv4Body.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv6Body.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNicPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdatePublicIPPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSecurityGroupPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateServerPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSnapshotPayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateVolumePayload.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Volume.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachment.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachmentListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeEncryptionParameter.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClass.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClassListResponse.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeSource.java create mode 100644 services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/api/ResourceManagerApi.java diff --git a/build.gradle b/build.gradle index 4097515..76e3bcb 100644 --- a/build.gradle +++ b/build.gradle @@ -21,8 +21,10 @@ allprojects { ] } - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' @@ -63,7 +65,6 @@ subprojects { apply plugin: 'eclipse' group = 'cloud.stackit' - version = 'SNAPSHOT' afterEvaluate { project -> // only apply to service sub-projects and core @@ -75,10 +76,12 @@ subprojects { try { version = versionFile.text.trim() } catch (IOException e) { - logger.error("Could not read VERSION file for project '${project.name}': ${e.message}") + version = 'SNAPSHOT' + logger.error("Could not read VERSION file for project '${project.path}': ${e.message}") } } else { - logger.warn("VERSION file not found in project '${project.name}'. Skipping version setting.") + version = 'SNAPSHOT' + logger.warn("VERSION file not found in project '${project.path}'. Skipping version setting.") } @@ -121,8 +124,19 @@ subprojects { // only apply to example sub-projects if (project.path.startsWith(':examples:')) { - task execute(type:JavaExec) { - main = System.getProperty('mainClass') + if (!project.hasProperty('mainClassName')) { + logger.warn("'mainClassName' property not defined for subproject '${project.path}'. Skipping execution of this task.") + } + + tasks.register('execute', JavaExec) { + if (!project.hasProperty('mainClassName')) { + doLast { + logger.warn("'mainClassName' property not defined for subproject '${project.path}'. Skipping execution of this task.") + } + enabled = false // Disable the task if no main class is specified + return + } + mainClass = project.mainClassName classpath = sourceSets.main.runtimeClasspath } } diff --git a/examples/iaas/build.gradle b/examples/iaas/build.gradle new file mode 100644 index 0000000..4318a91 --- /dev/null +++ b/examples/iaas/build.gradle @@ -0,0 +1,5 @@ +dependencies { + implementation project (':services:iaas') +} + +ext.mainClassName = 'cloud.stackit.sdk.iaas.examples.IaaSExample' diff --git a/examples/iaas/settings.gradle b/examples/iaas/settings.gradle new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/examples/iaas/settings.gradle @@ -0,0 +1 @@ + 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 new file mode 100644 index 0000000..52d8b83 --- /dev/null +++ b/examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSExample.java @@ -0,0 +1,267 @@ +package cloud.stackit.sdk.iaas.examples; + +import cloud.stackit.sdk.core.exception.ApiException; +import cloud.stackit.sdk.iaas.api.IaasApi; +import cloud.stackit.sdk.iaas.model.*; +import java.io.IOException; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; +import java.util.concurrent.TimeUnit; + +public class IaaSExample { + public static void main(String[] args) throws IOException { + // Credentials are read from the credentialsFile in `~/.stackit/credentials.json` or the env + // STACKIT_SERVICE_ACCOUNT_KEY_PATH / STACKIT_SERVICE_ACCOUNT_KEY + IaasApi iaasApi = new IaasApi(); + + // the id of your STACKIT project, read from env var for this example + String projectIdString = System.getenv("STACKIT_PROJECT_ID"); + if (projectIdString == null || projectIdString.isEmpty()) { + System.err.println("Environment variable 'STACKIT_PROJECT_ID' not found."); + return; + } + UUID projectId = UUID.fromString(projectIdString); + + try { + /////////////////////////////////////////////////////// + // N E T W O R K S // + /////////////////////////////////////////////////////// + + /* create a network in the project */ + Network newNetwork = + iaasApi.createNetwork( + projectId, + new CreateNetworkPayload() + .name("java-sdk-example-network-01") + .dhcp(true) + .routed(false) + .labels(Map.ofEntries(Map.entry("foo", "bar"))) + .addressFamily( + new CreateNetworkAddressFamily() + .ipv4( + new CreateNetworkIPv4Body() + .addNameserversItem( + "8.8.8.8")))); + + /* update the network we just created */ + iaasApi.partialUpdateNetwork( + projectId, + newNetwork.getNetworkId(), + new PartialUpdateNetworkPayload() + .dhcp(false) + .labels(Map.ofEntries(Map.entry("foo", "bar-updated")))); + + /* fetch the network we just created */ + Network fetchedNetwork = iaasApi.getNetwork(projectId, newNetwork.getNetworkId()); + System.out.println("\nFetched network: "); + System.out.println("* Name: " + fetchedNetwork.getName()); + System.out.println("* Id: " + fetchedNetwork.getNetworkId()); + System.out.println( + "* DHCP: " + (Boolean.TRUE.equals(fetchedNetwork.getDhcp()) ? "YES" : "NO")); + System.out.println("* Gateway: " + fetchedNetwork.getGateway()); + System.out.println("* Public IP: " + fetchedNetwork.getPublicIp()); + + /* list all available networks in the project */ + NetworkListResponse networks = iaasApi.listNetworks(projectId, null); + System.out.println("\nAvailable networks: "); + for (Network network : networks.getItems()) { + System.out.println("* " + network.getName()); + } + + /////////////////////////////////////////////////////// + // I M A G E S // + /////////////////////////////////////////////////////// + + /* list all available images */ + ImageListResponse images = iaasApi.listImages(projectId, false, null); + System.out.println("\nAvailable images: "); + for (Image image : images.getItems()) { + System.out.println(image.getId() + " | " + image.getName()); + } + + /* get an image */ + UUID imageId = + images.getItems() + .getFirst() + .getId(); // we just use a random image id in our example + assert imageId != null; + Image fetchedImage = iaasApi.getImage(projectId, imageId); + System.out.println("\nFetched image:"); + System.out.println("* Name: " + fetchedImage.getName()); + System.out.println("* Id: " + fetchedImage.getId()); + System.out.println("* Checksum: " + fetchedImage.getChecksum()); + System.out.println("* Created at: " + fetchedImage.getCreatedAt()); + System.out.println("* Updated at: " + fetchedImage.getUpdatedAt()); + + /////////////////////////////////////////////////////// + // K E Y P A I R S // + /////////////////////////////////////////////////////// + + /* list all available keypairs */ + KeyPairListResponse keypairs = iaasApi.listKeyPairs(null); + System.out.println("\nAvailable keypairs: "); + for (Keypair keypair : keypairs.getItems()) { + System.out.println("* " + keypair.getName()); + } + + /* create a keypair */ + String publicKey = + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAcLPdv9r0P+PJWX7C2tdV/7vr8k+fbPcTkC6Z6yjclx"; + Keypair newKeypair = + iaasApi.createKeyPair( + new CreateKeyPairPayload() + .name("java-sdk-example-keypair-01") + .publicKey(publicKey)); + System.out.println("\nKeypair created: " + newKeypair.getName()); + + /* update the keypair */ + assert newKeypair.getName() != null; + iaasApi.updateKeyPair( + newKeypair.getName(), + new UpdateKeyPairPayload().labels(Map.ofEntries(Map.entry("foo", "bar")))); + + /* fetch the keypair we just created / updated */ + Keypair fetchedKeypair = iaasApi.getKeyPair(newKeypair.getName()); + System.out.println("\nFetched key pair: "); + System.out.println("* Name: " + fetchedKeypair.getName()); + if (fetchedKeypair.getLabels() != null) { + System.out.println("* Labels: " + fetchedKeypair.getLabels().toString()); + } + System.out.println("* Fingerprint: " + fetchedKeypair.getFingerprint()); + System.out.println("* Public key: " + fetchedKeypair.getPublicKey()); + + /////////////////////////////////////////////////////// + // S E R V E R S // + /////////////////////////////////////////////////////// + + /* list all available machine types */ + MachineTypeListResponse machineTypes = iaasApi.listMachineTypes(projectId, null); + System.out.println("\nAvailable machine types: "); + for (MachineType machineType : machineTypes.getItems()) { + System.out.println("* " + machineType.getName()); + } + + /* fetch details about a machine type */ + MachineType fetchedMachineType = + iaasApi.getMachineType(projectId, machineTypes.getItems().getFirst().getName()); + System.out.println("\nFetched machine type: "); + System.out.println("* Name: " + fetchedMachineType.getName()); + System.out.println("* Description: " + fetchedMachineType.getDescription()); + System.out.println("* Disk size: " + fetchedMachineType.getDisk()); + System.out.println("* RAM: " + fetchedMachineType.getRam()); + System.out.println("* vCPUs: " + fetchedMachineType.getVcpus()); + System.out.println("* Extra specs: " + fetchedMachineType.getExtraSpecs()); + + /* create a server */ + // NOTE: see https://docs.stackit.cloud/stackit/en/virtual-machine-flavors-75137231.html + // for available machine types + Server newServer = + iaasApi.createServer( + projectId, + new CreateServerPayload() + .name("java-sdk-example-server-01") + .machineType("t2i.1") + .imageId(imageId) + .labels(Map.ofEntries(Map.entry("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); + } + + /* update the server we just created */ + iaasApi.updateServer( + projectId, + newServer.getId(), + new UpdateServerPayload() + .labels(Map.ofEntries(Map.entry("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()); + } + + /* 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); + } + + /* 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); + } + + /* reboot the server we just created */ + iaasApi.rebootServer(projectId, serverId, null); + + /////////////////////////////////////////////////////// + // D E L E T I O N // + /////////////////////////////////////////////////////// + + /* delete the server we just created */ + iaasApi.deleteServer(projectId, serverId); + System.out.println("Deleted server: " + serverId); + + /* wait for server deletion to complete */ + while (true) { + try { + iaasApi.getServer(projectId, serverId, false); + System.out.println("Waiting for server deletion to complete..."); + TimeUnit.SECONDS.sleep(5); + } catch (ApiException e) { + if (e.getCode() == 404) { + break; + } + } + } + + /* delete the keypair we just created */ + iaasApi.deleteKeyPair(newKeypair.getName()); + 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()); + + } catch (ApiException | InterruptedException e) { + throw new RuntimeException(e); + } + } +} diff --git a/services/iaas/README.md b/services/iaas/README.md new file mode 100644 index 0000000..b7450a6 --- /dev/null +++ b/services/iaas/README.md @@ -0,0 +1,114 @@ +# stackit-sdk-iaas + +IaaS-API + +- API version: 1 + +This API allows you to create and modify IaaS resources. + +For more information, please visit [https://support.stackit.cloud/servicedesk](https://support.stackit.cloud/servicedesk) + +This package is part of the STACKIT Java SDK. For additional information, please visit the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-java) of the SDK. + + +## Requirements + +Building the API client library requires: +1. Java SDK (version 11 to 21 should be supported) installed on your system + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +./gradlew publishToMavenLocal +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +# TODO: follow up story +# ./gradlew publishToMavenCentral +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + cloud.stackit + stackit-sdk-iaas + + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'stackit-sdk-iaas' jar has been published to maven central. + mavenLocal() // Needed if the 'stackit-sdk-iaas' jar has been published to the local maven repo. + } + + dependencies { + implementation "cloud.stackit:stackit-sdk-iaas:" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/stackit-sdk-iaas-.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import cloud.stackit.sdk.iaas.*; +import cloud.stackit.sdk.iaas.auth.*; +import cloud.stackit.sdk.iaas.model.*; +import cloud.stackit.sdk.iaas.api.DefaultApi; + +public class DefaultApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://iaas.api.eu01.stackit.cloud"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + UUID projectId = UUID.randomUUID(); // UUID | The identifier (ID) of a STACKIT Project. + UUID serverId = UUID.randomUUID(); // UUID | The identifier (ID) of a STACKIT Server. + UUID networkId = UUID.randomUUID(); // UUID | The identifier (ID) of a STACKIT Network. + try { + apiInstance.addNetworkToServer(projectId, serverId, networkId); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#addNetworkToServer"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. diff --git a/services/iaas/build.gradle b/services/iaas/build.gradle new file mode 100644 index 0000000..10cd648 --- /dev/null +++ b/services/iaas/build.gradle @@ -0,0 +1,19 @@ + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.12.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' + 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 "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' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' +} diff --git a/services/iaas/settings.gradle b/services/iaas/settings.gradle new file mode 100644 index 0000000..fc3bfe7 --- /dev/null +++ b/services/iaas/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "stackit-sdk-iaas" 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 new file mode 100644 index 0000000..8d6639f --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiCallback.java @@ -0,0 +1,60 @@ +/* + * 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; + +import cloud.stackit.sdk.core.exception.ApiException; +import java.util.List; +import java.util.Map; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} 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 new file mode 100644 index 0000000..0e95c89 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiClient.java @@ -0,0 +1,1512 @@ +/* + * 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; + +import cloud.stackit.sdk.core.auth.SetupAuth; +import cloud.stackit.sdk.core.config.CoreConfiguration; +import cloud.stackit.sdk.core.exception.ApiException; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.net.ssl.*; +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +/** ApiClient class. */ +public class ApiClient { + + protected String basePath = "https://iaas.api.eu01.stackit.cloud"; + protected List servers = + new ArrayList( + Arrays.asList( + new ServerConfiguration( + "https://iaas.api.{region}stackit.cloud", + "No description provided", + new HashMap() { + { + put( + "region", + new ServerVariable( + "No description provided", + "eu01.", + new HashSet( + Arrays.asList("eu01.")))); + } + }))); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + protected boolean debugging = false; + protected Map defaultHeaderMap = new HashMap(); + protected Map defaultCookieMap = new HashMap(); + protected String tempFolderPath = null; + + protected DateFormat dateFormat; + protected DateFormat datetimeFormat; + protected boolean lenientDatetimeFormat; + protected int dateLength; + + protected InputStream sslCaCert; + protected boolean verifyingSsl; + protected KeyManager[] keyManagers; + + protected OkHttpClient httpClient; + protected JSON json; + + protected HttpLoggingInterceptor loggingInterceptor; + protected SetupAuth authenticationInterceptor; + + protected CoreConfiguration configuration; + + /** Basic constructor for ApiClient */ + public ApiClient() throws IOException { + this(new CoreConfiguration()); + } + + /** + * Basic constructor with custom CoreConfiguration + * + * @param config a {@link cloud.stackit.sdk.core.config} object + * @throws IOException thrown when a file can not be found + */ + public ApiClient(CoreConfiguration config) throws IOException { + init(); + + if (config.getCustomEndpoint() != null && !config.getCustomEndpoint().trim().isEmpty()) { + basePath = config.getCustomEndpoint(); + } + if (config.getDefaultHeader() != null) { + defaultHeaderMap = config.getDefaultHeader(); + } + this.configuration = config; + + // Setup AuthHandler + SetupAuth auth; + auth = new SetupAuth(config); + auth.init(); + authenticationInterceptor = auth; + + initHttpClient(); + } + + protected void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + protected void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor : interceptors) { + builder.addInterceptor(interceptor); + } + // Adds the Authorization header to requests + builder.addInterceptor(authenticationInterceptor.getAuthHandler()); + + httpClient = builder.build(); + } + + protected void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("stackit-sdk-java/iaas"); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://iaas.api.eu01.stackit.cloud + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. Default to + * true. NOTE: Do NOT set to false in production code, otherwise you would face multiple types + * of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. Use null to reset to + * default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + * Getter for the field keyManagers. + * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. Use null to reset to + * default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + * Getter for the field dateFormat. + * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Setter for the field dateFormat. + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link cloud.stackit.sdk.iaas.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + * Set SqlDateFormat. + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link cloud.stackit.sdk.iaas.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + * Set OffsetDateTimeFormat. + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link cloud.stackit.sdk.iaas.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + * Set LocalDateFormat. + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link cloud.stackit.sdk.iaas.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + * Set LenientOnJson. + * + * @param lenientOnJson a boolean + * @return a {@link cloud.stackit.sdk.iaas.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints with file + * response. The default value is null, i.e. using the system's default temporary + * folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values + * must be between 1 and {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = + httpClient + .newBuilder() + .connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS) + .build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must + * be between 1 and {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = + httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). A value of 0 means no timeout, otherwise values + * must be between 1 and {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = + httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date + || param instanceof OffsetDateTime + || param instanceof LocalDate) { + // Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + *

Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + *

Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified free-form query parameters to a list of {@code Pair} objects. + * + * @param value The free-form query parameters. + * @return A list of {@code Pair} objects. + */ + public List freeFormParameterToPairs(Object value) { + List params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map)) { + return params; + } + + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + + for (Map.Entry entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceFirst("^.*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. JSON MIME examples: application/json + * application/json; charset=UTF8 APPLICATION/JSON application/vnd.company+json "* / *" is also + * default to JSON + * + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: if JSON exists in the given + * array, use it; otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, null will be returned (not to + * set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: if JSON exists in the given + * array, use it; otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, returns null. If it + * matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and the Content-Type + * response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws cloud.stackit.sdk.core.exception.ApiException If fail to deserialize response body, + * i.e. cannot read response body or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + ResponseBody respBody = response.body(); + if (respBody == null) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + try { + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody.byteStream(), returnType); + } else if (returnType.equals(String.class)) { + String respBodyString = respBody.string(); + if (respBodyString.isEmpty()) { + return null; + } + // Expecting string, return the raw response body. + return (T) respBodyString; + } else { + throw new ApiException( + "Content type \"" + + contentType + + "\" is not supported for type: " + + returnType, + response.code(), + response.headers().toMultimap(), + response.body().string()); + } + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Serialize the given Java object into request body according to the object's class and the + * request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws cloud.stackit.sdk.core.exception.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws cloud.stackit.sdk.core.exception.ApiException If fail to read file content from + * response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) prefix = "download-"; + } + + if (tempFolderPath == null) return Files.createTempFile(prefix, suffix).toFile(); + else return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws cloud.stackit.sdk.core.exception.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and data, which is a Java + * object deserialized from response body and would be null when returnType is null. + * @throws cloud.stackit.sdk.core.exception.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue( + new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure( + new ApiException(e), + response.code(), + response.headers().toMultimap()); + return; + } + callback.onSuccess( + result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws cloud.stackit.sdk.core.exception.ApiException If the response has an unsuccessful + * status code or fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException( + response.message(), + e, + response.code(), + response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException( + response.message(), + e, + response.code(), + response.headers().toMultimap()); + } + } + throw new ApiException( + response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and + * "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws cloud.stackit.sdk.core.exception.ApiException If fail to serialize the request body + * object + */ + public Call buildCall( + String baseUrl, + String path, + String method, + List queryParams, + List collectionQueryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String[] authNames, + ApiCallback callback) + throws ApiException { + Request request = + buildRequest( + baseUrl, + path, + method, + queryParams, + collectionQueryParams, + body, + headerParams, + cookieParams, + formParams, + authNames, + callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and + * "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws cloud.stackit.sdk.core.exception.ApiException If fail to serialize the request body + * object + */ + public Request buildRequest( + String baseUrl, + String path, + String method, + List queryParams, + List collectionQueryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String[] authNames, + ApiCallback callback) + throws ApiException { + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = + RequestBody.create( + "", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + List updatedQueryParams = new ArrayList<>(queryParams); + + final Request.Builder reqBuilder = + new Request.Builder() + .url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl( + String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException( + String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", + serverIndex, servers.size())); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())) + .append("=") + .append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader( + "Cookie", String.format("%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())); + } + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, which could + * contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item : list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + protected void addPartToMultiPartBuilder( + MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = + Headers.of( + "Content-Disposition", + "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody + * Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + protected void addPartToMultiPartBuilder( + MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for async + * requests. + */ + protected Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse + .newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of verifyingSsl and + * sslCaCert. + */ + protected void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = + new TrustManager[] { + new X509TrustManager() { + @Override + public void checkClientTrusted( + java.security.cert.X509Certificate[] chain, String authType) + throws CertificateException {} + + @Override + public void checkServerTrusted( + java.security.cert.X509Certificate[] chain, String authType) + throws CertificateException {} + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[] {}; + } + } + }; + hostnameVerifier = + new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = + TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = + certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException( + "expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = + httpClient + .newBuilder() + .sslSocketFactory( + sslContext.getSocketFactory(), + (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + protected KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws cloud.stackit.sdk.core.exception.ApiException If fail to serialize the request body + * object into a string + */ + protected String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} 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 new file mode 100644 index 0000000..9da9eeb --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ApiResponse.java @@ -0,0 +1,73 @@ +/* + * 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; + +import java.util.List; +import java.util.Map; + +/** API response returned by API call. */ +public class ApiResponse { + private final int statusCode; + private final Map> headers; + private final T data; + + /** + * Constructor for ApiResponse. + * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * Constructor for ApiResponse. + * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + * Get the status code. + * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + * Get the headers. + * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + * Get the data. + * + * @return the data + */ + public T getData() { + return data; + } +} 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 new file mode 100644 index 0000000..cb12462 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/GzipRequestInterceptor.java @@ -0,0 +1,87 @@ +/* + * 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; + +import java.io.IOException; +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +/** + * Encodes request bodies using gzip. + * + *

Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = + originalRequest + .newBuilder() + .header("Content-Encoding", "gzip") + .method( + originalRequest.method(), + forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} 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 new file mode 100644 index 0000000..210e683 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/JSON.java @@ -0,0 +1,701 @@ +/* + * 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; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.gsonfire.GsonFireBuilder; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Map; +import okio.ByteString; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = + new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder(); + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue( + JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException( + "missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator + * value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator( + Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException( + "cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.AddVolumeToServerPayload + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.AffinityGroup.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.AffinityGroupListResponse + .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()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.Backup.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.BackupListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.BackupSource.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.BaseSecurityGroupRule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.BootVolume.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.BootVolumeSource.CustomTypeAdapterFactory()); + 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 + .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.CreateNetworkAreaRoutePayload + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateNetworkIPv4Body.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateNetworkIPv6Body.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateNetworkPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateNicPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateProtocol.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreatePublicIPPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateSecurityGroupPayload + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateSecurityGroupRulePayload + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateSecurityGroupRuleProtocol + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateServerNetworking.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateServerNetworkingWithNics + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateServerPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.CreateServerPayloadNetworking + .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.Error.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.GetServerLog200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.ICMPParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.Image.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.ImageAgent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.ImageChecksum.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + 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.ImageListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.ImageShare.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.ImageShareConsumer.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.KeyPairListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.Keypair.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.MachineType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.MachineTypeListResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.NIC.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.NICListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + 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.NetworkListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.NetworkRange.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.NetworkRangeListResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.PartialUpdateNetworkAreaPayload + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.PartialUpdateNetworkPayload + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.PortRange.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.Project.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.ProjectListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.Protocol.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.PublicIp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.PublicIpListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.PublicNetwork.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.PublicNetworkListResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.Quota.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + 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.Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.RequestResource.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.RescueServerPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.ResizeServerPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + 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.RouteListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.SecurityGroup.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.SecurityGroupListResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.SecurityGroupRule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.SecurityGroupRuleListResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.SecurityGroupRuleProtocol + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.Server.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.ServerConsoleUrl.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.ServerListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + 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.ServiceAccountMailListResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.SetImageSharePayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + 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()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateBackupPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateImagePayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateImageSharePayload + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateKeyPairPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateNetworkAddressFamily + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateNetworkAreaRoutePayload + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateNetworkIPv4Body.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateNetworkIPv6Body.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + 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.UpdateSecurityGroupPayload + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateServerPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateSnapshotPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.UpdateVolumePayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.Volume.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.VolumeAttachment.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.VolumeAttachmentListResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.VolumeEncryptionParameter + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.VolumeListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.VolumePerformanceClass.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.VolumePerformanceClassListResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.model.VolumeSource.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see + // https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Deserialize the given JSON InputStream to a Java object. + * + * @param Type + * @param inputStream The JSON InputStream + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(InputStream inputStream, Type returnType) throws IOException { + try (InputStreamReader reader = + new InputStreamReader(inputStream, StandardCharsets.UTF_8)) { + if (isLenientOnJson) { + // see + // https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + JsonReader jsonReader = new JsonReader(reader); + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(reader, returnType); + } + } + } + + /** Gson TypeAdapter for Byte Array type */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** Gson TypeAdapter for JSR310 OffsetDateTime type */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length() - 5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** Gson TypeAdapter for JSR310 LocalDate type */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" + * format will be used (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date( + ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be + * used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} 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 new file mode 100644 index 0000000..e37edc8 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/Pair.java @@ -0,0 +1,58 @@ +/* + * 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; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair(String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} 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 new file mode 100644 index 0000000..0817b86 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressRequestBody.java @@ -0,0 +1,71 @@ +/* + * 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; + +import java.io.IOException; +import okhttp3.MediaType; +import okhttp3.RequestBody; +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress( + bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} 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 new file mode 100644 index 0000000..5a41d02 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ProgressResponseBody.java @@ -0,0 +1,68 @@ +/* + * 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; + +import java.io.IOException; +import okhttp3.MediaType; +import okhttp3.ResponseBody; +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress( + totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} 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 new file mode 100644 index 0000000..fc513df --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerConfiguration.java @@ -0,0 +1,79 @@ +/* + * 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; + +import java.util.Map; + +/** Representing a Server configuration. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for + * substitution in the server's URL template. + */ + public ServerConfiguration( + String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable : this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 + && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException( + "The variable " + + name + + " in the server URL has invalid value " + + value + + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} 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 new file mode 100644 index 0000000..1e36e5c --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/ServerVariable.java @@ -0,0 +1,37 @@ +/* + * 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; + +import java.util.HashSet; + +/** Representing a Server Variable for server URL template substitution. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are + * from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} 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 new file mode 100644 index 0000000..e2234e5 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/StringUtil.java @@ -0,0 +1,83 @@ +/* + * 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; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + * + *

Note: This might be replaced by utility method from commons-lang or guava someday if one + * of those libraries is added as dependency. + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} 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 new file mode 100644 index 0000000..9ad35e5 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/DefaultApi.java @@ -0,0 +1,24757 @@ +/* + * 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.api; + +import cloud.stackit.sdk.core.config.CoreConfiguration; +import cloud.stackit.sdk.core.exception.ApiException; +import cloud.stackit.sdk.iaas.ApiCallback; +import cloud.stackit.sdk.iaas.ApiClient; +import cloud.stackit.sdk.iaas.ApiResponse; +import cloud.stackit.sdk.iaas.Pair; +import cloud.stackit.sdk.iaas.model.AddVolumeToServerPayload; +import cloud.stackit.sdk.iaas.model.AffinityGroup; +import cloud.stackit.sdk.iaas.model.AffinityGroupListResponse; +import cloud.stackit.sdk.iaas.model.AvailabilityZoneListResponse; +import cloud.stackit.sdk.iaas.model.Backup; +import cloud.stackit.sdk.iaas.model.BackupListResponse; +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.CreateKeyPairPayload; +import cloud.stackit.sdk.iaas.model.CreateNetworkAreaPayload; +import cloud.stackit.sdk.iaas.model.CreateNetworkAreaRangePayload; +import cloud.stackit.sdk.iaas.model.CreateNetworkAreaRoutePayload; +import cloud.stackit.sdk.iaas.model.CreateNetworkPayload; +import cloud.stackit.sdk.iaas.model.CreateNicPayload; +import cloud.stackit.sdk.iaas.model.CreatePublicIPPayload; +import cloud.stackit.sdk.iaas.model.CreateSecurityGroupPayload; +import cloud.stackit.sdk.iaas.model.CreateSecurityGroupRulePayload; +import cloud.stackit.sdk.iaas.model.CreateServerPayload; +import cloud.stackit.sdk.iaas.model.CreateSnapshotPayload; +import cloud.stackit.sdk.iaas.model.CreateVolumePayload; +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.ImageListResponse; +import cloud.stackit.sdk.iaas.model.ImageShare; +import cloud.stackit.sdk.iaas.model.ImageShareConsumer; +import cloud.stackit.sdk.iaas.model.KeyPairListResponse; +import cloud.stackit.sdk.iaas.model.Keypair; +import cloud.stackit.sdk.iaas.model.MachineType; +import cloud.stackit.sdk.iaas.model.MachineTypeListResponse; +import cloud.stackit.sdk.iaas.model.NIC; +import cloud.stackit.sdk.iaas.model.NICListResponse; +import cloud.stackit.sdk.iaas.model.Network; +import cloud.stackit.sdk.iaas.model.NetworkArea; +import cloud.stackit.sdk.iaas.model.NetworkAreaListResponse; +import cloud.stackit.sdk.iaas.model.NetworkListResponse; +import cloud.stackit.sdk.iaas.model.NetworkRange; +import cloud.stackit.sdk.iaas.model.NetworkRangeListResponse; +import cloud.stackit.sdk.iaas.model.PartialUpdateNetworkAreaPayload; +import cloud.stackit.sdk.iaas.model.PartialUpdateNetworkPayload; +import cloud.stackit.sdk.iaas.model.Project; +import cloud.stackit.sdk.iaas.model.ProjectListResponse; +import cloud.stackit.sdk.iaas.model.PublicIp; +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.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.SecurityGroup; +import cloud.stackit.sdk.iaas.model.SecurityGroupListResponse; +import cloud.stackit.sdk.iaas.model.SecurityGroupRule; +import cloud.stackit.sdk.iaas.model.SecurityGroupRuleListResponse; +import cloud.stackit.sdk.iaas.model.Server; +import cloud.stackit.sdk.iaas.model.ServerConsoleUrl; +import cloud.stackit.sdk.iaas.model.ServerListResponse; +import cloud.stackit.sdk.iaas.model.ServiceAccountMailListResponse; +import cloud.stackit.sdk.iaas.model.SetImageSharePayload; +import cloud.stackit.sdk.iaas.model.Snapshot; +import cloud.stackit.sdk.iaas.model.SnapshotListResponse; +import cloud.stackit.sdk.iaas.model.UpdateAttachedVolumePayload; +import cloud.stackit.sdk.iaas.model.UpdateBackupPayload; +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.UpdateNetworkAreaRoutePayload; +import cloud.stackit.sdk.iaas.model.UpdateNicPayload; +import cloud.stackit.sdk.iaas.model.UpdatePublicIPPayload; +import cloud.stackit.sdk.iaas.model.UpdateSecurityGroupPayload; +import cloud.stackit.sdk.iaas.model.UpdateServerPayload; +import cloud.stackit.sdk.iaas.model.UpdateSnapshotPayload; +import cloud.stackit.sdk.iaas.model.UpdateVolumePayload; +import cloud.stackit.sdk.iaas.model.Volume; +import cloud.stackit.sdk.iaas.model.VolumeAttachment; +import cloud.stackit.sdk.iaas.model.VolumeAttachmentListResponse; +import cloud.stackit.sdk.iaas.model.VolumeListResponse; +import cloud.stackit.sdk.iaas.model.VolumePerformanceClass; +import cloud.stackit.sdk.iaas.model.VolumePerformanceClassListResponse; +import com.google.gson.reflect.TypeToken; +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +// Package-private access to enforce service-specific API usage (DefaultApi => Api) +class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() throws IOException { + this(new CoreConfiguration()); + } + + public DefaultApi(CoreConfiguration config) throws IOException { + if (config.getCustomEndpoint() != null && !config.getCustomEndpoint().trim().isEmpty()) { + localCustomBaseUrl = config.getCustomEndpoint(); + } + this.localVarApiClient = new ApiClient(config); + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for addNetworkToServer + * + * @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 _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 Create and attach network interface 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call addNetworkToServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID networkId, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.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 addNetworkToServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @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 addNetworkToServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling addNetworkToServer(Async)"); + } + + // verify the required parameter 'networkId' is set + if (networkId == null) { + throw new ApiException( + "Missing the required parameter 'networkId' when calling addNetworkToServer(Async)"); + } + + return addNetworkToServerCall(projectId, serverId, networkId, _callback); + } + + /** + * Create and attach a network interface from the specified network. Create and attach a network + * interface from the specified network to the server. + * + * @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) + * @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 Create and attach network interface 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public void addNetworkToServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID networkId) + throws ApiException { + addNetworkToServerWithHttpInfo(projectId, serverId, networkId); + } + + /** + * Create and attach a network interface from the specified network. Create and attach a network + * interface from the specified network to the server. + * + * @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> + * @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 Create and attach network interface 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse addNetworkToServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID networkId) + throws ApiException { + okhttp3.Call localVarCall = + addNetworkToServerValidateBeforeCall(projectId, serverId, networkId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Create and attach a network interface from the specified network. (asynchronously) Create and + * attach a network interface from the specified network to the server. + * + * @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 _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 Create and attach network interface 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call addNetworkToServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID networkId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addNetworkToServerValidateBeforeCall(projectId, serverId, networkId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for addNicToServer + * + * @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 _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 Network interface 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 addNicToServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID nicId, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.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 = {}; + 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 addNicToServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 addNicToServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling addNicToServer(Async)"); + } + + // verify the required parameter 'nicId' is set + if (nicId == null) { + throw new ApiException( + "Missing the required parameter 'nicId' when calling addNicToServer(Async)"); + } + + return addNicToServerCall(projectId, 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 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 + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 Network interface 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 void addNicToServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID nicId) + throws ApiException { + addNicToServerWithHttpInfo(projectId, 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 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 + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 Network interface 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 addNicToServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID nicId) + throws ApiException { + okhttp3.Call localVarCall = + addNicToServerValidateBeforeCall(projectId, serverId, nicId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Attach an existing network interface. (asynchronously) Attach an existing network interface + * to a server. + * + * @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 _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 Network interface 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 addNicToServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID nicId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addNicToServerValidateBeforeCall(projectId, serverId, nicId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for addPublicIpToServer + * + * @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 _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 Attach Public IP to 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call addPublicIpToServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.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 = {}; + 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 addPublicIpToServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 addPublicIpToServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling addPublicIpToServer(Async)"); + } + + // verify the required parameter 'publicIpId' is set + if (publicIpId == null) { + throw new ApiException( + "Missing the required parameter 'publicIpId' when calling addPublicIpToServer(Async)"); + } + + return addPublicIpToServerCall(projectId, 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 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
202 Attach Public IP to 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public void addPublicIpToServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId) + throws ApiException { + addPublicIpToServerWithHttpInfo(projectId, 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 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
202 Attach Public IP to 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse addPublicIpToServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId) + throws ApiException { + okhttp3.Call localVarCall = + addPublicIpToServerValidateBeforeCall(projectId, serverId, publicIpId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 Attach Public IP to 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. -
409 A conflict has occurred. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call addPublicIpToServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addPublicIpToServerValidateBeforeCall(projectId, serverId, publicIpId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for addSecurityGroupToServer + * + * @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 _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 Security group 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 addSecurityGroupToServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.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, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addSecurityGroupToServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 addSecurityGroupToServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling addSecurityGroupToServer(Async)"); + } + + // verify the required parameter 'securityGroupId' is set + if (securityGroupId == null) { + throw new ApiException( + "Missing the required parameter 'securityGroupId' when calling addSecurityGroupToServer(Async)"); + } + + return addSecurityGroupToServerCall(projectId, serverId, securityGroupId, _callback); + } + + /** + * 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 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
202 Security group 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 void addSecurityGroupToServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId) + throws ApiException { + addSecurityGroupToServerWithHttpInfo(projectId, serverId, securityGroupId); + } + + /** + * 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 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
202 Security group 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 addSecurityGroupToServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId) + throws ApiException { + okhttp3.Call localVarCall = + addSecurityGroupToServerValidateBeforeCall( + projectId, serverId, securityGroupId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 Security group 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 addSecurityGroupToServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addSecurityGroupToServerValidateBeforeCall( + projectId, serverId, securityGroupId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for addServiceAccountToServer + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 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 addServiceAccountToServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "serviceAccountMail" + "}", + localVarApiClient.escapeString(serviceAccountMail.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, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addServiceAccountToServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 addServiceAccountToServerCall(projectId, serverId, serviceAccountMail, _callback); + } + + /** + * 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 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 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 ServiceAccountMailListResponse addServiceAccountToServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail) + throws ApiException { + ApiResponse localVarResp = + addServiceAccountToServerWithHttpInfo(projectId, serverId, serviceAccountMail); + return localVarResp.getData(); + } + + /** + * 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 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 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 addServiceAccountToServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail) + throws ApiException { + okhttp3.Call localVarCall = + addServiceAccountToServerValidateBeforeCall( + projectId, serverId, serviceAccountMail, 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. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 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 addServiceAccountToServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addServiceAccountToServerValidateBeforeCall( + projectId, serverId, serviceAccountMail, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for addVolumeToServer + * + * @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 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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 addVolumeToServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload, + 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 = addVolumeToServerPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addVolumeToServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 addVolumeToServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling addVolumeToServer(Async)"); + } + + // 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, serverId, volumeId, addVolumeToServerPayload, _callback); + } + + /** + * 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 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
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 VolumeAttachment addVolumeToServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload) + throws ApiException { + ApiResponse localVarResp = + addVolumeToServerWithHttpInfo( + projectId, serverId, volumeId, addVolumeToServerPayload); + return localVarResp.getData(); + } + + /** + * 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 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
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 addVolumeToServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload) + throws ApiException { + okhttp3.Call localVarCall = + addVolumeToServerValidateBeforeCall( + projectId, serverId, volumeId, addVolumeToServerPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 addVolumeToServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nullable AddVolumeToServerPayload addVolumeToServerPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addVolumeToServerValidateBeforeCall( + projectId, serverId, volumeId, addVolumeToServerPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createAffinityGroup + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call createAffinityGroupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload, + 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 = createAffinityGroupPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/affinity-groups" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createAffinityGroupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 createAffinityGroupCall(projectId, createAffinityGroupPayload, _callback); + } + + /** + * 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 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 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public AffinityGroup createAffinityGroup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload) + throws ApiException { + ApiResponse localVarResp = + createAffinityGroupWithHttpInfo(projectId, createAffinityGroupPayload); + return localVarResp.getData(); + } + + /** + * 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 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 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse createAffinityGroupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload) + throws ApiException { + okhttp3.Call localVarCall = + createAffinityGroupValidateBeforeCall(projectId, createAffinityGroupPayload, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call createAffinityGroupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateAffinityGroupPayload createAffinityGroupPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createAffinityGroupValidateBeforeCall( + projectId, createAffinityGroupPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createBackup + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call createBackupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateBackupPayload createBackupPayload, + 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 = createBackupPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/backups" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createBackupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateBackupPayload createBackupPayload, + 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)"); + } + + // 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, createBackupPayload, _callback); + } + + /** + * Create new Backup. Create a new Backup in a project. If a snapshot ID is provided create the + * backup from the snapshot. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Backup createBackup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateBackupPayload createBackupPayload) + throws ApiException { + ApiResponse localVarResp = createBackupWithHttpInfo(projectId, createBackupPayload); + 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse createBackupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateBackupPayload createBackupPayload) + throws ApiException { + okhttp3.Call localVarCall = + createBackupValidateBeforeCall(projectId, createBackupPayload, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call createBackupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateBackupPayload createBackupPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createBackupValidateBeforeCall(projectId, createBackupPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createImage + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call createImageCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateImagePayload createImagePayload, + 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 = createImagePayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/images" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createImageValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 createImage(Async)"); + } + + // 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, createImagePayload, _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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ImageCreateResponse createImage( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateImagePayload createImagePayload) + throws ApiException { + ApiResponse localVarResp = + createImageWithHttpInfo(projectId, createImagePayload); + 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse createImageWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateImagePayload createImagePayload) + throws ApiException { + okhttp3.Call localVarCall = + createImageValidateBeforeCall(projectId, createImagePayload, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
429 Too Many Requests. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call createImageAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateImagePayload createImagePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createImageValidateBeforeCall(projectId, createImagePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createKeyPair + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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, + 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 = createKeyPairPayload; + + // create path and map variables + String localVarPath = "/v1/keypairs"; + + 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 createKeyPairValidateBeforeCall( + @javax.annotation.Nonnull CreateKeyPairPayload createKeyPairPayload, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createKeyPairPayload' is set + if (createKeyPairPayload == null) { + throw new ApiException( + "Missing the required parameter 'createKeyPairPayload' when calling createKeyPair(Async)"); + } + + return createKeyPairCall(createKeyPairPayload, _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. + * + * @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 + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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) + throws ApiException { + ApiResponse localVarResp = createKeyPairWithHttpInfo(createKeyPairPayload); + 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. + * + * @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 + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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) + throws ApiException { + okhttp3.Call localVarCall = createKeyPairValidateBeforeCall(createKeyPairPayload, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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) + throws ApiException { + + okhttp3.Call localVarCall = + createKeyPairValidateBeforeCall(createKeyPairPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createNetwork + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 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 createNetworkCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, + 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 = createNetworkPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/networks" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createNetworkValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, + 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)"); + } + + // verify the required parameter 'createNetworkPayload' is set + if (createNetworkPayload == null) { + throw new ApiException( + "Missing the required parameter 'createNetworkPayload' when calling createNetwork(Async)"); + } + + return createNetworkCall(projectId, createNetworkPayload, _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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 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 Network createNetwork( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload) + throws ApiException { + ApiResponse localVarResp = + createNetworkWithHttpInfo(projectId, createNetworkPayload); + 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 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 createNetworkWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload) + throws ApiException { + okhttp3.Call localVarCall = + createNetworkValidateBeforeCall(projectId, createNetworkPayload, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 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 createNetworkAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateNetworkPayload createNetworkPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createNetworkValidateBeforeCall(projectId, createNetworkPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createNetworkArea + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 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. -
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, + 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 = createNetworkAreaPayload; + + // create path and map variables + String localVarPath = + "/v1/organizations/{organizationId}/network-areas" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.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 createNetworkAreaValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull CreateNetworkAreaPayload createNetworkAreaPayload, + 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 createNetworkArea(Async)"); + } + + // verify the required parameter 'createNetworkAreaPayload' is set + if (createNetworkAreaPayload == null) { + throw new ApiException( + "Missing the required parameter 'createNetworkAreaPayload' when calling createNetworkArea(Async)"); + } + + return createNetworkAreaCall(organizationId, createNetworkAreaPayload, _callback); + } + + /** + * Create new network area in an organization. Create a new network area in an organization. + * + * @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
200 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. -
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) + throws ApiException { + ApiResponse localVarResp = + createNetworkAreaWithHttpInfo(organizationId, createNetworkAreaPayload); + return localVarResp.getData(); + } + + /** + * Create new network area in an organization. Create a new network area in an organization. + * + * @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
200 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. -
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) + throws ApiException { + okhttp3.Call localVarCall = + createNetworkAreaValidateBeforeCall(organizationId, createNetworkAreaPayload, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 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. -
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) + throws ApiException { + + okhttp3.Call localVarCall = + createNetworkAreaValidateBeforeCall( + organizationId, createNetworkAreaPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createNetworkAreaRange + * + * @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 _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 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. -
409 A conflict has occurred. -
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, + 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 = createNetworkAreaRangePayload; + + // 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())); + + 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 createNetworkAreaRangeValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull CreateNetworkAreaRangePayload createNetworkAreaRangePayload, + 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) { + throw new ApiException( + "Missing the required parameter 'createNetworkAreaRangePayload' when calling createNetworkAreaRange(Async)"); + } + + return createNetworkAreaRangeCall( + organizationId, areaId, createNetworkAreaRangePayload, _callback); + } + + /** + * Create new network range in a network area. Create a new network range in an existing network + * area. + * + * @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 + * @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 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. -
409 A conflict has occurred. -
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) + throws ApiException { + ApiResponse localVarResp = + createNetworkAreaRangeWithHttpInfo( + organizationId, areaId, createNetworkAreaRangePayload); + return localVarResp.getData(); + } + + /** + * Create new network range in a network area. Create a new network range in an existing network + * area. + * + * @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> + * @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 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. -
409 A conflict has occurred. -
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) + throws ApiException { + okhttp3.Call localVarCall = + createNetworkAreaRangeValidateBeforeCall( + organizationId, areaId, createNetworkAreaRangePayload, 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. + * + * @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 _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 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. -
409 A conflict has occurred. -
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) + throws ApiException { + + okhttp3.Call localVarCall = + createNetworkAreaRangeValidateBeforeCall( + organizationId, areaId, createNetworkAreaRangePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createNetworkAreaRoute + * + * @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 _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 Create request for network routes 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 createNetworkAreaRouteCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload, + 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 = createNetworkAreaRoutePayload; + + // create path and map variables + String localVarPath = + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.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 createNetworkAreaRouteValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload, + 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 createNetworkAreaRoute(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling createNetworkAreaRoute(Async)"); + } + + // 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, createNetworkAreaRoutePayload, _callback); + } + + /** + * Create new network routes. Create one or several new network routes 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 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
202 Create request for network routes 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 RouteListResponse createNetworkAreaRoute( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload) + throws ApiException { + ApiResponse localVarResp = + createNetworkAreaRouteWithHttpInfo( + organizationId, areaId, createNetworkAreaRoutePayload); + return localVarResp.getData(); + } + + /** + * Create new network routes. Create one or several new network routes 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 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
202 Create request for network routes 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 createNetworkAreaRouteWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload) + throws ApiException { + okhttp3.Call localVarCall = + createNetworkAreaRouteValidateBeforeCall( + organizationId, areaId, createNetworkAreaRoutePayload, 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. + * + * @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 _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 Create request for network routes 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 createNetworkAreaRouteAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createNetworkAreaRouteValidateBeforeCall( + organizationId, areaId, createNetworkAreaRoutePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createNic + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 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 createNicCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull CreateNicPayload createNicPayload, + 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 = createNicPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/networks/{networkId}/nics" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.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 createNicValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 createNicCall(projectId, networkId, createNicPayload, _callback); + } + + /** + * Create new network interface. Create a new network interface in a project. + * + * @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 + * @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. -
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) + throws ApiException { + ApiResponse localVarResp = + createNicWithHttpInfo(projectId, networkId, createNicPayload); + return localVarResp.getData(); + } + + /** + * Create new network interface. Create a new network interface in a project. + * + * @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> + * @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. -
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) + throws ApiException { + okhttp3.Call localVarCall = + createNicValidateBeforeCall(projectId, networkId, createNicPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create new network interface. (asynchronously) Create a new network interface in a project. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 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 createNicAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull CreateNicPayload createNicPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createNicValidateBeforeCall(projectId, networkId, createNicPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createPublicIP + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 createPublicIPCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload, + 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 = createPublicIPPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/public-ips" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createPublicIPValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 createPublicIPCall(projectId, createPublicIPPayload, _callback); + } + + /** + * Create new public IP. Create a new public IP in a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 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 PublicIp createPublicIP( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload) + throws ApiException { + ApiResponse localVarResp = + createPublicIPWithHttpInfo(projectId, createPublicIPPayload); + return localVarResp.getData(); + } + + /** + * Create new public IP. Create a new public IP in a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 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 createPublicIPWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload) + throws ApiException { + okhttp3.Call localVarCall = + createPublicIPValidateBeforeCall(projectId, createPublicIPPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create new public IP. (asynchronously) Create a new public IP in a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 createPublicIPAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreatePublicIPPayload createPublicIPPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createPublicIPValidateBeforeCall(projectId, createPublicIPPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createSecurityGroup + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Security group 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. -
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, + 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 = createSecurityGroupPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/security-groups" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSecurityGroupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 createSecurityGroupCall(projectId, createSecurityGroupPayload, _callback); + } + + /** + * Create new security group. Create a new security group in a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Security group 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. -
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) + throws ApiException { + ApiResponse localVarResp = + createSecurityGroupWithHttpInfo(projectId, createSecurityGroupPayload); + return localVarResp.getData(); + } + + /** + * Create new security group. Create a new security group in a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Security group 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. -
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) + throws ApiException { + okhttp3.Call localVarCall = + createSecurityGroupValidateBeforeCall(projectId, createSecurityGroupPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create new security group. (asynchronously) Create a new security group in a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Security group 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. -
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) + throws ApiException { + + okhttp3.Call localVarCall = + createSecurityGroupValidateBeforeCall( + projectId, createSecurityGroupPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createSecurityGroupRule + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 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. -
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, + 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 = createSecurityGroupRulePayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.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 createSecurityGroupRuleValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 createSecurityGroupRuleCall( + projectId, securityGroupId, createSecurityGroupRulePayload, _callback); + } + + /** + * 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 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
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. -
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) + throws ApiException { + ApiResponse localVarResp = + createSecurityGroupRuleWithHttpInfo( + projectId, securityGroupId, createSecurityGroupRulePayload); + return localVarResp.getData(); + } + + /** + * 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 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
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. -
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) + throws ApiException { + okhttp3.Call localVarCall = + createSecurityGroupRuleValidateBeforeCall( + projectId, securityGroupId, createSecurityGroupRulePayload, 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. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 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. -
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) + throws ApiException { + + okhttp3.Call localVarCall = + createSecurityGroupRuleValidateBeforeCall( + projectId, securityGroupId, createSecurityGroupRulePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createServer + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for server 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 createServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateServerPayload createServerPayload, + 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 = createServerPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/servers" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 createServerCall(projectId, createServerPayload, _callback); + } + + /** + * Create new server. Create a new server in a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for server 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 Server createServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateServerPayload createServerPayload) + throws ApiException { + ApiResponse localVarResp = createServerWithHttpInfo(projectId, createServerPayload); + return localVarResp.getData(); + } + + /** + * Create new server. Create a new server in a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for server 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 createServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateServerPayload createServerPayload) + throws ApiException { + okhttp3.Call localVarCall = + createServerValidateBeforeCall(projectId, createServerPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create new server. (asynchronously) Create a new server in a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for server 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 createServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateServerPayload createServerPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createServerValidateBeforeCall(projectId, createServerPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createSnapshot + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for Snapshot 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 createSnapshotCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload, + 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 = createSnapshotPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/snapshots" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSnapshotValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 createSnapshotCall(projectId, createSnapshotPayload, _callback); + } + + /** + * Create new Snapshot. Create a new Snapshot from a Volume in a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for Snapshot 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 Snapshot createSnapshot( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload) + throws ApiException { + ApiResponse localVarResp = + createSnapshotWithHttpInfo(projectId, createSnapshotPayload); + return localVarResp.getData(); + } + + /** + * Create new Snapshot. Create a new Snapshot from a Volume in a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for Snapshot 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 createSnapshotWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload) + throws ApiException { + okhttp3.Call localVarCall = + createSnapshotValidateBeforeCall(projectId, createSnapshotPayload, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for Snapshot 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 createSnapshotAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateSnapshotPayload createSnapshotPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createSnapshotValidateBeforeCall(projectId, createSnapshotPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for createVolume + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for volume 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 createVolumeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateVolumePayload createVolumePayload, + 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 = createVolumePayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/volumes" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createVolumeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 createVolumeCall(projectId, createVolumePayload, _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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for volume 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 Volume createVolume( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateVolumePayload createVolumePayload) + throws ApiException { + ApiResponse localVarResp = createVolumeWithHttpInfo(projectId, createVolumePayload); + 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for volume 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 createVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateVolumePayload createVolumePayload) + throws ApiException { + okhttp3.Call localVarCall = + createVolumeValidateBeforeCall(projectId, createVolumePayload, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
201 Create request for volume 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 createVolumeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull CreateVolumePayload createVolumePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createVolumeValidateBeforeCall(projectId, createVolumePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for deallocateServer + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 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 deallocateServerCall( + @javax.annotation.Nonnull UUID projectId, + @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 = + "/v1/projects/{projectId}/servers/{serverId}/deallocate" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 deallocateServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 deallocateServerCall(projectId, serverId, _callback); + } + + /** + * 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 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 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 deallocateServer( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + throws ApiException { + deallocateServerWithHttpInfo(projectId, serverId); + } + + /** + * 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 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 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 deallocateServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + throws ApiException { + okhttp3.Call localVarCall = deallocateServerValidateBeforeCall(projectId, serverId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 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 deallocateServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deallocateServerValidateBeforeCall(projectId, serverId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteAffinityGroup + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteAffinityGroupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID affinityGroupId, + 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 = + "/v1/projects/{projectId}/affinity-groups/{affinityGroupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "affinityGroupId" + "}", + localVarApiClient.escapeString(affinityGroupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteAffinityGroupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 deleteAffinityGroup(Async)"); + } + + // verify the required parameter 'affinityGroupId' is set + if (affinityGroupId == null) { + throw new ApiException( + "Missing the required parameter 'affinityGroupId' when calling deleteAffinityGroup(Async)"); + } + + return deleteAffinityGroupCall(projectId, affinityGroupId, _callback); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public void deleteAffinityGroup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID affinityGroupId) + throws ApiException { + deleteAffinityGroupWithHttpInfo(projectId, affinityGroupId); + } + + /** + * 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 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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse deleteAffinityGroupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID affinityGroupId) + throws ApiException { + okhttp3.Call localVarCall = + deleteAffinityGroupValidateBeforeCall(projectId, affinityGroupId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteAffinityGroupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID affinityGroupId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteAffinityGroupValidateBeforeCall(projectId, affinityGroupId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteBackup + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Backup 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteBackupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nullable Boolean force, + 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 = + "/v1/projects/{projectId}/backups/{backupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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(); + + 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 localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteBackupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nullable Boolean force, + 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)"); + } + + // 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, backupId, force, _callback); + } + + /** + * Delete a backup. Delete a backup that is part of the 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) + * @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 Backup 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public void deleteBackup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nullable Boolean force) + throws ApiException { + deleteBackupWithHttpInfo(projectId, backupId, force); + } + + /** + * Delete a backup. Delete a backup that is part of the 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> + * @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 Backup 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse deleteBackupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nullable Boolean force) + throws ApiException { + okhttp3.Call localVarCall = + deleteBackupValidateBeforeCall(projectId, backupId, force, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a backup. (asynchronously) Delete a backup that is part of the 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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Backup 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteBackupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID backupId, + @javax.annotation.Nullable Boolean force, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteBackupValidateBeforeCall(projectId, backupId, force, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteImage + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteImageCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + 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 = + "/v1/projects/{projectId}/images/{imageId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteImageValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 deleteImageCall(projectId, imageId, _callback); + } + + /** + * Delete an Image. Delete an image 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) + * @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 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. -
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) + throws ApiException { + deleteImageWithHttpInfo(projectId, imageId); + } + + /** + * Delete an Image. Delete an image 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) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 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. -
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) + throws ApiException { + okhttp3.Call localVarCall = deleteImageValidateBeforeCall(projectId, imageId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete an Image. (asynchronously) Delete an image 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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteImageAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = deleteImageValidateBeforeCall(projectId, imageId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteImageShare + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteImageShareCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + 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 = + "/v1/projects/{projectId}/images/{imageId}/share" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteImageShareValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 deleteImageShare(Async)"); + } + + // 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, imageId, _callback); + } + + /** + * Remove image share. Remove the image share. New scope will be local. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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. -
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) + throws ApiException { + deleteImageShareWithHttpInfo(projectId, imageId); + } + + /** + * Remove image share. Remove the image share. New scope will be local. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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) + throws ApiException { + okhttp3.Call localVarCall = deleteImageShareValidateBeforeCall(projectId, imageId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Remove image share. (asynchronously) Remove the image share. New scope will be local. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteImageShareAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteImageShareValidateBeforeCall(projectId, imageId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteImageShareConsumer + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteImageShareConsumerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId, + 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 = + "/v1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "imageId" + "}", + localVarApiClient.escapeString(imageId.toString())) + .replace( + "{" + "consumerProjectId" + "}", + localVarApiClient.escapeString(consumerProjectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteImageShareConsumerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 deleteImageShareConsumer(Async)"); + } + + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException( + "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 deleteImageShareConsumerCall(projectId, imageId, consumerProjectId, _callback); + } + + /** + * Remove an image share consumer. Remove consumer from a shared image. + * + * @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) + * @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 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public void deleteImageShareConsumer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId) + throws ApiException { + deleteImageShareConsumerWithHttpInfo(projectId, imageId, consumerProjectId); + } + + /** + * Remove an image share consumer. Remove consumer from a shared image. + * + * @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<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse deleteImageShareConsumerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId) + throws ApiException { + okhttp3.Call localVarCall = + deleteImageShareConsumerValidateBeforeCall( + projectId, imageId, consumerProjectId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Remove an image share consumer. (asynchronously) Remove consumer from a shared image. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteImageShareConsumerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteImageShareConsumerValidateBeforeCall( + projectId, imageId, consumerProjectId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteKeyPair + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
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) + 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 = + "/v1/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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteKeyPairValidateBeforeCall( + @javax.annotation.Nonnull String keypairName, 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 deleteKeyPair(Async)"); + } + + return deleteKeyPairCall(keypairName, _callback); + } + + /** + * Delete an SSH keypair. Delete an SSH keypair from a user. + * + * @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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
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); + } + + /** + * Delete an SSH keypair. Delete an SSH keypair from a user. + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse deleteKeyPairWithHttpInfo(@javax.annotation.Nonnull String keypairName) + throws ApiException { + okhttp3.Call localVarCall = deleteKeyPairValidateBeforeCall(keypairName, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete an SSH keypair. (asynchronously) Delete an SSH keypair from a user. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
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) + throws ApiException { + + okhttp3.Call localVarCall = deleteKeyPairValidateBeforeCall(keypairName, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteNetwork + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 deleteNetworkCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + 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 = + "/v1/projects/{projectId}/networks/{networkId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteNetworkValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 deleteNetwork(Async)"); + } + + // verify the required parameter 'networkId' is set + if (networkId == null) { + throw new ApiException( + "Missing the required parameter 'networkId' when calling deleteNetwork(Async)"); + } + + return deleteNetworkCall(projectId, networkId, _callback); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 deleteNetwork( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID networkId) + throws ApiException { + deleteNetworkWithHttpInfo(projectId, networkId); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 deleteNetworkWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID networkId) + throws ApiException { + okhttp3.Call localVarCall = deleteNetworkValidateBeforeCall(projectId, networkId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 deleteNetworkAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteNetworkValidateBeforeCall(projectId, networkId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteNetworkArea + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 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 deleteNetworkAreaCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + 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 = + "/v1/organizations/{organizationId}/network-areas/{areaId}" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteNetworkAreaValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + 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 deleteNetworkArea(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling deleteNetworkArea(Async)"); + } + + return deleteNetworkAreaCall(organizationId, areaId, _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. + * + * @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
202 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 deleteNetworkArea( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + throws ApiException { + deleteNetworkAreaWithHttpInfo(organizationId, areaId); + } + + /** + * 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 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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 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 deleteNetworkAreaWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + throws ApiException { + okhttp3.Call localVarCall = + deleteNetworkAreaValidateBeforeCall(organizationId, areaId, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 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 deleteNetworkAreaAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteNetworkAreaValidateBeforeCall(organizationId, areaId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteNetworkAreaRange + * + * @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 + * @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 Delete request for network range 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 deleteNetworkAreaRangeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID networkRangeId, + 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 = + "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "networkRangeId" + "}", + localVarApiClient.escapeString(networkRangeId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteNetworkAreaRangeValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID networkRangeId, + 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 deleteNetworkAreaRange(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' 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 deleteNetworkAreaRangeCall(organizationId, areaId, networkRangeId, _callback); + } + + /** + * Delete a network range. Delete a network range of a network area. The deletion will fail if + * the network range is still used. + * + * @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) + * @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. -
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) + throws ApiException { + deleteNetworkAreaRangeWithHttpInfo(organizationId, areaId, networkRangeId); + } + + /** + * Delete a network range. Delete a network range of a network area. The deletion will fail if + * the network range is still used. + * + * @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<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 Delete request for network range 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 deleteNetworkAreaRangeWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID networkRangeId) + throws ApiException { + okhttp3.Call localVarCall = + deleteNetworkAreaRangeValidateBeforeCall( + organizationId, areaId, networkRangeId, 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. + * + * @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 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 Delete request for network range 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 deleteNetworkAreaRangeAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID networkRangeId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteNetworkAreaRangeValidateBeforeCall( + organizationId, areaId, networkRangeId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteNetworkAreaRoute + * + * @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 _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 Delete request for network route 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 deleteNetworkAreaRouteCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID routeId, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "routeId" + "}", + localVarApiClient.escapeString(routeId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteNetworkAreaRouteValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID routeId, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException( + "Missing the required parameter 'organizationId' when calling 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) { + throw new ApiException( + "Missing the required parameter 'routeId' when calling deleteNetworkAreaRoute(Async)"); + } + + return deleteNetworkAreaRouteCall(organizationId, areaId, routeId, _callback); + } + + /** + * Delete a network route. Delete a network route of a network area. + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 Delete request for network route 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 deleteNetworkAreaRoute( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID routeId) + throws ApiException { + deleteNetworkAreaRouteWithHttpInfo(organizationId, areaId, routeId); + } + + /** + * Delete a network route. Delete a network route of a network area. + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 Delete request for network route 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 deleteNetworkAreaRouteWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID routeId) + throws ApiException { + okhttp3.Call localVarCall = + deleteNetworkAreaRouteValidateBeforeCall(organizationId, areaId, routeId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a network route. (asynchronously) Delete a network route of a network area. + * + * @param organizationId The identifier (ID) of a STACKIT Organization. (required) + * @param areaId The identifier (ID) of a STACKIT Network Area. (required) + * @param routeId The identifier (ID) of a STACKIT Route. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 Delete request for network route 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 deleteNetworkAreaRouteAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID routeId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteNetworkAreaRouteValidateBeforeCall( + organizationId, areaId, routeId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteNic + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Network interface 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteNicCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, + 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 = + "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteNicValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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)"); + } + + // 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 deleteNicCall(projectId, networkId, nicId, _callback); + } + + /** + * 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 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. -
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 deleteNic( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId) + throws ApiException { + deleteNicWithHttpInfo(projectId, networkId, nicId); + } + + /** + * 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 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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse deleteNicWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId) + throws ApiException { + okhttp3.Call localVarCall = deleteNicValidateBeforeCall(projectId, networkId, nicId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteNicAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteNicValidateBeforeCall(projectId, networkId, nicId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deletePublicIP + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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, + 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 = + "/v1/projects/{projectId}/public-ips/{publicIpId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deletePublicIPValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 deletePublicIPCall(projectId, publicIpId, _callback); + } + + /** + * 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 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 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. -
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) + throws ApiException { + deletePublicIPWithHttpInfo(projectId, publicIpId); + } + + /** + * 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 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
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. -
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) + throws ApiException { + okhttp3.Call localVarCall = deletePublicIPValidateBeforeCall(projectId, publicIpId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deletePublicIPValidateBeforeCall(projectId, publicIpId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteSecurityGroup + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 deleteSecurityGroupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + 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 = + "/v1/projects/{projectId}/security-groups/{securityGroupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSecurityGroupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 deleteSecurityGroupCall(projectId, securityGroupId, _callback); + } + + /** + * Delete security group. Delete a security group. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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 void deleteSecurityGroup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId) + throws ApiException { + deleteSecurityGroupWithHttpInfo(projectId, securityGroupId); + } + + /** + * Delete security group. Delete a security group. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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 deleteSecurityGroupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId) + throws ApiException { + okhttp3.Call localVarCall = + deleteSecurityGroupValidateBeforeCall(projectId, securityGroupId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete security group. (asynchronously) Delete a security group. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 deleteSecurityGroupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteSecurityGroupValidateBeforeCall(projectId, securityGroupId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteSecurityGroupRule + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Delete request for security group rule 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 deleteSecurityGroupRuleCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId, + 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 = + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())) + .replace( + "{" + "securityGroupRuleId" + "}", + localVarApiClient.escapeString(securityGroupRuleId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSecurityGroupRuleValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 deleteSecurityGroupRuleCall( + projectId, securityGroupId, securityGroupRuleId, _callback); + } + + /** + * Delete security group rule. Delete a security group rule. + * + * @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) + * @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. -
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 deleteSecurityGroupRule( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId) + throws ApiException { + deleteSecurityGroupRuleWithHttpInfo(projectId, securityGroupId, securityGroupRuleId); + } + + /** + * Delete security group rule. Delete a security group rule. + * + * @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<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Delete request for security group rule 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 deleteSecurityGroupRuleWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId) + throws ApiException { + okhttp3.Call localVarCall = + deleteSecurityGroupRuleValidateBeforeCall( + projectId, securityGroupId, securityGroupRuleId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete security group rule. (asynchronously) Delete a security group rule. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Delete request for security group rule 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 deleteSecurityGroupRuleAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteSecurityGroupRuleValidateBeforeCall( + projectId, securityGroupId, securityGroupRuleId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteServer + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
204 Delete request for server 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 deleteServerCall( + @javax.annotation.Nonnull UUID projectId, + @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 = + "/v1/projects/{projectId}/servers/{serverId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 deleteServer(Async)"); + } + + // 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, serverId, _callback); + } + + /** + * Delete a server. Delete a server. Volumes won't be deleted. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 Delete request for server 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 deleteServer( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + throws ApiException { + deleteServerWithHttpInfo(projectId, serverId); + } + + /** + * Delete a server. Delete a server. Volumes won't be deleted. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
204 Delete request for server 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 deleteServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + throws ApiException { + okhttp3.Call localVarCall = deleteServerValidateBeforeCall(projectId, serverId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a server. (asynchronously) Delete a server. Volumes won't be deleted. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
204 Delete request for server 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 deleteServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = deleteServerValidateBeforeCall(projectId, serverId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteSnapshot + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Snapshot 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteSnapshotCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID snapshotId, + 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 = + "/v1/projects/{projectId}/snapshots/{snapshotId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "snapshotId" + "}", + localVarApiClient.escapeString(snapshotId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSnapshotValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 deleteSnapshot(Async)"); + } + + // verify the required parameter 'snapshotId' is set + if (snapshotId == null) { + throw new ApiException( + "Missing the required parameter 'snapshotId' when calling deleteSnapshot(Async)"); + } + + return deleteSnapshotCall(projectId, snapshotId, _callback); + } + + /** + * Delete a snapshot. Delete a snapshot 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) + * @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 Snapshot 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. -
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) + throws ApiException { + deleteSnapshotWithHttpInfo(projectId, snapshotId); + } + + /** + * Delete a snapshot. Delete a snapshot 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) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Snapshot 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. -
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) + throws ApiException { + okhttp3.Call localVarCall = deleteSnapshotValidateBeforeCall(projectId, snapshotId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a snapshot. (asynchronously) Delete a snapshot 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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Snapshot 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call deleteSnapshotAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID snapshotId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteSnapshotValidateBeforeCall(projectId, snapshotId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for deleteVolume + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 deleteVolumeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + 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 = + "/v1/projects/{projectId}/volumes/{volumeId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteVolumeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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, volumeId, _callback); + } + + /** + * Delete a volume. Delete a volume inside a project. The deletion will fail if the volume is + * still in use. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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 void deleteVolume( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID volumeId) + throws ApiException { + deleteVolumeWithHttpInfo(projectId, volumeId); + } + + /** + * Delete a volume. Delete a volume inside a project. The deletion will fail if the volume is + * still in use. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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 deleteVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID volumeId) + throws ApiException { + okhttp3.Call localVarCall = deleteVolumeValidateBeforeCall(projectId, volumeId, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 deleteVolumeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = deleteVolumeValidateBeforeCall(projectId, volumeId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for getAffinityGroup + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show affinity group details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getAffinityGroupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID affinityGroupId, + 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 = + "/v1/projects/{projectId}/affinity-groups/{affinityGroupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "affinityGroupId" + "}", + localVarApiClient.escapeString(affinityGroupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAffinityGroupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 getAffinityGroupCall(projectId, affinityGroupId, _callback); + } + + /** + * Get the affinity group. Get the affinity group created 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 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
200 Show affinity group details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public AffinityGroup getAffinityGroup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID affinityGroupId) + throws ApiException { + ApiResponse localVarResp = + getAffinityGroupWithHttpInfo(projectId, affinityGroupId); + return localVarResp.getData(); + } + + /** + * Get the affinity group. Get the affinity group created 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<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
200 Show affinity group details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getAffinityGroupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID affinityGroupId) + throws ApiException { + okhttp3.Call localVarCall = + getAffinityGroupValidateBeforeCall(projectId, affinityGroupId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the affinity group. (asynchronously) Get the affinity group created 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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show affinity group details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getAffinityGroupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID affinityGroupId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getAffinityGroupValidateBeforeCall(projectId, affinityGroupId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getAttachedVolume + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get details about a volume attachment. -
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 getAttachedVolumeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAttachedVolumeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 getAttachedVolumeCall(projectId, serverId, volumeId, _callback); + } + + /** + * Get Volume Attachment details. Get the details of an existing Volume Attachment. + * + * @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 + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get details about a volume attachment. -
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 getAttachedVolume( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId) + throws ApiException { + ApiResponse localVarResp = + getAttachedVolumeWithHttpInfo(projectId, serverId, volumeId); + return localVarResp.getData(); + } + + /** + * Get Volume Attachment details. Get the details of an existing Volume Attachment. + * + * @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> + * @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 details about a volume attachment. -
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 getAttachedVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId) + throws ApiException { + okhttp3.Call localVarCall = + getAttachedVolumeValidateBeforeCall(projectId, serverId, volumeId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Volume Attachment details. (asynchronously) Get the details of an existing Volume + * Attachment. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get details about a volume attachment. -
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 getAttachedVolumeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getAttachedVolumeValidateBeforeCall(projectId, serverId, volumeId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getBackup + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
200 Show backup details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getBackupCall( + @javax.annotation.Nonnull UUID projectId, + @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 = + "/v1/projects/{projectId}/backups/{backupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBackupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 getBackup(Async)"); + } + + // 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, backupId, _callback); + } + + /** + * Get details about a backup. Get details about a block device backup. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show backup details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Backup getBackup( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID backupId) + throws ApiException { + ApiResponse localVarResp = getBackupWithHttpInfo(projectId, backupId); + return localVarResp.getData(); + } + + /** + * Get details about a backup. Get details about a block device backup. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show backup details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getBackupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID backupId) + throws ApiException { + okhttp3.Call localVarCall = getBackupValidateBeforeCall(projectId, backupId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get details about a backup. (asynchronously) Get details about a block device backup. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
200 Show backup details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getBackupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID backupId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getBackupValidateBeforeCall(projectId, backupId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getImage + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show Image details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getImageCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + 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 = + "/v1/projects/{projectId}/images/{imageId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getImageValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 getImage(Async)"); + } + + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException( + "Missing the required parameter 'imageId' when calling getImage(Async)"); + } + + return getImageCall(projectId, imageId, _callback); + } + + /** + * Get details about an image. Get details about a specific Image inside a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show Image details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Image getImage( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + throws ApiException { + ApiResponse localVarResp = getImageWithHttpInfo(projectId, imageId); + return localVarResp.getData(); + } + + /** + * Get details about an image. Get details about a specific Image inside a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show Image details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getImageWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + throws ApiException { + okhttp3.Call localVarCall = getImageValidateBeforeCall(projectId, imageId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get details about an image. (asynchronously) Get details about a specific Image inside a + * project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show Image details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getImageAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getImageValidateBeforeCall(projectId, imageId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getImageShare + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show Image share details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getImageShareCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + 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 = + "/v1/projects/{projectId}/images/{imageId}/share" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getImageShareValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 getImageShare(Async)"); + } + + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException( + "Missing the required parameter 'imageId' when calling getImageShare(Async)"); + } + + return getImageShareCall(projectId, imageId, _callback); + } + + /** + * Get share details of an image. Get share details about an shared image. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show Image share details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ImageShare getImageShare( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + throws ApiException { + ApiResponse localVarResp = getImageShareWithHttpInfo(projectId, imageId); + return localVarResp.getData(); + } + + /** + * Get share details of an image. Get share details about an shared image. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show Image share details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getImageShareWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + throws ApiException { + okhttp3.Call localVarCall = getImageShareValidateBeforeCall(projectId, imageId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get share details of an image. (asynchronously) Get share details about an shared image. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show Image share details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getImageShareAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getImageShareValidateBeforeCall(projectId, imageId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getImageShareConsumer + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show Image share consumer details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getImageShareConsumerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId, + 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 = + "/v1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "imageId" + "}", + localVarApiClient.escapeString(imageId.toString())) + .replace( + "{" + "consumerProjectId" + "}", + localVarApiClient.escapeString(consumerProjectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getImageShareConsumerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 getImageShareConsumer(Async)"); + } + + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException( + "Missing the required parameter 'imageId' when calling getImageShareConsumer(Async)"); + } + + // 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, imageId, consumerProjectId, _callback); + } + + /** + * Get image share consumer. Get details about an image share consumer. + * + * @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 + * @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 Image share consumer details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ImageShareConsumer getImageShareConsumer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId) + throws ApiException { + ApiResponse localVarResp = + getImageShareConsumerWithHttpInfo(projectId, imageId, consumerProjectId); + return localVarResp.getData(); + } + + /** + * Get image share consumer. Get details about an image share consumer. + * + * @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> + * @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 Image share consumer details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getImageShareConsumerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId) + throws ApiException { + okhttp3.Call localVarCall = + getImageShareConsumerValidateBeforeCall( + projectId, imageId, consumerProjectId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get image share consumer. (asynchronously) Get details about an image share consumer. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show Image share consumer details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getImageShareConsumerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + @javax.annotation.Nonnull UUID consumerProjectId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getImageShareConsumerValidateBeforeCall( + projectId, imageId, consumerProjectId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getKeyPair + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show SSH keypair details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getKeyPairCall( + @javax.annotation.Nonnull String keypairName, 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 = + "/v1/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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getKeyPairValidateBeforeCall( + @javax.annotation.Nonnull String keypairName, 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 getKeyPair(Async)"); + } + + return getKeyPairCall(keypairName, _callback); + } + + /** + * Get SSH keypair details. Get details about an SSH keypair. + * + * @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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show SSH keypair details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Keypair getKeyPair(@javax.annotation.Nonnull String keypairName) throws ApiException { + ApiResponse localVarResp = getKeyPairWithHttpInfo(keypairName); + return localVarResp.getData(); + } + + /** + * Get SSH keypair details. Get details about an SSH keypair. + * + * @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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show SSH keypair details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getKeyPairWithHttpInfo(@javax.annotation.Nonnull String keypairName) + throws ApiException { + okhttp3.Call localVarCall = getKeyPairValidateBeforeCall(keypairName, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get SSH keypair details. (asynchronously) Get details about an SSH keypair. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show SSH keypair details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getKeyPairAsync( + @javax.annotation.Nonnull String keypairName, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getKeyPairValidateBeforeCall(keypairName, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getMachineType + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show machine type details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getMachineTypeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String machineType, + 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 = + "/v1/projects/{projectId}/machine-types/{machineType}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "machineType" + "}", + localVarApiClient.escapeString(machineType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMachineTypeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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, machineType, _callback); + } + + /** + * Get details about a machine type. Get details about a specific machine type. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show machine type details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public MachineType getMachineType( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String machineType) + throws ApiException { + ApiResponse localVarResp = getMachineTypeWithHttpInfo(projectId, machineType); + return localVarResp.getData(); + } + + /** + * Get details about a machine type. Get details about a specific machine type. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show machine type details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getMachineTypeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String machineType) + throws ApiException { + okhttp3.Call localVarCall = getMachineTypeValidateBeforeCall(projectId, machineType, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show machine type details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getMachineTypeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String machineType, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getMachineTypeValidateBeforeCall(projectId, machineType, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getNetwork + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getNetworkCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + 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 = + "/v1/projects/{projectId}/networks/{networkId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNetworkValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 getNetwork(Async)"); + } + + // 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, networkId, _callback); + } + + /** + * Get network details. Get details about a network of a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Network getNetwork( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID networkId) + throws ApiException { + ApiResponse localVarResp = getNetworkWithHttpInfo(projectId, networkId); + return localVarResp.getData(); + } + + /** + * Get network details. Get details about a network of a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getNetworkWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID networkId) + throws ApiException { + okhttp3.Call localVarCall = getNetworkValidateBeforeCall(projectId, networkId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get network details. (asynchronously) Get details about a network of a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getNetworkAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getNetworkValidateBeforeCall(projectId, networkId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getNetworkArea + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network area details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getNetworkAreaCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + 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 = + "/v1/organizations/{organizationId}/network-areas/{areaId}" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNetworkAreaValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + 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 getNetworkArea(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling getNetworkArea(Async)"); + } + + return getNetworkAreaCall(organizationId, areaId, _callback); + } + + /** + * Get details about a network area. Get details about a network area in an organization. + * + * @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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network area details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public NetworkArea getNetworkArea( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + throws ApiException { + ApiResponse localVarResp = getNetworkAreaWithHttpInfo(organizationId, areaId); + return localVarResp.getData(); + } + + /** + * Get details about a network area. Get details about a network area in an organization. + * + * @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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network area details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getNetworkAreaWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + throws ApiException { + okhttp3.Call localVarCall = getNetworkAreaValidateBeforeCall(organizationId, areaId, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network area details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getNetworkAreaAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getNetworkAreaValidateBeforeCall(organizationId, areaId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getNetworkAreaRange + * + * @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 + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network range details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getNetworkAreaRangeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID networkRangeId, + 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 = + "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "networkRangeId" + "}", + localVarApiClient.escapeString(networkRangeId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNetworkAreaRangeValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID networkRangeId, + 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 getNetworkAreaRange(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' 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 getNetworkAreaRangeCall(organizationId, areaId, networkRangeId, _callback); + } + + /** + * Get details about a network range. Get details about a network range 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network range details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public NetworkRange getNetworkAreaRange( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID networkRangeId) + throws ApiException { + ApiResponse localVarResp = + getNetworkAreaRangeWithHttpInfo(organizationId, areaId, networkRangeId); + return localVarResp.getData(); + } + + /** + * Get details about a network range. Get details about a network range 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network range details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getNetworkAreaRangeWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID networkRangeId) + throws ApiException { + okhttp3.Call localVarCall = + getNetworkAreaRangeValidateBeforeCall(organizationId, areaId, networkRangeId, 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. + * + * @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 The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network range details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getNetworkAreaRangeAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID networkRangeId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getNetworkAreaRangeValidateBeforeCall( + organizationId, areaId, networkRangeId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getNetworkAreaRoute + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show route details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
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, + 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 = + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())) + .replace( + "{" + "routeId" + "}", + localVarApiClient.escapeString(routeId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNetworkAreaRouteValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nonnull UUID routeId, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException( + "Missing the required parameter 'organizationId' when calling getNetworkAreaRoute(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' 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 getNetworkAreaRouteCall(organizationId, areaId, routeId, _callback); + } + + /** + * Get details about a network route. Get details about 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 routeId The identifier (ID) of a STACKIT Route. (required) + * @return Route + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show route details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
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) + throws ApiException { + ApiResponse localVarResp = + getNetworkAreaRouteWithHttpInfo(organizationId, areaId, routeId); + return localVarResp.getData(); + } + + /** + * Get details about a network route. Get details about 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 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 Show route details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
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) + throws ApiException { + okhttp3.Call localVarCall = + getNetworkAreaRouteValidateBeforeCall(organizationId, areaId, routeId, 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. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show route details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
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) + throws ApiException { + + okhttp3.Call localVarCall = + getNetworkAreaRouteValidateBeforeCall(organizationId, areaId, routeId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getNic + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network interface details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getNicCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, + 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 = + "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNicValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 getNicCall(projectId, networkId, nicId, _callback); + } + + /** + * Get details about a network interface of a network. Get details about a network interface + * inside a network. + * + * @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 + * @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 network interface details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public NIC getNic( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId) + throws ApiException { + ApiResponse localVarResp = getNicWithHttpInfo(projectId, networkId, nicId); + return localVarResp.getData(); + } + + /** + * Get details about a network interface of a network. Get details about a network interface + * inside a network. + * + * @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> + * @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 network interface details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getNicWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId) + throws ApiException { + okhttp3.Call localVarCall = getNicValidateBeforeCall(projectId, networkId, nicId, 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. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show network interface details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getNicAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull UUID nicId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getNicValidateBeforeCall(projectId, networkId, nicId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getOrganizationRequest + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show organization request details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getOrganizationRequestCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull String requestId, + 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 = + "/v1/organizations/{organizationId}/requests/{requestId}" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "requestId" + "}", + localVarApiClient.escapeString(requestId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrganizationRequestValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull String requestId, + 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) { + throw new ApiException( + "Missing the required parameter 'requestId' when calling getOrganizationRequest(Async)"); + } + + return getOrganizationRequestCall(organizationId, requestId, _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. + * + * @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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show organization request details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Request getOrganizationRequest( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull String requestId) + throws ApiException { + ApiResponse localVarResp = + getOrganizationRequestWithHttpInfo(organizationId, requestId); + 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. + * + * @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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show organization request details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getOrganizationRequestWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull String requestId) + throws ApiException { + okhttp3.Call localVarCall = + getOrganizationRequestValidateBeforeCall(organizationId, requestId, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show organization request details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getOrganizationRequestAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull String requestId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getOrganizationRequestValidateBeforeCall(organizationId, requestId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getProjectDetails + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show project details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getProjectDetailsCall( + @javax.annotation.Nonnull UUID projectId, 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 = + "/v1/projects/{projectId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call 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 getProjectDetails(Async)"); + } + + return getProjectDetailsCall(projectId, _callback); + } + + /** + * Get project details. Get details about a STACKIT project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @return Project + * @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 project details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Project getProjectDetails(@javax.annotation.Nonnull UUID projectId) throws ApiException { + ApiResponse localVarResp = getProjectDetailsWithHttpInfo(projectId); + return localVarResp.getData(); + } + + /** + * Get project details. Get details about a STACKIT project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @return ApiResponse<Project> + * @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 project details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse 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 project details. (asynchronously) Get details about a STACKIT project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show project details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getProjectDetailsAsync( + @javax.annotation.Nonnull UUID projectId, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getProjectDetailsValidateBeforeCall(projectId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getProjectNIC + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show details of network interface. -
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 getProjectNICCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID nicId, + 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 = + "/v1/projects/{projectId}/nics/{nicId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getProjectNICValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 getProjectNICCall(projectId, nicId, _callback); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show details of network interface. -
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 NIC getProjectNIC( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID nicId) + throws ApiException { + ApiResponse localVarResp = getProjectNICWithHttpInfo(projectId, nicId); + return localVarResp.getData(); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show details of network interface. -
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 getProjectNICWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID nicId) + throws ApiException { + okhttp3.Call localVarCall = getProjectNICValidateBeforeCall(projectId, nicId, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show details of network interface. -
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 getProjectNICAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID nicId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getProjectNICValidateBeforeCall(projectId, nicId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getProjectRequest + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show project request details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getProjectRequestCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String requestId, + 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 = + "/v1/projects/{projectId}/requests/{requestId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "requestId" + "}", + localVarApiClient.escapeString(requestId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getProjectRequestValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 getProjectRequestCall(projectId, requestId, _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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show project request details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Request getProjectRequest( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String requestId) + throws ApiException { + ApiResponse localVarResp = getProjectRequestWithHttpInfo(projectId, requestId); + 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show project request details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getProjectRequestWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull String requestId) + throws ApiException { + okhttp3.Call localVarCall = getProjectRequestValidateBeforeCall(projectId, requestId, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show project request details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getProjectRequestAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String requestId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getProjectRequestValidateBeforeCall(projectId, requestId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getPublicIP + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show public IP details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getPublicIPCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID publicIpId, + 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 = + "/v1/projects/{projectId}/public-ips/{publicIpId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPublicIPValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 getPublicIPCall(projectId, publicIpId, _callback); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show public IP details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public PublicIp getPublicIP( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID publicIpId) + throws ApiException { + ApiResponse localVarResp = getPublicIPWithHttpInfo(projectId, publicIpId); + return localVarResp.getData(); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show public IP details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getPublicIPWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID publicIpId) + throws ApiException { + okhttp3.Call localVarCall = getPublicIPValidateBeforeCall(projectId, publicIpId, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show public IP details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getPublicIPAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID publicIpId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getPublicIPValidateBeforeCall(projectId, publicIpId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getSecurityGroup + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show security group details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getSecurityGroupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + 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 = + "/v1/projects/{projectId}/security-groups/{securityGroupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSecurityGroupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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, securityGroupId, _callback); + } + + /** + * Get security group details. Get details about a security group of a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show security group details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public SecurityGroup getSecurityGroup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId) + throws ApiException { + ApiResponse localVarResp = + getSecurityGroupWithHttpInfo(projectId, securityGroupId); + return localVarResp.getData(); + } + + /** + * Get security group details. Get details about a security group of 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<SecurityGroup> + * @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 security group details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getSecurityGroupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId) + throws ApiException { + okhttp3.Call localVarCall = + getSecurityGroupValidateBeforeCall(projectId, securityGroupId, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show security group details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getSecurityGroupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getSecurityGroupValidateBeforeCall(projectId, securityGroupId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getSecurityGroupRule + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show security group rule details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getSecurityGroupRuleCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId, + 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 = + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())) + .replace( + "{" + "securityGroupRuleId" + "}", + localVarApiClient.escapeString(securityGroupRuleId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSecurityGroupRuleValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 getSecurityGroupRuleCall(projectId, securityGroupId, securityGroupRuleId, _callback); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show security group rule details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public SecurityGroupRule getSecurityGroupRule( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId) + throws ApiException { + ApiResponse localVarResp = + getSecurityGroupRuleWithHttpInfo(projectId, securityGroupId, securityGroupRuleId); + return localVarResp.getData(); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show security group rule details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getSecurityGroupRuleWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId) + throws ApiException { + okhttp3.Call localVarCall = + getSecurityGroupRuleValidateBeforeCall( + projectId, securityGroupId, securityGroupRuleId, 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. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show security group rule details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getSecurityGroupRuleAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UUID securityGroupRuleId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getSecurityGroupRuleValidateBeforeCall( + projectId, securityGroupId, securityGroupRuleId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getServer + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show server details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Boolean details, + 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 = + "/v1/projects/{projectId}/servers/{serverId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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(); + + if (details != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("details", details)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 getServerCall(projectId, serverId, details, _callback); + } + + /** + * Get server details. Get details about a server by its ID. + * + * @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 + * @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 server details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Server getServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Boolean details) + throws ApiException { + ApiResponse localVarResp = getServerWithHttpInfo(projectId, serverId, details); + return localVarResp.getData(); + } + + /** + * Get server details. Get details about a server by its ID. + * + * @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> + * @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 server details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Boolean details) + throws ApiException { + okhttp3.Call localVarCall = getServerValidateBeforeCall(projectId, serverId, details, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get server details. (asynchronously) Get details about a server by its ID. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show server details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Boolean details, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getServerValidateBeforeCall(projectId, serverId, details, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getServerConsole + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
200 Show server console URL. -
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 getServerConsoleCall( + @javax.annotation.Nonnull UUID projectId, + @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 = + "/v1/projects/{projectId}/servers/{serverId}/console" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getServerConsoleValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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, serverId, _callback); + } + + /** + * Get server console. Get a URL for server remote console. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show server console URL. -
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 ServerConsoleUrl getServerConsole( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + throws ApiException { + ApiResponse localVarResp = + getServerConsoleWithHttpInfo(projectId, serverId); + return localVarResp.getData(); + } + + /** + * Get server console. Get a URL for server remote console. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show server console URL. -
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 getServerConsoleWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + throws ApiException { + okhttp3.Call localVarCall = getServerConsoleValidateBeforeCall(projectId, serverId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get server console. (asynchronously) Get a URL for server remote console. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
200 Show server console URL. -
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 getServerConsoleAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getServerConsoleValidateBeforeCall(projectId, serverId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getServerLog + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show server console log. -
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 getServerLogCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Long length, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/log" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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(); + + if (length != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("length", length)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getServerLogValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 getServerLogCall(projectId, serverId, length, _callback); + } + + /** + * Get server log. Get server console log. + * + * @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 + * @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 server console log. -
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 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); + return localVarResp.getData(); + } + + /** + * Get server log. Get server console log. + * + * @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> + * @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 server console log. -
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 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(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get server log. (asynchronously) Get server console log. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show server console log. -
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 getServerLogAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable Long length, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getServerLogValidateBeforeCall(projectId, serverId, length, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getSnapshot + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show snapshot details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getSnapshotCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID snapshotId, + 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 = + "/v1/projects/{projectId}/snapshots/{snapshotId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "snapshotId" + "}", + localVarApiClient.escapeString(snapshotId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSnapshotValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 getSnapshot(Async)"); + } + + // 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, snapshotId, _callback); + } + + /** + * Get details about a snapshot. Get details about a block device snapshot. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show snapshot details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Snapshot getSnapshot( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID snapshotId) + throws ApiException { + ApiResponse localVarResp = getSnapshotWithHttpInfo(projectId, snapshotId); + return localVarResp.getData(); + } + + /** + * Get details about a snapshot. Get details about a block device snapshot. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show snapshot details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getSnapshotWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID snapshotId) + throws ApiException { + okhttp3.Call localVarCall = getSnapshotValidateBeforeCall(projectId, snapshotId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get details about a snapshot. (asynchronously) Get details about a block device snapshot. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show snapshot details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getSnapshotAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID snapshotId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getSnapshotValidateBeforeCall(projectId, snapshotId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getVolume + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show volume details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getVolumeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + 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 = + "/v1/projects/{projectId}/volumes/{volumeId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getVolumeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 getVolume(Async)"); + } + + // 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, volumeId, _callback); + } + + /** + * Get details about a volume. Get details about a block device volume. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show volume details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public Volume getVolume( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID volumeId) + throws ApiException { + ApiResponse localVarResp = getVolumeWithHttpInfo(projectId, volumeId); + return localVarResp.getData(); + } + + /** + * Get details about a volume. Get details about a block device volume. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show volume details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID volumeId) + throws ApiException { + okhttp3.Call localVarCall = getVolumeValidateBeforeCall(projectId, volumeId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get details about a volume. (asynchronously) Get details about a block device volume. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show volume details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getVolumeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getVolumeValidateBeforeCall(projectId, volumeId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getVolumePerformanceClass + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show volume performance class details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getVolumePerformanceClassCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String volumePerformanceClass, + 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 = + "/v1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "volumePerformanceClass" + "}", + localVarApiClient.escapeString(volumePerformanceClass.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getVolumePerformanceClassValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String volumePerformanceClass, + 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)"); + } + + // verify the required parameter 'volumePerformanceClass' is set + if (volumePerformanceClass == null) { + throw new ApiException( + "Missing the required parameter 'volumePerformanceClass' when calling getVolumePerformanceClass(Async)"); + } + + return getVolumePerformanceClassCall(projectId, volumePerformanceClass, _callback); + } + + /** + * Get details about a volume performance class. Get details about a specific volume performance + * class. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show volume performance class details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public VolumePerformanceClass getVolumePerformanceClass( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String volumePerformanceClass) + throws ApiException { + ApiResponse localVarResp = + getVolumePerformanceClassWithHttpInfo(projectId, volumePerformanceClass); + return localVarResp.getData(); + } + + /** + * Get details about a volume performance class. Get details about a specific volume performance + * class. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show volume performance class details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse getVolumePerformanceClassWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String volumePerformanceClass) + throws ApiException { + okhttp3.Call localVarCall = + getVolumePerformanceClassValidateBeforeCall( + projectId, volumePerformanceClass, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Show volume performance class details. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call getVolumePerformanceClassAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull String volumePerformanceClass, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getVolumePerformanceClassValidateBeforeCall( + projectId, volumePerformanceClass, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listAffinityGroups + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 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 listAffinityGroupsCall( + @javax.annotation.Nonnull UUID projectId, 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 = + "/v1/projects/{projectId}/affinity-groups" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAffinityGroupsValidateBeforeCall( + @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 listAffinityGroups(Async)"); + } + + return listAffinityGroupsCall(projectId, _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). + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 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 AffinityGroupListResponse listAffinityGroups(@javax.annotation.Nonnull UUID projectId) + throws ApiException { + ApiResponse localVarResp = + listAffinityGroupsWithHttpInfo(projectId); + 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). + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 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 listAffinityGroupsWithHttpInfo( + @javax.annotation.Nonnull UUID projectId) throws ApiException { + okhttp3.Call localVarCall = listAffinityGroupsValidateBeforeCall(projectId, 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). + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List 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 listAffinityGroupsAsync( + @javax.annotation.Nonnull UUID projectId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = listAffinityGroupsValidateBeforeCall(projectId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listAttachedVolumes + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
200 List volume attachments. -
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 listAttachedVolumesCall( + @javax.annotation.Nonnull UUID projectId, + @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 = + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAttachedVolumesValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 listAttachedVolumesCall(projectId, serverId, _callback); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List volume attachments. -
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 VolumeAttachmentListResponse listAttachedVolumes( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + throws ApiException { + ApiResponse localVarResp = + listAttachedVolumesWithHttpInfo(projectId, serverId); + return localVarResp.getData(); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List volume attachments. -
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 listAttachedVolumesWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID serverId) + throws ApiException { + okhttp3.Call localVarCall = + listAttachedVolumesValidateBeforeCall(projectId, serverId, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
200 List volume attachments. -
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 listAttachedVolumesAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listAttachedVolumesValidateBeforeCall(projectId, serverId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listAvailabilityZones + * + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get a list of availability zones. -
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 listAvailabilityZonesCall(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 = "/v1/availability-zones"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAvailabilityZonesValidateBeforeCall(final ApiCallback _callback) + throws ApiException { + return listAvailabilityZonesCall(_callback); + } + + /** + * List all availability zones. Get a list of all availability zones. + * + * @return AvailabilityZoneListResponse + * @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 availability zones. -
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 AvailabilityZoneListResponse listAvailabilityZones() throws ApiException { + ApiResponse localVarResp = + listAvailabilityZonesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List all availability zones. Get a list of all availability zones. + * + * @return ApiResponse<AvailabilityZoneListResponse> + * @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 availability zones. -
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 listAvailabilityZonesWithHttpInfo() + throws ApiException { + okhttp3.Call localVarCall = listAvailabilityZonesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List all availability zones. (asynchronously) Get a list of all availability zones. + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get a list of availability zones. -
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 listAvailabilityZonesAsync( + final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listAvailabilityZonesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listBackups + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List project backups. -
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 listBackupsCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/backups" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listBackupsValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 listBackups(Async)"); + } + + return listBackupsCall(projectId, labelSelector, _callback); + } + + /** + * List all backups inside a project. Get a list of all backups inside a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List project backups. -
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 BackupListResponse listBackups( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listBackupsWithHttpInfo(projectId, labelSelector); + return localVarResp.getData(); + } + + /** + * List all backups inside a project. Get a list of all backups inside a project. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List project backups. -
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 listBackupsWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + okhttp3.Call localVarCall = listBackupsValidateBeforeCall(projectId, labelSelector, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List project backups. -
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 listBackupsAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listBackupsValidateBeforeCall(projectId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listImages + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List project images. -
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 listImagesCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable Boolean all, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/images" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (all != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("all", all)); + } + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listImagesValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 listImages(Async)"); + } + + return listImagesCall(projectId, all, labelSelector, _callback); + } + + /** + * 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 all List all Images. (optional, default to false) + * @param labelSelector Filter resources by labels. (optional) + * @return ImageListResponse + * @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 project images. -
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 ImageListResponse listImages( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable Boolean all, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listImagesWithHttpInfo(projectId, all, labelSelector); + return localVarResp.getData(); + } + + /** + * 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 all List all Images. (optional, default to false) + * @param labelSelector Filter resources by labels. (optional) + * @return ApiResponse<ImageListResponse> + * @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 project images. -
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 listImagesWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable Boolean all, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + okhttp3.Call localVarCall = + listImagesValidateBeforeCall(projectId, all, labelSelector, 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. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List project images. -
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 listImagesAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable Boolean all, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listImagesValidateBeforeCall(projectId, all, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listKeyPairs + * + * @param labelSelector Filter resources by labels. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List SSH keypairs. -
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 listKeyPairsCall( + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/keypairs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listKeyPairsValidateBeforeCall( + @javax.annotation.Nullable String labelSelector, final ApiCallback _callback) + throws ApiException { + return listKeyPairsCall(labelSelector, _callback); + } + + /** + * 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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List SSH keypairs. -
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 KeyPairListResponse listKeyPairs(@javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = listKeyPairsWithHttpInfo(labelSelector); + return localVarResp.getData(); + } + + /** + * 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 ApiResponse<KeyPairListResponse> + * @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 SSH keypairs. -
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 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 all SSH keypairs for the requesting user. (asynchronously) Get a list of all SSH + * keypairs assigned to the requesting user. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List SSH keypairs. -
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 listKeyPairsAsync( + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = listKeyPairsValidateBeforeCall(labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listMachineTypes + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List of machine types. -
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 listMachineTypesCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String filter, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/machine-types" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (filter != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listMachineTypesValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 listMachineTypes(Async)"); + } + + return listMachineTypesCall(projectId, filter, _callback); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List of machine types. -
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 MachineTypeListResponse listMachineTypes( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nullable String filter) + throws ApiException { + ApiResponse localVarResp = + listMachineTypesWithHttpInfo(projectId, filter); + return localVarResp.getData(); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List of machine types. -
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 listMachineTypesWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nullable String filter) + throws ApiException { + okhttp3.Call localVarCall = listMachineTypesValidateBeforeCall(projectId, filter, 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. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List of machine types. -
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 listMachineTypesAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String filter, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listMachineTypesValidateBeforeCall(projectId, filter, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listNetworkAreaProjects + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List projects for a network area. -
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 listNetworkAreaProjectsCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + 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 = + "/v1/organizations/{organizationId}/network-areas/{areaId}/projects" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listNetworkAreaProjectsValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + 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 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 listNetworkAreaProjectsCall(organizationId, areaId, _callback); + } + + /** + * List all projects using a network area. Get a list of all projects using a network area. + * + * @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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List projects for a network area. -
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 ProjectListResponse listNetworkAreaProjects( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + throws ApiException { + ApiResponse localVarResp = + listNetworkAreaProjectsWithHttpInfo(organizationId, areaId); + return localVarResp.getData(); + } + + /** + * List all projects using a network area. Get a list of all projects using a network area. + * + * @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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List projects for a network area. -
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 listNetworkAreaProjectsWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + throws ApiException { + okhttp3.Call localVarCall = + listNetworkAreaProjectsValidateBeforeCall(organizationId, areaId, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List projects for a network area. -
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 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(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listNetworkAreaRanges + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List all network ranges. -
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 listNetworkAreaRangesCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + 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 = + "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listNetworkAreaRangesValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + 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 listNetworkAreaRanges(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling listNetworkAreaRanges(Async)"); + } + + return listNetworkAreaRangesCall(organizationId, areaId, _callback); + } + + /** + * List all network ranges in a network area. Get a list of all network ranges 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) + * @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
200 List all network ranges. -
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 NetworkRangeListResponse listNetworkAreaRanges( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + throws ApiException { + ApiResponse localVarResp = + listNetworkAreaRangesWithHttpInfo(organizationId, areaId); + return localVarResp.getData(); + } + + /** + * List all network ranges in a network area. Get a list of all network ranges 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) + * @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
200 List all network ranges. -
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 listNetworkAreaRangesWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, @javax.annotation.Nonnull UUID areaId) + throws ApiException { + okhttp3.Call localVarCall = + listNetworkAreaRangesValidateBeforeCall(organizationId, areaId, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List all network ranges. -
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 listNetworkAreaRangesAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listNetworkAreaRangesValidateBeforeCall(organizationId, areaId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listNetworkAreaRoutes + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listNetworkAreaRoutesCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listNetworkAreaRoutesValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException( + "Missing the required parameter 'organizationId' when calling listNetworkAreaRoutes(Async)"); + } + + // verify the required parameter 'areaId' is set + if (areaId == null) { + throw new ApiException( + "Missing the required parameter 'areaId' when calling listNetworkAreaRoutes(Async)"); + } + + return listNetworkAreaRoutesCall(organizationId, areaId, labelSelector, _callback); + } + + /** + * List all network routes in a network area. Get a list of all network routes 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public RouteListResponse listNetworkAreaRoutes( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listNetworkAreaRoutesWithHttpInfo(organizationId, areaId, labelSelector); + return localVarResp.getData(); + } + + /** + * List all network routes in a network area. Get a list of all network routes 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse listNetworkAreaRoutesWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + okhttp3.Call localVarCall = + listNetworkAreaRoutesValidateBeforeCall( + organizationId, areaId, labelSelector, 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. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network routes. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listNetworkAreaRoutesAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nonnull UUID areaId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listNetworkAreaRoutesValidateBeforeCall( + organizationId, areaId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listNetworkAreas + * + * @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 + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
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, + 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 = + "/v1/organizations/{organizationId}/network-areas" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listNetworkAreasValidateBeforeCall( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException( + "Missing the required parameter 'organizationId' when calling listNetworkAreas(Async)"); + } + + return listNetworkAreasCall(organizationId, labelSelector, _callback); + } + + /** + * List all network areas in an organization. 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) + * @return NetworkAreaListResponse + * @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. -
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 NetworkAreaListResponse listNetworkAreas( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listNetworkAreasWithHttpInfo(organizationId, labelSelector); + return localVarResp.getData(); + } + + /** + * List all network areas in an organization. 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) + * @return ApiResponse<NetworkAreaListResponse> + * @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. -
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 listNetworkAreasWithHttpInfo( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + okhttp3.Call localVarCall = + listNetworkAreasValidateBeforeCall(organizationId, labelSelector, 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. + * + * @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 + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get a list of all network areas. -
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 listNetworkAreasAsync( + @javax.annotation.Nonnull UUID organizationId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listNetworkAreasValidateBeforeCall(organizationId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listNetworks + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List all networks of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listNetworksCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/networks" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listNetworksValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 listNetworks(Async)"); + } + + return listNetworksCall(projectId, labelSelector, _callback); + } + + /** + * 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 labelSelector Filter resources by labels. (optional) + * @return NetworkListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List all networks of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public NetworkListResponse listNetworks( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listNetworksWithHttpInfo(projectId, labelSelector); + return localVarResp.getData(); + } + + /** + * 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 labelSelector Filter resources by labels. (optional) + * @return ApiResponse<NetworkListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List all networks of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse listNetworksWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + okhttp3.Call localVarCall = listNetworksValidateBeforeCall(projectId, labelSelector, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List all networks of a project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listNetworksAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listNetworksValidateBeforeCall(projectId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listNics + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network interfaces of the network. -
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 listNicsCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/networks/{networkId}/nics" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listNicsValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 listNicsCall(projectId, networkId, labelSelector, _callback); + } + + /** + * 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 networkId The identifier (ID) of a STACKIT Network. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network interfaces of the network. -
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 NICListResponse listNics( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listNicsWithHttpInfo(projectId, networkId, labelSelector); + return localVarResp.getData(); + } + + /** + * 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 networkId The identifier (ID) of a STACKIT Network. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network interfaces of the network. -
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 listNicsWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + okhttp3.Call localVarCall = + listNicsValidateBeforeCall(projectId, networkId, labelSelector, 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. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network interfaces of the network. -
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 listNicsAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listNicsValidateBeforeCall(projectId, networkId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listProjectNICs + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network interfaces of the project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listProjectNICsCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/nics" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listProjectNICsValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 listProjectNICs(Async)"); + } + + return listProjectNICsCall(projectId, labelSelector, _callback); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network interfaces of the project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public NICListResponse listProjectNICs( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listProjectNICsWithHttpInfo(projectId, labelSelector); + return localVarResp.getData(); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network interfaces of the project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public 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(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List network interfaces of the project. -
400 A bad request. -
401 A request which was not authorized. -
403 A request which was forbidden. -
404 The object was not found. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listProjectNICsAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listProjectNICsValidateBeforeCall(projectId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listPublicIPRanges + * + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List public IP ranges. -
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 listPublicIPRangesCall(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 = "/v1/networks/public-ip-ranges"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listPublicIPRangesValidateBeforeCall(final ApiCallback _callback) + throws ApiException { + return listPublicIPRangesCall(_callback); + } + + /** + * List all public IP ranges. Get a list of all public IP ranges that STACKIT uses. + * + * @return PublicNetworkListResponse + * @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 public IP ranges. -
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 PublicNetworkListResponse listPublicIPRanges() throws ApiException { + ApiResponse localVarResp = listPublicIPRangesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List all public IP ranges. Get a list of all public IP ranges that STACKIT uses. + * + * @return ApiResponse<PublicNetworkListResponse> + * @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 public IP ranges. -
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 listPublicIPRangesWithHttpInfo() + throws ApiException { + okhttp3.Call localVarCall = listPublicIPRangesValidateBeforeCall(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. + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List public IP ranges. -
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 listPublicIPRangesAsync( + final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listPublicIPRangesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listPublicIPs + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listPublicIPsCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/public-ips" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listPublicIPsValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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)"); + } + + return listPublicIPsCall(projectId, labelSelector, _callback); + } + + /** + * 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 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
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public PublicIpListResponse listPublicIPs( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listPublicIPsWithHttpInfo(projectId, labelSelector); + return localVarResp.getData(); + } + + /** + * 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 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
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse listPublicIPsWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + okhttp3.Call localVarCall = listPublicIPsValidateBeforeCall(projectId, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listPublicIPsAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listPublicIPsValidateBeforeCall(projectId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listQuotas + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 List quotas. -
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 listQuotasCall( + @javax.annotation.Nonnull UUID projectId, 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 = + "/v1/projects/{projectId}/quotas" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listQuotasValidateBeforeCall( + @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 listQuotas(Async)"); + } + + return listQuotasCall(projectId, _callback); + } + + /** + * List project quotas. List quota limits and usage for project resources. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @return QuotaListResponse + * @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 quotas. -
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 QuotaListResponse listQuotas(@javax.annotation.Nonnull UUID projectId) + throws ApiException { + ApiResponse localVarResp = listQuotasWithHttpInfo(projectId); + return localVarResp.getData(); + } + + /** + * List project quotas. List quota limits and usage for project resources. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List quotas. -
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 listQuotasWithHttpInfo( + @javax.annotation.Nonnull UUID projectId) throws ApiException { + okhttp3.Call localVarCall = listQuotasValidateBeforeCall(projectId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List project quotas. (asynchronously) List quota limits and usage for project resources. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List quotas. -
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 listQuotasAsync( + @javax.annotation.Nonnull UUID projectId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = listQuotasValidateBeforeCall(projectId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listSecurityGroupRules + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listSecurityGroupRulesCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + 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 = + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listSecurityGroupRulesValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 listSecurityGroupRules(Async)"); + } + + // verify the required parameter 'securityGroupId' is set + if (securityGroupId == null) { + throw new ApiException( + "Missing the required parameter 'securityGroupId' when calling listSecurityGroupRules(Async)"); + } + + return listSecurityGroupRulesCall(projectId, securityGroupId, _callback); + } + + /** + * 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 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
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public SecurityGroupRuleListResponse listSecurityGroupRules( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId) + throws ApiException { + ApiResponse localVarResp = + listSecurityGroupRulesWithHttpInfo(projectId, securityGroupId); + return localVarResp.getData(); + } + + /** + * 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 securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @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
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse listSecurityGroupRulesWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId) + throws ApiException { + okhttp3.Call localVarCall = + listSecurityGroupRulesValidateBeforeCall(projectId, securityGroupId, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listSecurityGroupRulesAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSecurityGroupRulesValidateBeforeCall(projectId, securityGroupId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listSecurityGroups + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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, + 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 = + "/v1/projects/{projectId}/security-groups" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listSecurityGroupsValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 listSecurityGroups(Async)"); + } + + return listSecurityGroupsCall(projectId, labelSelector, _callback); + } + + /** + * 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 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 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. -
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) + throws ApiException { + ApiResponse localVarResp = + listSecurityGroupsWithHttpInfo(projectId, labelSelector); + return localVarResp.getData(); + } + + /** + * 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 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 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. -
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) + throws ApiException { + okhttp3.Call localVarCall = + listSecurityGroupsValidateBeforeCall(projectId, labelSelector, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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) + throws ApiException { + + okhttp3.Call localVarCall = + listSecurityGroupsValidateBeforeCall(projectId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listServerNics + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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. -
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, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/nics" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listServerNicsValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 listServerNics(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling listServerNics(Async)"); + } + + return listServerNicsCall(projectId, serverId, _callback); + } + + /** + * Get all network interfaces. Get all network interfaces attached to the server. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (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
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. -
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) + throws ApiException { + ApiResponse localVarResp = listServerNicsWithHttpInfo(projectId, serverId); + return localVarResp.getData(); + } + + /** + * Get all network interfaces. Get all network interfaces attached to the server. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @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
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. -
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) + throws ApiException { + okhttp3.Call localVarCall = listServerNicsValidateBeforeCall(projectId, serverId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get all network interfaces. (asynchronously) Get all network interfaces attached to the + * server. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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. -
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) + throws ApiException { + + okhttp3.Call localVarCall = + listServerNicsValidateBeforeCall(projectId, serverId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listServerServiceAccounts + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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. -
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, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/service-accounts" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listServerServiceAccountsValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 listServerServiceAccounts(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling listServerServiceAccounts(Async)"); + } + + return listServerServiceAccountsCall(projectId, serverId, _callback); + } + + /** + * 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 serverId The identifier (ID) of a STACKIT Server. (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 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. -
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) + throws ApiException { + ApiResponse localVarResp = + listServerServiceAccountsWithHttpInfo(projectId, serverId); + return localVarResp.getData(); + } + + /** + * 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 serverId The identifier (ID) of a STACKIT Server. (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 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. -
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) + throws ApiException { + okhttp3.Call localVarCall = + listServerServiceAccountsValidateBeforeCall(projectId, serverId, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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. -
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) + throws ApiException { + + okhttp3.Call localVarCall = + listServerServiceAccountsValidateBeforeCall(projectId, serverId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listServers + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/servers" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + 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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listServersValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 listServers(Async)"); + } + + return listServersCall(projectId, details, labelSelector, _callback); + } + + /** + * 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 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
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. -
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, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listServersWithHttpInfo(projectId, details, labelSelector); + return localVarResp.getData(); + } + + /** + * 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 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
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. -
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, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + okhttp3.Call localVarCall = + listServersValidateBeforeCall(projectId, details, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listServersValidateBeforeCall(projectId, details, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listSnapshots + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listSnapshotsCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/snapshots" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listSnapshotsValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 listSnapshots(Async)"); + } + + return listSnapshotsCall(projectId, labelSelector, _callback); + } + + /** + * 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 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
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public SnapshotListResponse listSnapshots( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listSnapshotsWithHttpInfo(projectId, labelSelector); + return localVarResp.getData(); + } + + /** + * 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 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
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse listSnapshotsWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + okhttp3.Call localVarCall = listSnapshotsValidateBeforeCall(projectId, 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) + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call listSnapshotsAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSnapshotsValidateBeforeCall(projectId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listVolumePerformanceClasses + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List volume performance classes. -
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 listVolumePerformanceClassesCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/volume-performance-classes" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listVolumePerformanceClassesValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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)"); + } + + return listVolumePerformanceClassesCall(projectId, labelSelector, _callback); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List volume performance classes. -
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 VolumePerformanceClassListResponse listVolumePerformanceClasses( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listVolumePerformanceClassesWithHttpInfo(projectId, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List volume performance classes. -
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 listVolumePerformanceClassesWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + okhttp3.Call localVarCall = + listVolumePerformanceClassesValidateBeforeCall(projectId, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List volume performance classes. -
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 listVolumePerformanceClassesAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listVolumePerformanceClassesValidateBeforeCall(projectId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listVolumes + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List project volumes. -
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 listVolumesCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/volumes" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (labelSelector != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("label_selector", labelSelector)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listVolumesValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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)"); + } + + return listVolumesCall(projectId, labelSelector, _callback); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List project volumes. -
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 VolumeListResponse listVolumes( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + ApiResponse localVarResp = + listVolumesWithHttpInfo(projectId, labelSelector); + return localVarResp.getData(); + } + + /** + * 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 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List project volumes. -
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 listVolumesWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector) + throws ApiException { + okhttp3.Call localVarCall = listVolumesValidateBeforeCall(projectId, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 List project volumes. -
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 listVolumesAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nullable String labelSelector, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listVolumesValidateBeforeCall(projectId, labelSelector, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for partialUpdateNetwork + * + * @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 _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 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call partialUpdateNetworkCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload, + 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 = partialUpdateNetworkPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/networks/{networkId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.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 partialUpdateNetworkValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 partialUpdateNetworkCall( + projectId, networkId, partialUpdateNetworkPayload, _callback); + } + + /** + * Update network settings. Update the settings of a network 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) + * @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 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public void partialUpdateNetwork( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload) + throws ApiException { + partialUpdateNetworkWithHttpInfo(projectId, networkId, partialUpdateNetworkPayload); + } + + /** + * Update network settings. Update the settings of a network 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> + * @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 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public ApiResponse partialUpdateNetworkWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload) + throws ApiException { + okhttp3.Call localVarCall = + partialUpdateNetworkValidateBeforeCall( + projectId, networkId, partialUpdateNetworkPayload, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update network settings. (asynchronously) Update the settings of a network 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 _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 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call partialUpdateNetworkAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID networkId, + @javax.annotation.Nonnull PartialUpdateNetworkPayload partialUpdateNetworkPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + partialUpdateNetworkValidateBeforeCall( + projectId, networkId, partialUpdateNetworkPayload, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for partialUpdateNetworkArea + * + * @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 + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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 { + 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 = partialUpdateNetworkAreaPayload; + + // 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())); + + 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 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 '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); + } + + /** + * Update network area settings. Update the settings of a network area in an organization. + * + * @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
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. -
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); + return localVarResp.getData(); + } + + /** + * Update network area settings. Update the settings of a network area in an organization. + * + * @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
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. -
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) + throws ApiException { + okhttp3.Call localVarCall = + partialUpdateNetworkAreaValidateBeforeCall( + organizationId, areaId, partialUpdateNetworkAreaPayload, 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. + * + * @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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
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 { + + okhttp3.Call localVarCall = + partialUpdateNetworkAreaValidateBeforeCall( + organizationId, areaId, partialUpdateNetworkAreaPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for rebootServer + * + * @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 _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 reboot 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 rebootServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable String action, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/reboot" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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(); + + if (action != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("action", action)); + } + + 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 rebootServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 rebootServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling rebootServer(Async)"); + } + + return rebootServerCall(projectId, serverId, action, _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. + * + * @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) + * @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. -
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( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable String action) + throws ApiException { + rebootServerWithHttpInfo(projectId, serverId, action); + } + + /** + * 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 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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 Server reboot 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 rebootServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable String action) + throws ApiException { + okhttp3.Call localVarCall = + rebootServerValidateBeforeCall(projectId, serverId, action, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
202 Server reboot 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 rebootServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nullable String action, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + rebootServerValidateBeforeCall(projectId, serverId, action, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for removeNetworkFromServer + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Detach and delete network interface 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call removeNetworkFromServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID networkId, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "networkId" + "}", + localVarApiClient.escapeString(networkId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeNetworkFromServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @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 removeNetworkFromServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling removeNetworkFromServer(Async)"); + } + + // verify the required parameter 'networkId' is set + if (networkId == null) { + throw new ApiException( + "Missing the required parameter 'networkId' when calling removeNetworkFromServer(Async)"); + } + + return removeNetworkFromServerCall(projectId, serverId, networkId, _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. + * + * @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) + * @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 and delete network interface 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. -
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) + throws ApiException { + removeNetworkFromServerWithHttpInfo(projectId, serverId, networkId); + } + + /** + * 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 serverId The identifier (ID) of a STACKIT Server. (required) + * @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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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. -
404 The object was not found. -
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) + throws ApiException { + okhttp3.Call localVarCall = + removeNetworkFromServerValidateBeforeCall(projectId, serverId, networkId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Detach and delete network interface 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. -
500 Internal Server Error, returns a 500 if something is broken on IaaS API Side. -
+ */ + public okhttp3.Call removeNetworkFromServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID networkId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeNetworkFromServerValidateBeforeCall( + projectId, serverId, networkId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for removeNicFromServer + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Network interface 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. -
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, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeNicFromServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 removeNicFromServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "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 removeNicFromServerCall(projectId, serverId, nicId, _callback); + } + + /** + * Detach a network interface. Detach a network interface from a server. + * + * @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) + * @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 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. -
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) + throws ApiException { + removeNicFromServerWithHttpInfo(projectId, serverId, nicId); + } + + /** + * Detach a network interface. Detach a network interface from a server. + * + * @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> + * @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 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. -
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) + throws ApiException { + okhttp3.Call localVarCall = + removeNicFromServerValidateBeforeCall(projectId, serverId, nicId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Detach a network interface. (asynchronously) Detach a network interface from a server. + * + * @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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 Network interface 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. -
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) + throws ApiException { + + okhttp3.Call localVarCall = + removeNicFromServerValidateBeforeCall(projectId, serverId, nicId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for removePublicIpFromServer + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 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 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 removePublicIpFromServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removePublicIpFromServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 removePublicIpFromServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "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 removePublicIpFromServerCall(projectId, serverId, publicIpId, _callback); + } + + /** + * 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 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
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 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 void removePublicIpFromServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId) + throws ApiException { + removePublicIpFromServerWithHttpInfo(projectId, serverId, publicIpId); + } + + /** + * 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 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
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 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 removePublicIpFromServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId) + throws ApiException { + okhttp3.Call localVarCall = + removePublicIpFromServerValidateBeforeCall(projectId, serverId, publicIpId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 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 removePublicIpFromServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID publicIpId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removePublicIpFromServerValidateBeforeCall( + projectId, serverId, publicIpId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for removeSecurityGroupFromServer + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 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 removeSecurityGroupFromServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeSecurityGroupFromServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 'securityGroupId' when calling removeSecurityGroupFromServer(Async)"); + } + + return removeSecurityGroupFromServerCall(projectId, serverId, securityGroupId, _callback); + } + + /** + * 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 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
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 void removeSecurityGroupFromServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId) + throws ApiException { + removeSecurityGroupFromServerWithHttpInfo(projectId, serverId, securityGroupId); + } + + /** + * 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 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
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 removeSecurityGroupFromServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId) + throws ApiException { + okhttp3.Call localVarCall = + removeSecurityGroupFromServerValidateBeforeCall( + projectId, serverId, securityGroupId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 removeSecurityGroupFromServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID securityGroupId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeSecurityGroupFromServerValidateBeforeCall( + projectId, serverId, securityGroupId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for removeServiceAccountFromServer + * + * @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 _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 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 removeServiceAccountFromServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "serverId" + "}", + localVarApiClient.escapeString(serverId.toString())) + .replace( + "{" + "serviceAccountMail" + "}", + localVarApiClient.escapeString(serviceAccountMail.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeServiceAccountFromServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 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 'serviceAccountMail' when calling removeServiceAccountFromServer(Async)"); + } + + return removeServiceAccountFromServerCall( + projectId, serverId, serviceAccountMail, _callback); + } + + /** + * 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 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 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 ServiceAccountMailListResponse removeServiceAccountFromServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail) + throws ApiException { + ApiResponse localVarResp = + removeServiceAccountFromServerWithHttpInfo(projectId, serverId, serviceAccountMail); + return localVarResp.getData(); + } + + /** + * 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 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 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 removeServiceAccountFromServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail) + throws ApiException { + okhttp3.Call localVarCall = + removeServiceAccountFromServerValidateBeforeCall( + projectId, serverId, serviceAccountMail, 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. + * + * @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 _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 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 removeServiceAccountFromServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull String serviceAccountMail, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeServiceAccountFromServerValidateBeforeCall( + projectId, serverId, serviceAccountMail, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for removeVolumeFromServer + * + * @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 _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
204 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 removeVolumeFromServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + 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 = + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeVolumeFromServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "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 removeVolumeFromServerCall(projectId, serverId, volumeId, _callback); + } + + /** + * 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 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
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 void removeVolumeFromServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId) + throws ApiException { + removeVolumeFromServerWithHttpInfo(projectId, serverId, volumeId); + } + + /** + * 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 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
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 removeVolumeFromServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId) + throws ApiException { + okhttp3.Call localVarCall = + removeVolumeFromServerValidateBeforeCall(projectId, serverId, volumeId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 removeVolumeFromServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeVolumeFromServerValidateBeforeCall(projectId, serverId, volumeId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for rescueServer + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 rescueServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull RescueServerPayload rescueServerPayload, + 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 = rescueServerPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/servers/{serverId}/rescue" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {"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 rescueServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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)"); + } + + // 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, serverId, rescueServerPayload, _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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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
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 void rescueServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull RescueServerPayload rescueServerPayload) + throws ApiException { + rescueServerWithHttpInfo(projectId, serverId, rescueServerPayload); + } + + /** + * 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 projectId The identifier (ID) of a STACKIT Project. (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
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 rescueServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull RescueServerPayload rescueServerPayload) + throws ApiException { + okhttp3.Call localVarCall = + rescueServerValidateBeforeCall(projectId, serverId, rescueServerPayload, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 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 projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
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 rescueServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull RescueServerPayload rescueServerPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + rescueServerValidateBeforeCall(projectId, serverId, rescueServerPayload, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for resizeServer + * + * @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 _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 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 resizeServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload, + 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 = resizeServerPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/servers/{serverId}/resize" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {"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 resizeServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload, + 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)"); + } + + // verify the required parameter 'resizeServerPayload' is set + if (resizeServerPayload == null) { + throw new ApiException( + "Missing the required parameter 'resizeServerPayload' when calling resizeServer(Async)"); + } + + return resizeServerCall(projectId, serverId, resizeServerPayload, _callback); + } + + /** + * Resize a server. Resize the server to the given machine type. + * + * @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) + * @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 void resizeServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload) + throws ApiException { + resizeServerWithHttpInfo(projectId, serverId, resizeServerPayload); + } + + /** + * Resize a server. Resize the server to the given machine type. + * + * @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> + * @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 UUID serverId, + @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload) + throws ApiException { + okhttp3.Call localVarCall = + resizeServerValidateBeforeCall(projectId, 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 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 UUID serverId, + @javax.annotation.Nonnull ResizeServerPayload resizeServerPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + resizeServerValidateBeforeCall(projectId, serverId, resizeServerPayload, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for resizeVolume + * + * @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 _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 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 = + "/v1/projects/{projectId}/volumes/{volumeId}/resize" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 'volumeId' is set + if (volumeId == null) { + throw new ApiException( + "Missing the required parameter 'volumeId' when calling resizeVolume(Async)"); + } + + return resizeVolumeCall(projectId, 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 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 UUID volumeId, + @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload) + throws ApiException { + resizeVolumeWithHttpInfo(projectId, 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 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 UUID volumeId, + @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload) + throws ApiException { + okhttp3.Call localVarCall = + resizeVolumeValidateBeforeCall(projectId, 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 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 UUID volumeId, + @javax.annotation.Nullable ResizeVolumePayload resizeVolumePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + resizeVolumeValidateBeforeCall(projectId, volumeId, resizeVolumePayload, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for restoreBackup + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 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 = + "/v1/projects/{projectId}/backups/{backupId}/restore" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 'backupId' is set + if (backupId == null) { + throw new ApiException( + "Missing the required parameter 'backupId' when calling restoreBackup(Async)"); + } + + return restoreBackupCall(projectId, 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 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 UUID backupId) + throws ApiException { + restoreBackupWithHttpInfo(projectId, 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 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 UUID backupId) + throws ApiException { + okhttp3.Call localVarCall = restoreBackupValidateBeforeCall(projectId, 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 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 UUID backupId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = restoreBackupValidateBeforeCall(projectId, backupId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for setImageShare + * + * @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 _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 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 = + "/v1/projects/{projectId}/images/{imageId}/share" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 '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, 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 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 UUID imageId, + @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload) + throws ApiException { + ApiResponse localVarResp = + setImageShareWithHttpInfo(projectId, 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 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 UUID imageId, + @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload) + throws ApiException { + okhttp3.Call localVarCall = + setImageShareValidateBeforeCall(projectId, 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 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 UUID imageId, + @javax.annotation.Nonnull SetImageSharePayload setImageSharePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + setImageShareValidateBeforeCall( + projectId, 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 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 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 = + "/v1/projects/{projectId}/servers/{serverId}/start" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling startServer(Async)"); + } + + return startServerCall(projectId, 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 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 UUID serverId) + throws ApiException { + startServerWithHttpInfo(projectId, 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 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 UUID serverId) + throws ApiException { + okhttp3.Call localVarCall = startServerValidateBeforeCall(projectId, 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 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 UUID serverId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = startServerValidateBeforeCall(projectId, serverId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for stopServer + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 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 = + "/v1/projects/{projectId}/servers/{serverId}/stop" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling stopServer(Async)"); + } + + return stopServerCall(projectId, 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 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 UUID serverId) + throws ApiException { + stopServerWithHttpInfo(projectId, 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 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 UUID serverId) + throws ApiException { + okhttp3.Call localVarCall = stopServerValidateBeforeCall(projectId, 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 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 UUID serverId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = stopServerValidateBeforeCall(projectId, serverId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for unrescueServer + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 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 = + "/v1/projects/{projectId}/servers/{serverId}/unrescue" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling unrescueServer(Async)"); + } + + return unrescueServerCall(projectId, 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 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 UUID serverId) + throws ApiException { + unrescueServerWithHttpInfo(projectId, 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 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 UUID serverId) + throws ApiException { + okhttp3.Call localVarCall = unrescueServerValidateBeforeCall(projectId, 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 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 UUID serverId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + unrescueServerValidateBeforeCall(projectId, serverId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + /** + * Build call for updateAttachedVolume + * + * @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 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 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 = + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 '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, 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 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 UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload) + throws ApiException { + ApiResponse localVarResp = + updateAttachedVolumeWithHttpInfo( + projectId, 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 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 UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload) + throws ApiException { + okhttp3.Call localVarCall = + updateAttachedVolumeValidateBeforeCall( + projectId, 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 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 UUID serverId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateAttachedVolumePayload updateAttachedVolumePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateAttachedVolumeValidateBeforeCall( + projectId, 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 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 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 = + "/v1/projects/{projectId}/backups/{backupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 '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, 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 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 UUID backupId, + @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload) + throws ApiException { + ApiResponse localVarResp = + updateBackupWithHttpInfo(projectId, 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 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 UUID backupId, + @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload) + throws ApiException { + okhttp3.Call localVarCall = + updateBackupValidateBeforeCall(projectId, 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 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 UUID backupId, + @javax.annotation.Nonnull UpdateBackupPayload updateBackupPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateBackupValidateBeforeCall(projectId, 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 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 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 = + "/v1/projects/{projectId}/images/{imageId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 '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, 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 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 UUID imageId, + @javax.annotation.Nonnull UpdateImagePayload updateImagePayload) + throws ApiException { + ApiResponse localVarResp = + updateImageWithHttpInfo(projectId, 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 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 UUID imageId, + @javax.annotation.Nonnull UpdateImagePayload updateImagePayload) + throws ApiException { + okhttp3.Call localVarCall = + updateImageValidateBeforeCall(projectId, 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 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 UUID imageId, + @javax.annotation.Nonnull UpdateImagePayload updateImagePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateImageValidateBeforeCall(projectId, imageId, updateImagePayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateImageScopeLocal + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to local. 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 updateImageScopeLocalCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + 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 = + "/v1/projects/{projectId}/images/{imageId}/publish" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateImageScopeLocalValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 updateImageScopeLocal(Async)"); + } + + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException( + "Missing the required parameter 'imageId' when calling updateImageScopeLocal(Async)"); + } + + return updateImageScopeLocalCall(projectId, imageId, _callback); + } + + /** + * Update Image Scope to Local. Update the scope property of an existing Image inside a project + * to local. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to local. 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 updateImageScopeLocal( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + throws ApiException { + ApiResponse localVarResp = updateImageScopeLocalWithHttpInfo(projectId, imageId); + return localVarResp.getData(); + } + + /** + * Update Image Scope to Local. Update the scope property of an existing Image inside a project + * to local. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to local. 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 updateImageScopeLocalWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + throws ApiException { + okhttp3.Call localVarCall = + updateImageScopeLocalValidateBeforeCall(projectId, imageId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Image Scope to Local. (asynchronously) Update the scope property of an existing Image + * inside a project to local. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to local. 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 updateImageScopeLocalAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateImageScopeLocalValidateBeforeCall(projectId, imageId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateImageScopePublic + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to public. 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 updateImageScopePublicCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + 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 = + "/v1/projects/{projectId}/images/{imageId}/publish" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {}; + 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 updateImageScopePublicValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @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 updateImageScopePublic(Async)"); + } + + // verify the required parameter 'imageId' is set + if (imageId == null) { + throw new ApiException( + "Missing the required parameter 'imageId' when calling updateImageScopePublic(Async)"); + } + + return updateImageScopePublicCall(projectId, imageId, _callback); + } + + /** + * Update Image Scope to Public. Update the scope property of an existing Image inside a project + * to public. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to public. 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 updateImageScopePublic( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + throws ApiException { + ApiResponse localVarResp = updateImageScopePublicWithHttpInfo(projectId, imageId); + return localVarResp.getData(); + } + + /** + * Update Image Scope to Public. Update the scope property of an existing Image inside a project + * to public. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to public. 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 updateImageScopePublicWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, @javax.annotation.Nonnull UUID imageId) + throws ApiException { + okhttp3.Call localVarCall = + updateImageScopePublicValidateBeforeCall(projectId, imageId, 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. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * object + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Response to update image-scope to public. 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 updateImageScopePublicAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID imageId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateImageScopePublicValidateBeforeCall(projectId, imageId, _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 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 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 = + "/v1/projects/{projectId}/images/{imageId}/share" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 '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, 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 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 UUID imageId, + @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload) + throws ApiException { + ApiResponse localVarResp = + updateImageShareWithHttpInfo(projectId, 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 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 UUID imageId, + @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload) + throws ApiException { + okhttp3.Call localVarCall = + updateImageShareValidateBeforeCall( + projectId, 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 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 UUID imageId, + @javax.annotation.Nonnull UpdateImageSharePayload updateImageSharePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateImageShareValidateBeforeCall( + projectId, 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 = + "/v1/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 updateNetworkAreaRoute + * + * @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 _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 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 = + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + .replace( + "{" + "organizationId" + "}", + localVarApiClient.escapeString(organizationId.toString())) + .replace( + "{" + "areaId" + "}", + localVarApiClient.escapeString(areaId.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 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 '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, 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 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 UUID routeId, + @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload) + throws ApiException { + ApiResponse localVarResp = + updateNetworkAreaRouteWithHttpInfo( + organizationId, areaId, 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 routeId The identifier (ID) of a STACKIT Route. (required) + * @param updateNetworkAreaRoutePayload Request an update of a network 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 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 UUID routeId, + @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload) + throws ApiException { + okhttp3.Call localVarCall = + updateNetworkAreaRouteValidateBeforeCall( + organizationId, areaId, 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 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 UUID routeId, + @javax.annotation.Nonnull UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateNetworkAreaRouteValidateBeforeCall( + organizationId, areaId, 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 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 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 = + "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 '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, 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 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 UUID networkId, + @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull UpdateNicPayload updateNicPayload) + throws ApiException { + ApiResponse localVarResp = + updateNicWithHttpInfo(projectId, 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 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 UUID networkId, + @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull UpdateNicPayload updateNicPayload) + throws ApiException { + okhttp3.Call localVarCall = + updateNicValidateBeforeCall(projectId, 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 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 UUID networkId, + @javax.annotation.Nonnull UUID nicId, + @javax.annotation.Nonnull UpdateNicPayload updateNicPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateNicValidateBeforeCall( + projectId, 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 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 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 = + "/v1/projects/{projectId}/public-ips/{publicIpId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 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 '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, 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 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 + * + * + * + * + * + * + * + * + * + *
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 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); + 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 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 UUID publicIpId, + @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload) + throws ApiException { + okhttp3.Call localVarCall = + updatePublicIPValidateBeforeCall( + projectId, publicIpId, updatePublicIPPayload, 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. + * + * @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 _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 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 updatePublicIPAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID publicIpId, + @javax.annotation.Nonnull UpdatePublicIPPayload updatePublicIPPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updatePublicIPValidateBeforeCall( + projectId, publicIpId, updatePublicIPPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateSecurityGroup + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @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 security group 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 updateSecurityGroupCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UpdateSecurityGroupPayload updateSecurityGroupPayload, + 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 = updateSecurityGroupPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/security-groups/{securityGroupId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "securityGroupId" + "}", + localVarApiClient.escapeString(securityGroupId.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 updateSecurityGroupValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UpdateSecurityGroupPayload updateSecurityGroupPayload, + 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 updateSecurityGroup(Async)"); + } + + // verify the required parameter 'securityGroupId' is set + if (securityGroupId == null) { + throw new ApiException( + "Missing the required parameter 'securityGroupId' when calling updateSecurityGroup(Async)"); + } + + // verify the required parameter 'updateSecurityGroupPayload' is set + if (updateSecurityGroupPayload == null) { + throw new ApiException( + "Missing the required parameter 'updateSecurityGroupPayload' when calling updateSecurityGroup(Async)"); + } + + return updateSecurityGroupCall( + projectId, 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 securityGroupId The identifier (ID) of a STACKIT Security Group. (required) + * @param updateSecurityGroupPayload Request an update of a 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Updating security group 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 SecurityGroup updateSecurityGroup( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UpdateSecurityGroupPayload updateSecurityGroupPayload) + throws ApiException { + ApiResponse localVarResp = + updateSecurityGroupWithHttpInfo( + projectId, securityGroupId, updateSecurityGroupPayload); + return localVarResp.getData(); + } + + /** + * Update information of a security group. Update labels of the security group. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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> + * @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 security group 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 updateSecurityGroupWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UpdateSecurityGroupPayload updateSecurityGroupPayload) + throws ApiException { + okhttp3.Call localVarCall = + updateSecurityGroupValidateBeforeCall( + projectId, securityGroupId, updateSecurityGroupPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update information of a security group. (asynchronously) Update labels of the security group. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @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 security group 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 updateSecurityGroupAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID securityGroupId, + @javax.annotation.Nonnull UpdateSecurityGroupPayload updateSecurityGroupPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateSecurityGroupValidateBeforeCall( + projectId, securityGroupId, updateSecurityGroupPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateServer + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @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 Server 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 updateServerCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UpdateServerPayload updateServerPayload, + 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 = updateServerPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/servers/{serverId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 = {"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 updateServerValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UpdateServerPayload updateServerPayload, + 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 updateServer(Async)"); + } + + // verify the required parameter 'serverId' is set + if (serverId == null) { + throw new ApiException( + "Missing the required parameter 'serverId' when calling updateServer(Async)"); + } + + // verify the required parameter 'updateServerPayload' is set + if (updateServerPayload == null) { + throw new ApiException( + "Missing the required parameter 'updateServerPayload' when calling updateServer(Async)"); + } + + return updateServerCall(projectId, 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 serverId The identifier (ID) of a STACKIT Server. (required) + * @param updateServerPayload Request an update of a server. (required) + * @return Server + * @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 Server 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 Server updateServer( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UpdateServerPayload updateServerPayload) + throws ApiException { + ApiResponse localVarResp = + updateServerWithHttpInfo(projectId, serverId, updateServerPayload); + return localVarResp.getData(); + } + + /** + * Update information of a server. Update name or labels of the server. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param serverId The identifier (ID) of a STACKIT Server. (required) + * @param updateServerPayload Request an update of a server. (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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Server 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 updateServerWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UpdateServerPayload updateServerPayload) + throws ApiException { + okhttp3.Call localVarCall = + updateServerValidateBeforeCall(projectId, serverId, updateServerPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update information of a server. (asynchronously) Update name or labels of the server. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @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 Server 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 updateServerAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID serverId, + @javax.annotation.Nonnull UpdateServerPayload updateServerPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateServerValidateBeforeCall(projectId, serverId, updateServerPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateSnapshot + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @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 Snapshot 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 updateSnapshotCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID snapshotId, + @javax.annotation.Nonnull UpdateSnapshotPayload updateSnapshotPayload, + 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 = updateSnapshotPayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/snapshots/{snapshotId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.toString())) + .replace( + "{" + "snapshotId" + "}", + localVarApiClient.escapeString(snapshotId.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 updateSnapshotValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID snapshotId, + @javax.annotation.Nonnull UpdateSnapshotPayload updateSnapshotPayload, + 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 updateSnapshot(Async)"); + } + + // verify the required parameter 'snapshotId' is set + if (snapshotId == null) { + throw new ApiException( + "Missing the required parameter 'snapshotId' when calling updateSnapshot(Async)"); + } + + // verify the required parameter 'updateSnapshotPayload' is set + if (updateSnapshotPayload == null) { + throw new ApiException( + "Missing the required parameter 'updateSnapshotPayload' when calling updateSnapshot(Async)"); + } + + return updateSnapshotCall(projectId, 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 snapshotId The identifier (ID) of a STACKIT Snapshot. (required) + * @param updateSnapshotPayload Request an update of a 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Snapshot 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 Snapshot updateSnapshot( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID snapshotId, + @javax.annotation.Nonnull UpdateSnapshotPayload updateSnapshotPayload) + throws ApiException { + ApiResponse localVarResp = + updateSnapshotWithHttpInfo(projectId, snapshotId, updateSnapshotPayload); + return localVarResp.getData(); + } + + /** + * 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 snapshotId The identifier (ID) of a STACKIT Snapshot. (required) + * @param updateSnapshotPayload Request an update of a 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Snapshot 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 updateSnapshotWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID snapshotId, + @javax.annotation.Nonnull UpdateSnapshotPayload updateSnapshotPayload) + throws ApiException { + okhttp3.Call localVarCall = + updateSnapshotValidateBeforeCall( + projectId, snapshotId, updateSnapshotPayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update information of the snapshot. (asynchronously) Update information like name or labels + * of the snapshot. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @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 Snapshot 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 updateSnapshotAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID snapshotId, + @javax.annotation.Nonnull UpdateSnapshotPayload updateSnapshotPayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateSnapshotValidateBeforeCall( + projectId, snapshotId, updateSnapshotPayload, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateVolume + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @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 Volume 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 updateVolumeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateVolumePayload updateVolumePayload, + 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 = updateVolumePayload; + + // create path and map variables + String localVarPath = + "/v1/projects/{projectId}/volumes/{volumeId}" + .replace( + "{" + "projectId" + "}", + localVarApiClient.escapeString(projectId.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 updateVolumeValidateBeforeCall( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateVolumePayload updateVolumePayload, + 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 updateVolume(Async)"); + } + + // verify the required parameter 'volumeId' is set + if (volumeId == null) { + throw new ApiException( + "Missing the required parameter 'volumeId' when calling updateVolume(Async)"); + } + + // verify the required parameter 'updateVolumePayload' is set + if (updateVolumePayload == null) { + throw new ApiException( + "Missing the required parameter 'updateVolumePayload' when calling updateVolume(Async)"); + } + + return updateVolumeCall(projectId, 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 volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param updateVolumePayload Request an update of a 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Volume 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 Volume updateVolume( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateVolumePayload updateVolumePayload) + throws ApiException { + ApiResponse localVarResp = + updateVolumeWithHttpInfo(projectId, volumeId, updateVolumePayload); + return localVarResp.getData(); + } + + /** + * Update information of a volume. Update name, description or labels of the volume. + * + * @param projectId The identifier (ID) of a STACKIT Project. (required) + * @param volumeId The identifier (ID) of a STACKIT Volume. (required) + * @param updateVolumePayload Request an update of a 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 + * + * + * + * + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Volume 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 updateVolumeWithHttpInfo( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateVolumePayload updateVolumePayload) + throws ApiException { + okhttp3.Call localVarCall = + updateVolumeValidateBeforeCall(projectId, volumeId, updateVolumePayload, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update information of a volume. (asynchronously) Update name, description or labels of the + * volume. + * + * @param projectId The identifier (ID) of a STACKIT Project. (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 + * @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 Volume 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 updateVolumeAsync( + @javax.annotation.Nonnull UUID projectId, + @javax.annotation.Nonnull UUID volumeId, + @javax.annotation.Nonnull UpdateVolumePayload updateVolumePayload, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateVolumeValidateBeforeCall(projectId, 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 new file mode 100644 index 0000000..e0b87aa --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/api/IaasApi.java @@ -0,0 +1,14 @@ +package cloud.stackit.sdk.iaas.api; + +import cloud.stackit.sdk.core.config.CoreConfiguration; +import java.io.IOException; + +public class IaasApi extends DefaultApi { + public IaasApi() throws IOException { + super(); + } + + public IaasApi(CoreConfiguration configuration) throws IOException { + super(configuration); + } +} 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 new file mode 100644 index 0000000..0b12cb3 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AbstractOpenApiSchema.java @@ -0,0 +1,145 @@ +/* + * 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 java.util.Map; +import java.util.Objects; + +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + // @JsonValue + public Object getActualInstance() { + return instance; + } + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) { + this.instance = instance; + } + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf + * schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } +} 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 new file mode 100644 index 0000000..3b87dd3 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddVolumeToServerPayload.java @@ -0,0 +1,248 @@ +/* + * 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; +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.14.0") +public class AddVolumeToServerPayload { + public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; + + @SerializedName(SERIALIZED_NAME_DELETE_ON_TERMINATION) + @javax.annotation.Nullable private Boolean deleteOnTermination; + + public static final String SERIALIZED_NAME_SERVER_ID = "serverId"; + + @SerializedName(SERIALIZED_NAME_SERVER_ID) + @javax.annotation.Nullable private UUID serverId; + + public static final String SERIALIZED_NAME_VOLUME_ID = "volumeId"; + + @SerializedName(SERIALIZED_NAME_VOLUME_ID) + @javax.annotation.Nullable private UUID volumeId; + + public AddVolumeToServerPayload() {} + + public AddVolumeToServerPayload(UUID serverId, UUID volumeId) { + this(); + this.serverId = serverId; + this.volumeId = volumeId; + } + + public AddVolumeToServerPayload deleteOnTermination( + @javax.annotation.Nullable Boolean deleteOnTermination) { + this.deleteOnTermination = deleteOnTermination; + return this; + } + + /** + * Delete the volume during the termination of the server. Defaults to false. + * + * @return deleteOnTermination + */ + @javax.annotation.Nullable public Boolean getDeleteOnTermination() { + return deleteOnTermination; + } + + public void setDeleteOnTermination(@javax.annotation.Nullable Boolean deleteOnTermination) { + this.deleteOnTermination = deleteOnTermination; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return serverId + */ + @javax.annotation.Nullable public UUID getServerId() { + return serverId; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return volumeId + */ + @javax.annotation.Nullable public UUID getVolumeId() { + return volumeId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddVolumeToServerPayload addVolumeToServerPayload = (AddVolumeToServerPayload) o; + return Objects.equals( + this.deleteOnTermination, addVolumeToServerPayload.deleteOnTermination) + && Objects.equals(this.serverId, addVolumeToServerPayload.serverId) + && Objects.equals(this.volumeId, addVolumeToServerPayload.volumeId); + } + + @Override + public int hashCode() { + return Objects.hash(deleteOnTermination, serverId, volumeId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddVolumeToServerPayload {\n"); + sb.append(" deleteOnTermination: ") + .append(toIndentedString(deleteOnTermination)) + .append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" volumeId: ").append(toIndentedString(volumeId)).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("deleteOnTermination", "serverId", "volumeId")); + + // 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 AddVolumeToServerPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddVolumeToServerPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `serverId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("serverId").toString())); + } + if ((jsonObj.get("volumeId") != null && !jsonObj.get("volumeId").isJsonNull()) + && !jsonObj.get("volumeId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("volumeId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddVolumeToServerPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddVolumeToServerPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AddVolumeToServerPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddVolumeToServerPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddVolumeToServerPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddVolumeToServerPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddVolumeToServerPayload + * @throws IOException if the JSON string is invalid with respect to AddVolumeToServerPayload + */ + public static AddVolumeToServerPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddVolumeToServerPayload.class); + } + + /** + * Convert an instance of AddVolumeToServerPayload 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/AffinityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroup.java new file mode 100644 index 0000000..4e85a86 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroup.java @@ -0,0 +1,302 @@ +/* + * 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 java.util.UUID; + +/** Definition of an affinity group. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class AffinityGroup { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_MEMBERS = "members"; + + @SerializedName(SERIALIZED_NAME_MEMBERS) + @javax.annotation.Nullable private List members = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_POLICY = "policy"; + + @SerializedName(SERIALIZED_NAME_POLICY) + @javax.annotation.Nonnull + private String policy; + + public AffinityGroup() {} + + public AffinityGroup(UUID id, List members) { + this(); + this.id = id; + this.members = members; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + /** + * The servers that are part of the affinity group. + * + * @return members + */ + @javax.annotation.Nullable public List getMembers() { + return members; + } + + public AffinityGroup 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 AffinityGroup policy(@javax.annotation.Nonnull String policy) { + this.policy = policy; + return this; + } + + /** + * The affinity group policy. `hard-affinity`: All servers in this group will be + * hosted on the same compute node. `soft-affinity`: All servers in this group will be + * hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in + * this group will be hosted on different compute nodes. `soft-anti-affinity`: All + * servers in this group will be hosted on as many compute nodes as possible. Possible values: + * `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, + * `soft-affinity`. + * + * @return policy + */ + @javax.annotation.Nonnull + public String getPolicy() { + return policy; + } + + public void setPolicy(@javax.annotation.Nonnull String policy) { + this.policy = policy; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AffinityGroup affinityGroup = (AffinityGroup) 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); + } + + @Override + public int hashCode() { + return Objects.hash(id, members, name, policy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AffinityGroup {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + 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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "members", "name", "policy")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "policy")); + } + + /** + * 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 AffinityGroup + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AffinityGroup.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("members") != null + && !jsonObj.get("members").isJsonNull() + && !jsonObj.get("members").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "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( + "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( + "Expected the field `policy` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("policy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AffinityGroup.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AffinityGroup' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AffinityGroup.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AffinityGroup value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AffinityGroup read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AffinityGroup given an JSON string + * + * @param jsonString JSON string + * @return An instance of AffinityGroup + * @throws IOException if the JSON string is invalid with respect to AffinityGroup + */ + public static AffinityGroup fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AffinityGroup.class); + } + + /** + * Convert an instance of AffinityGroup 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/AffinityGroupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroupListResponse.java new file mode 100644 index 0000000..9564365 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AffinityGroupListResponse.java @@ -0,0 +1,227 @@ +/* + * 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; + +/** Response object for affinity group list request. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class AffinityGroupListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public AffinityGroupListResponse() {} + + public AffinityGroupListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public AffinityGroupListResponse addItemsItem(AffinityGroup itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of affinity groups. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AffinityGroupListResponse affinityGroupListResponse = (AffinityGroupListResponse) o; + return Objects.equals(this.items, affinityGroupListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AffinityGroupListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 AffinityGroupListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AffinityGroupListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + AffinityGroup.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AffinityGroupListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AffinityGroupListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AffinityGroupListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AffinityGroupListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AffinityGroupListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AffinityGroupListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AffinityGroupListResponse + * @throws IOException if the JSON string is invalid with respect to AffinityGroupListResponse + */ + public static AffinityGroupListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AffinityGroupListResponse.class); + } + + /** + * Convert an instance of AffinityGroupListResponse 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/AllowedAddressesInner.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AllowedAddressesInner.java new file mode 100644 index 0000000..34590b1 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AllowedAddressesInner.java @@ -0,0 +1,229 @@ +/* + * 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.JsonPrimitive; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class AllowedAddressesInner extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AllowedAddressesInner.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllowedAddressesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllowedAddressesInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterString = + gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AllowedAddressesInner value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = + adapterString + .toJsonTree((String) value.getActualInstance()) + .getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas: String"); + } + + @Override + public AllowedAddressesInner read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be of type String in the JSON string but got `%s`", + jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for String failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'String'", + e); + } + + if (match == 1) { + AllowedAddressesInner ret = new AllowedAddressesInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for AllowedAddressesInner: %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 AllowedAddressesInner() { + super("oneOf", Boolean.FALSE); + } + + public AllowedAddressesInner(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + } + + @Override + public Map> getSchemas() { + return AllowedAddressesInner.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: String + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be String"); + } + + /** + * Get the actual instance, which can be the following: String + * + * @return The actual instance (String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AllowedAddressesInner + */ + 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 String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException( + String.format( + "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())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "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())); + } + } + + /** + * Create an instance of AllowedAddressesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllowedAddressesInner + * @throws IOException if the JSON string is invalid with respect to AllowedAddressesInner + */ + public static AllowedAddressesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllowedAddressesInner.class); + } + + /** + * Convert an instance of AllowedAddressesInner 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/Area.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Area.java new file mode 100644 index 0000000..debd215 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Area.java @@ -0,0 +1,350 @@ +/* + * 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.14.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 new file mode 100644 index 0000000..448a2ce --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaConfig.java @@ -0,0 +1,361 @@ +/* + * 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.14.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 new file mode 100644 index 0000000..7af8eb0 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaId.java @@ -0,0 +1,268 @@ +/* + * 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.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class AreaId extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AreaId.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AreaId.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AreaId' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterUUID = + gson.getDelegateAdapter(this, TypeToken.get(UUID.class)); + final TypeAdapter adapterStaticAreaID = + gson.getDelegateAdapter(this, TypeToken.get(StaticAreaID.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AreaId value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `UUID` + if (value.getActualInstance() instanceof UUID) { + JsonElement element = + adapterUUID.toJsonTree((UUID) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `StaticAreaID` + if (value.getActualInstance() instanceof StaticAreaID) { + JsonElement element = + adapterStaticAreaID.toJsonTree( + (StaticAreaID) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas: StaticAreaID, UUID"); + } + + @Override + public AreaId read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize UUID + try { + // validate the JSON object to see if any exception is thrown + UUID.fromString(jsonElement.getAsString()); + actualAdapter = adapterUUID; + match++; + log.log(Level.FINER, "Input data matches schema 'UUID'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for UUID failed with `%s`.", + e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UUID'", e); + } + // deserialize StaticAreaID + try { + // validate the JSON object to see if any exception is thrown + StaticAreaID.validateJsonElement(jsonElement); + actualAdapter = adapterStaticAreaID; + match++; + log.log(Level.FINER, "Input data matches schema 'StaticAreaID'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for StaticAreaID failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'StaticAreaID'", + e); + } + + if (match == 1) { + AreaId ret = new AreaId(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for AreaId: %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 AreaId() { + super("oneOf", Boolean.FALSE); + } + + public AreaId(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("UUID", UUID.class); + schemas.put("StaticAreaID", StaticAreaID.class); + } + + @Override + public Map> getSchemas() { + return AreaId.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: StaticAreaID, UUID + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof UUID) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof StaticAreaID) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be StaticAreaID, UUID"); + } + + /** + * Get the actual instance, which can be the following: StaticAreaID, UUID + * + * @return The actual instance (StaticAreaID, UUID) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `UUID`. If the actual instance is not `UUID`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `UUID` + * @throws ClassCastException if the instance is not `UUID` + */ + public UUID getUUID() throws ClassCastException { + return (UUID) super.getActualInstance(); + } + + /** + * Get the actual instance of `StaticAreaID`. If the actual instance is not `StaticAreaID`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `StaticAreaID` + * @throws ClassCastException if the instance is not `StaticAreaID` + */ + public StaticAreaID getStaticAreaID() throws ClassCastException { + return (StaticAreaID) 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 AreaId + */ + 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 UUID + try { + UUID.fromString(jsonElement.getAsString()); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format("Deserialization for UUID failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with StaticAreaID + try { + StaticAreaID.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for StaticAreaID failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "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())); + } + } + + /** + * Create an instance of AreaId given an JSON string + * + * @param jsonString JSON string + * @return An instance of AreaId + * @throws IOException if the JSON string is invalid with respect to AreaId + */ + public static AreaId fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AreaId.class); + } + + /** + * Convert an instance of AreaId 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/AreaPrefixConfigIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaPrefixConfigIPv4.java new file mode 100644 index 0000000..ff50a2a --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AreaPrefixConfigIPv4.java @@ -0,0 +1,242 @@ +/* + * 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.14.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 new file mode 100644 index 0000000..98a0bb8 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AvailabilityZoneListResponse.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Availability Zone list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class AvailabilityZoneListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public AvailabilityZoneListResponse() {} + + public AvailabilityZoneListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public AvailabilityZoneListResponse addItemsItem(String itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of availability zones. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AvailabilityZoneListResponse availabilityZoneListResponse = + (AvailabilityZoneListResponse) o; + return Objects.equals(this.items, availabilityZoneListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AvailabilityZoneListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 + * AvailabilityZoneListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AvailabilityZoneListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("items") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AvailabilityZoneListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AvailabilityZoneListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AvailabilityZoneListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AvailabilityZoneListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AvailabilityZoneListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AvailabilityZoneListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AvailabilityZoneListResponse + * @throws IOException if the JSON string is invalid with respect to + * AvailabilityZoneListResponse + */ + public static AvailabilityZoneListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AvailabilityZoneListResponse.class); + } + + /** + * Convert an instance of AvailabilityZoneListResponse 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/Backup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Backup.java new file mode 100644 index 0000000..89b82c8 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Backup.java @@ -0,0 +1,432 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.0") +public class Backup { + public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; + + @SerializedName(SERIALIZED_NAME_AVAILABILITY_ZONE) + @javax.annotation.Nullable private String availabilityZone; + + 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_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.Nullable private String name; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable private Long size; + + public static final String SERIALIZED_NAME_SNAPSHOT_ID = "snapshotId"; + + @SerializedName(SERIALIZED_NAME_SNAPSHOT_ID) + @javax.annotation.Nullable private UUID snapshotId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_VOLUME_ID = "volumeId"; + + @SerializedName(SERIALIZED_NAME_VOLUME_ID) + @javax.annotation.Nullable private UUID volumeId; + + public Backup() {} + + public Backup( + String availabilityZone, + OffsetDateTime createdAt, + UUID id, + Long size, + UUID snapshotId, + String status, + OffsetDateTime updatedAt, + UUID volumeId) { + this(); + this.availabilityZone = availabilityZone; + this.createdAt = createdAt; + this.id = id; + this.size = size; + this.snapshotId = snapshotId; + this.status = status; + this.updatedAt = updatedAt; + this.volumeId = volumeId; + } + + /** + * Object that represents an availability zone. + * + * @return availabilityZone + */ + @javax.annotation.Nullable public String getAvailabilityZone() { + return availabilityZone; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public Backup labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public Backup 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; + } + + /** + * Size in Gigabyte. + * + * @return size + */ + @javax.annotation.Nullable public Long getSize() { + return size; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return snapshotId + */ + @javax.annotation.Nullable public UUID getSnapshotId() { + return snapshotId; + } + + /** + * The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, + * `DELETED`, `DELETING`, `ERROR`, `RESTORING`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return volumeId + */ + @javax.annotation.Nullable public UUID getVolumeId() { + return volumeId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Backup backup = (Backup) o; + return Objects.equals(this.availabilityZone, backup.availabilityZone) + && Objects.equals(this.createdAt, backup.createdAt) + && Objects.equals(this.id, backup.id) + && Objects.equals(this.labels, backup.labels) + && Objects.equals(this.name, backup.name) + && Objects.equals(this.size, backup.size) + && Objects.equals(this.snapshotId, backup.snapshotId) + && Objects.equals(this.status, backup.status) + && Objects.equals(this.updatedAt, backup.updatedAt) + && Objects.equals(this.volumeId, backup.volumeId); + } + + @Override + public int hashCode() { + return Objects.hash( + availabilityZone, + createdAt, + id, + labels, + name, + size, + snapshotId, + status, + updatedAt, + volumeId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Backup {\n"); + sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).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(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" snapshotId: ").append(toIndentedString(snapshotId)).append("\n"); + 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("}"); + 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( + "availabilityZone", + "createdAt", + "id", + "labels", + "name", + "size", + "snapshotId", + "status", + "updatedAt", + "volumeId")); + + // 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 Backup + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Backup.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `availabilityZone` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("availabilityZone").toString())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("snapshotId") != null && !jsonObj.get("snapshotId").isJsonNull()) + && !jsonObj.get("snapshotId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `snapshotId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("snapshotId").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("volumeId") != null && !jsonObj.get("volumeId").isJsonNull()) + && !jsonObj.get("volumeId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("volumeId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Backup.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Backup' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Backup.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Backup value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Backup read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Backup given an JSON string + * + * @param jsonString JSON string + * @return An instance of Backup + * @throws IOException if the JSON string is invalid with respect to Backup + */ + public static Backup fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Backup.class); + } + + /** + * Convert an instance of Backup 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/BackupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupListResponse.java new file mode 100644 index 0000000..58f7cb6 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupListResponse.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Backup list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class BackupListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public BackupListResponse() {} + + public BackupListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public BackupListResponse addItemsItem(Backup itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list containing backup objects. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BackupListResponse backupListResponse = (BackupListResponse) o; + return Objects.equals(this.items, backupListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BackupListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 BackupListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BackupListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + Backup.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BackupListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BackupListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BackupListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BackupListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BackupListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BackupListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BackupListResponse + * @throws IOException if the JSON string is invalid with respect to BackupListResponse + */ + public static BackupListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BackupListResponse.class); + } + + /** + * Convert an instance of BackupListResponse 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/BackupSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupSource.java new file mode 100644 index 0000000..fc4dec6 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BackupSource.java @@ -0,0 +1,240 @@ +/* + * 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; +import java.util.UUID; + +/** The source object of a backup. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class BackupSource { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private UUID id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public BackupSource() {} + + public BackupSource 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 BackupSource type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The source types of a backup. Possible values: `volume`, `snapshot`. + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BackupSource backupSource = (BackupSource) o; + return Objects.equals(this.id, backupSource.id) + && Objects.equals(this.type, backupSource.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BackupSource {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "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 BackupSource + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BackupSource.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "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 (!BackupSource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BackupSource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BackupSource.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BackupSource value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BackupSource read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BackupSource given an JSON string + * + * @param jsonString JSON string + * @return An instance of BackupSource + * @throws IOException if the JSON string is invalid with respect to BackupSource + */ + public static BackupSource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BackupSource.class); + } + + /** + * Convert an instance of BackupSource 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/BaseSecurityGroupRule.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BaseSecurityGroupRule.java new file mode 100644 index 0000000..d2378f5 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BaseSecurityGroupRule.java @@ -0,0 +1,474 @@ +/* + * 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; +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.14.0") +public class BaseSecurityGroupRule { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + + public static final String SERIALIZED_NAME_DIRECTION = "direction"; + + @SerializedName(SERIALIZED_NAME_DIRECTION) + @javax.annotation.Nonnull + private String direction; + + public static final String SERIALIZED_NAME_ETHERTYPE = "ethertype"; + + @SerializedName(SERIALIZED_NAME_ETHERTYPE) + @javax.annotation.Nullable private String ethertype = "IPv4"; + + public static final String SERIALIZED_NAME_ICMP_PARAMETERS = "icmpParameters"; + + @SerializedName(SERIALIZED_NAME_ICMP_PARAMETERS) + @javax.annotation.Nullable private ICMPParameters icmpParameters; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IP_RANGE = "ipRange"; + + @SerializedName(SERIALIZED_NAME_IP_RANGE) + @javax.annotation.Nullable private String ipRange; + + public static final String SERIALIZED_NAME_PORT_RANGE = "portRange"; + + @SerializedName(SERIALIZED_NAME_PORT_RANGE) + @javax.annotation.Nullable private PortRange portRange; + + public static final String SERIALIZED_NAME_REMOTE_SECURITY_GROUP_ID = "remoteSecurityGroupId"; + + @SerializedName(SERIALIZED_NAME_REMOTE_SECURITY_GROUP_ID) + @javax.annotation.Nullable private UUID remoteSecurityGroupId; + + public static final String SERIALIZED_NAME_SECURITY_GROUP_ID = "securityGroupId"; + + @SerializedName(SERIALIZED_NAME_SECURITY_GROUP_ID) + @javax.annotation.Nullable private UUID securityGroupId; + + public BaseSecurityGroupRule() {} + + public BaseSecurityGroupRule(UUID id, UUID securityGroupId) { + this(); + this.id = id; + this.securityGroupId = securityGroupId; + } + + public BaseSecurityGroupRule 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 BaseSecurityGroupRule direction(@javax.annotation.Nonnull String direction) { + this.direction = direction; + return this; + } + + /** + * The direction of the traffic which the rule should match. Possible values: + * `ingress`, `egress`. + * + * @return direction + */ + @javax.annotation.Nonnull + public String getDirection() { + return direction; + } + + public void setDirection(@javax.annotation.Nonnull String direction) { + this.direction = direction; + } + + public BaseSecurityGroupRule ethertype(@javax.annotation.Nullable String ethertype) { + this.ethertype = ethertype; + return this; + } + + /** + * The ethertype which the rule should match. Possible values: `IPv4`, + * `IPv6`. + * + * @return ethertype + */ + @javax.annotation.Nullable public String getEthertype() { + return ethertype; + } + + public void setEthertype(@javax.annotation.Nullable String ethertype) { + this.ethertype = ethertype; + } + + public BaseSecurityGroupRule icmpParameters( + @javax.annotation.Nullable ICMPParameters icmpParameters) { + this.icmpParameters = icmpParameters; + return this; + } + + /** + * Get icmpParameters + * + * @return icmpParameters + */ + @javax.annotation.Nullable public ICMPParameters getIcmpParameters() { + return icmpParameters; + } + + public void setIcmpParameters(@javax.annotation.Nullable ICMPParameters icmpParameters) { + this.icmpParameters = icmpParameters; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public BaseSecurityGroupRule ipRange(@javax.annotation.Nullable String ipRange) { + this.ipRange = ipRange; + return this; + } + + /** + * The remote IP range which the rule should match. + * + * @return ipRange + */ + @javax.annotation.Nullable public String getIpRange() { + return ipRange; + } + + public void setIpRange(@javax.annotation.Nullable String ipRange) { + this.ipRange = ipRange; + } + + public BaseSecurityGroupRule portRange(@javax.annotation.Nullable PortRange portRange) { + this.portRange = portRange; + return this; + } + + /** + * Get portRange + * + * @return portRange + */ + @javax.annotation.Nullable public PortRange getPortRange() { + return portRange; + } + + public void setPortRange(@javax.annotation.Nullable PortRange portRange) { + this.portRange = portRange; + } + + public BaseSecurityGroupRule remoteSecurityGroupId( + @javax.annotation.Nullable UUID remoteSecurityGroupId) { + this.remoteSecurityGroupId = remoteSecurityGroupId; + return this; + } + + /** + * The remote security group which the rule should match. + * + * @return remoteSecurityGroupId + */ + @javax.annotation.Nullable public UUID getRemoteSecurityGroupId() { + return remoteSecurityGroupId; + } + + public void setRemoteSecurityGroupId(@javax.annotation.Nullable UUID remoteSecurityGroupId) { + this.remoteSecurityGroupId = remoteSecurityGroupId; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return securityGroupId + */ + @javax.annotation.Nullable public UUID getSecurityGroupId() { + return securityGroupId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseSecurityGroupRule baseSecurityGroupRule = (BaseSecurityGroupRule) o; + return Objects.equals(this.description, baseSecurityGroupRule.description) + && Objects.equals(this.direction, baseSecurityGroupRule.direction) + && Objects.equals(this.ethertype, baseSecurityGroupRule.ethertype) + && Objects.equals(this.icmpParameters, baseSecurityGroupRule.icmpParameters) + && Objects.equals(this.id, baseSecurityGroupRule.id) + && Objects.equals(this.ipRange, baseSecurityGroupRule.ipRange) + && Objects.equals(this.portRange, baseSecurityGroupRule.portRange) + && Objects.equals( + this.remoteSecurityGroupId, baseSecurityGroupRule.remoteSecurityGroupId) + && Objects.equals(this.securityGroupId, baseSecurityGroupRule.securityGroupId); + } + + @Override + public int hashCode() { + return Objects.hash( + description, + direction, + ethertype, + icmpParameters, + id, + ipRange, + portRange, + remoteSecurityGroupId, + securityGroupId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseSecurityGroupRule {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); + sb.append(" ethertype: ").append(toIndentedString(ethertype)).append("\n"); + sb.append(" icmpParameters: ").append(toIndentedString(icmpParameters)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ipRange: ").append(toIndentedString(ipRange)).append("\n"); + sb.append(" portRange: ").append(toIndentedString(portRange)).append("\n"); + sb.append(" remoteSecurityGroupId: ") + .append(toIndentedString(remoteSecurityGroupId)) + .append("\n"); + sb.append(" securityGroupId: ").append(toIndentedString(securityGroupId)).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", + "direction", + "ethertype", + "icmpParameters", + "id", + "ipRange", + "portRange", + "remoteSecurityGroupId", + "securityGroupId")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("direction")); + } + + /** + * 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 BaseSecurityGroupRule + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BaseSecurityGroupRule.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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( + "Expected the field `direction` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("direction").toString())); + } + if ((jsonObj.get("ethertype") != null && !jsonObj.get("ethertype").isJsonNull()) + && !jsonObj.get("ethertype").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ethertype` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ethertype").toString())); + } + // validate the optional field `icmpParameters` + if (jsonObj.get("icmpParameters") != null && !jsonObj.get("icmpParameters").isJsonNull()) { + ICMPParameters.validateJsonElement(jsonObj.get("icmpParameters")); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("ipRange") != null && !jsonObj.get("ipRange").isJsonNull()) + && !jsonObj.get("ipRange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ipRange` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ipRange").toString())); + } + // validate the optional field `portRange` + if (jsonObj.get("portRange") != null && !jsonObj.get("portRange").isJsonNull()) { + PortRange.validateJsonElement(jsonObj.get("portRange")); + } + if ((jsonObj.get("remoteSecurityGroupId") != null + && !jsonObj.get("remoteSecurityGroupId").isJsonNull()) + && !jsonObj.get("remoteSecurityGroupId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `remoteSecurityGroupId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("remoteSecurityGroupId").toString())); + } + if ((jsonObj.get("securityGroupId") != null && !jsonObj.get("securityGroupId").isJsonNull()) + && !jsonObj.get("securityGroupId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `securityGroupId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("securityGroupId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BaseSecurityGroupRule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BaseSecurityGroupRule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BaseSecurityGroupRule.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BaseSecurityGroupRule value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BaseSecurityGroupRule read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BaseSecurityGroupRule given an JSON string + * + * @param jsonString JSON string + * @return An instance of BaseSecurityGroupRule + * @throws IOException if the JSON string is invalid with respect to BaseSecurityGroupRule + */ + public static BaseSecurityGroupRule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BaseSecurityGroupRule.class); + } + + /** + * Convert an instance of BaseSecurityGroupRule 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/BootVolume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolume.java new file mode 100644 index 0000000..d18612d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolume.java @@ -0,0 +1,309 @@ +/* + * 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; +import java.util.UUID; + +/** The boot device for the server. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class BootVolume { + public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; + + @SerializedName(SERIALIZED_NAME_DELETE_ON_TERMINATION) + @javax.annotation.Nullable private Boolean deleteOnTermination; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_PERFORMANCE_CLASS = "performanceClass"; + + @SerializedName(SERIALIZED_NAME_PERFORMANCE_CLASS) + @javax.annotation.Nullable private String performanceClass; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable private Long size; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable private BootVolumeSource source; + + public BootVolume() {} + + public BootVolume(UUID id) { + this(); + this.id = id; + } + + public BootVolume deleteOnTermination(@javax.annotation.Nullable Boolean deleteOnTermination) { + this.deleteOnTermination = deleteOnTermination; + return this; + } + + /** + * Delete the volume during the termination of the server. Defaults to false. + * + * @return deleteOnTermination + */ + @javax.annotation.Nullable public Boolean getDeleteOnTermination() { + return deleteOnTermination; + } + + public void setDeleteOnTermination(@javax.annotation.Nullable Boolean deleteOnTermination) { + this.deleteOnTermination = deleteOnTermination; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public BootVolume performanceClass(@javax.annotation.Nullable String performanceClass) { + this.performanceClass = performanceClass; + return this; + } + + /** + * The name for a General Object. Matches Names and also UUIDs. + * + * @return performanceClass + */ + @javax.annotation.Nullable public String getPerformanceClass() { + return performanceClass; + } + + public void setPerformanceClass(@javax.annotation.Nullable String performanceClass) { + this.performanceClass = performanceClass; + } + + public BootVolume size(@javax.annotation.Nullable Long size) { + this.size = size; + return this; + } + + /** + * Size in Gigabyte. + * + * @return size + */ + @javax.annotation.Nullable public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nullable Long size) { + this.size = size; + } + + public BootVolume source(@javax.annotation.Nullable BootVolumeSource source) { + this.source = source; + return this; + } + + /** + * Get source + * + * @return source + */ + @javax.annotation.Nullable public BootVolumeSource getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable BootVolumeSource source) { + this.source = source; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BootVolume bootVolume = (BootVolume) o; + return Objects.equals(this.deleteOnTermination, bootVolume.deleteOnTermination) + && Objects.equals(this.id, bootVolume.id) + && Objects.equals(this.performanceClass, bootVolume.performanceClass) + && Objects.equals(this.size, bootVolume.size) + && Objects.equals(this.source, bootVolume.source); + } + + @Override + public int hashCode() { + return Objects.hash(deleteOnTermination, id, performanceClass, size, source); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BootVolume {\n"); + sb.append(" deleteOnTermination: ") + .append(toIndentedString(deleteOnTermination)) + .append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + 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("}"); + 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( + "deleteOnTermination", "id", "performanceClass", "size", "source")); + + // 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 BootVolume + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BootVolume.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("performanceClass") != null + && !jsonObj.get("performanceClass").isJsonNull()) + && !jsonObj.get("performanceClass").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `performanceClass` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("performanceClass").toString())); + } + // validate the optional field `source` + if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { + BootVolumeSource.validateJsonElement(jsonObj.get("source")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BootVolume.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BootVolume' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BootVolume.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BootVolume value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BootVolume read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BootVolume given an JSON string + * + * @param jsonString JSON string + * @return An instance of BootVolume + * @throws IOException if the JSON string is invalid with respect to BootVolume + */ + public static BootVolume fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BootVolume.class); + } + + /** + * Convert an instance of BootVolume 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/BootVolumeSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolumeSource.java new file mode 100644 index 0000000..8ebf66a --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/BootVolumeSource.java @@ -0,0 +1,241 @@ +/* + * 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; +import java.util.UUID; + +/** The source object of a boot volume. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class BootVolumeSource { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private UUID id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public BootVolumeSource() {} + + public BootVolumeSource 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 BootVolumeSource type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The source types of a boot volume. Possible values: `image`, `volume`. + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BootVolumeSource bootVolumeSource = (BootVolumeSource) o; + return Objects.equals(this.id, bootVolumeSource.id) + && Objects.equals(this.type, bootVolumeSource.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BootVolumeSource {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "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 BootVolumeSource + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BootVolumeSource.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "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 (!BootVolumeSource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BootVolumeSource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BootVolumeSource.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BootVolumeSource value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BootVolumeSource read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BootVolumeSource given an JSON string + * + * @param jsonString JSON string + * @return An instance of BootVolumeSource + * @throws IOException if the JSON string is invalid with respect to BootVolumeSource + */ + public static BootVolumeSource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BootVolumeSource.class); + } + + /** + * Convert an instance of BootVolumeSource 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/CreateAffinityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAffinityGroupPayload.java new file mode 100644 index 0000000..4c2e27e --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAffinityGroupPayload.java @@ -0,0 +1,304 @@ +/* + * 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 java.util.UUID; + +/** Definition of an affinity group. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateAffinityGroupPayload { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_MEMBERS = "members"; + + @SerializedName(SERIALIZED_NAME_MEMBERS) + @javax.annotation.Nullable private List members = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_POLICY = "policy"; + + @SerializedName(SERIALIZED_NAME_POLICY) + @javax.annotation.Nonnull + private String policy; + + public CreateAffinityGroupPayload() {} + + public CreateAffinityGroupPayload(UUID id, List members) { + this(); + this.id = id; + this.members = members; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + /** + * The servers that are part of the affinity group. + * + * @return members + */ + @javax.annotation.Nullable public List getMembers() { + return members; + } + + public CreateAffinityGroupPayload 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 CreateAffinityGroupPayload policy(@javax.annotation.Nonnull String policy) { + this.policy = policy; + return this; + } + + /** + * The affinity group policy. `hard-affinity`: All servers in this group will be + * hosted on the same compute node. `soft-affinity`: All servers in this group will be + * hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in + * this group will be hosted on different compute nodes. `soft-anti-affinity`: All + * servers in this group will be hosted on as many compute nodes as possible. Possible values: + * `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, + * `soft-affinity`. + * + * @return policy + */ + @javax.annotation.Nonnull + public String getPolicy() { + return policy; + } + + public void setPolicy(@javax.annotation.Nonnull String policy) { + this.policy = policy; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAffinityGroupPayload createAffinityGroupPayload = (CreateAffinityGroupPayload) 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); + } + + @Override + public int hashCode() { + return Objects.hash(id, members, name, policy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAffinityGroupPayload {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + 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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "members", "name", "policy")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "policy")); + } + + /** + * 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 CreateAffinityGroupPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateAffinityGroupPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("members") != null + && !jsonObj.get("members").isJsonNull() + && !jsonObj.get("members").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "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( + "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( + "Expected the field `policy` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("policy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAffinityGroupPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAffinityGroupPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateAffinityGroupPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAffinityGroupPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAffinityGroupPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAffinityGroupPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAffinityGroupPayload + * @throws IOException if the JSON string is invalid with respect to CreateAffinityGroupPayload + */ + public static CreateAffinityGroupPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAffinityGroupPayload.class); + } + + /** + * Convert an instance of CreateAffinityGroupPayload 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/CreateAreaAddressFamily.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAreaAddressFamily.java new file mode 100644 index 0000000..fbdaaf0 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAreaAddressFamily.java @@ -0,0 +1,194 @@ +/* + * 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.14.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/CreateAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAreaIPv4.java new file mode 100644 index 0000000..5c0866f --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateAreaIPv4.java @@ -0,0 +1,447 @@ +/* + * 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 config object for a IPv4 network area. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateAreaIPv4 { + 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; + + 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 CreateAreaIPv4() {} + + public CreateAreaIPv4 defaultNameservers( + @javax.annotation.Nullable List defaultNameservers) { + this.defaultNameservers = defaultNameservers; + return this; + } + + public CreateAreaIPv4 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 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); + 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 CreateAreaIPv4 routes(@javax.annotation.Nullable List routes) { + this.routes = routes; + return this; + } + + public CreateAreaIPv4 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 CreateAreaIPv4 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; + } + + public CreateAreaIPv4 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 CreateAreaIPv4 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 CreateAreaIPv4 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; + } + 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); + } + + @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 CreateAreaIPv4 {\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(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 CreateAreaIPv4 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateAreaIPv4.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())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateAreaIPv4.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 (!CreateAreaIPv4.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAreaIPv4' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateAreaIPv4.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAreaIPv4 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAreaIPv4 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAreaIPv4 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 + */ + public static CreateAreaIPv4 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAreaIPv4.class); + } + + /** + * Convert an instance of CreateAreaIPv4 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 new file mode 100644 index 0000000..96b80b3 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateBackupPayload.java @@ -0,0 +1,263 @@ +/* + * 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; + +/** Object that represents a backup create request body. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateBackupPayload { + 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_SOURCE = "source"; + + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nonnull + private BackupSource source; + + public CreateBackupPayload() {} + + public CreateBackupPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public CreateBackupPayload 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 CreateBackupPayload source(@javax.annotation.Nonnull BackupSource source) { + this.source = source; + return this; + } + + /** + * Get source + * + * @return source + */ + @javax.annotation.Nonnull + public BackupSource getSource() { + return source; + } + + public void setSource(@javax.annotation.Nonnull BackupSource source) { + this.source = source; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBackupPayload createBackupPayload = (CreateBackupPayload) o; + return Objects.equals(this.labels, createBackupPayload.labels) + && Objects.equals(this.name, createBackupPayload.name) + && Objects.equals(this.source, createBackupPayload.source); + } + + @Override + public int hashCode() { + return Objects.hash(labels, name, source); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateBackupPayload {\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("}"); + 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", "name", "source")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("source")); + } + + /** + * 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 CreateBackupPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateBackupPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + // validate the required field `source` + BackupSource.validateJsonElement(jsonObj.get("source")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateBackupPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateBackupPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateBackupPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateBackupPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateBackupPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateBackupPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateBackupPayload + * @throws IOException if the JSON string is invalid with respect to CreateBackupPayload + */ + public static CreateBackupPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateBackupPayload.class); + } + + /** + * Convert an instance of CreateBackupPayload 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/CreateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateImagePayload.java new file mode 100644 index 0000000..9346faf --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateImagePayload.java @@ -0,0 +1,622 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; + +/** + * Object that represents an Image and its parameters. Used for Creating and returning (get/list). + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateImagePayload { + public static final String SERIALIZED_NAME_AGENT = "agent"; + + @SerializedName(SERIALIZED_NAME_AGENT) + @javax.annotation.Nullable private ImageAgent agent; + + public static final String SERIALIZED_NAME_CHECKSUM = "checksum"; + + @SerializedName(SERIALIZED_NAME_CHECKSUM) + @javax.annotation.Nullable private ImageChecksum checksum; + + public static final String SERIALIZED_NAME_CONFIG = "config"; + + @SerializedName(SERIALIZED_NAME_CONFIG) + @javax.annotation.Nullable private ImageConfig config; + + 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_DISK_FORMAT = "diskFormat"; + + @SerializedName(SERIALIZED_NAME_DISK_FORMAT) + @javax.annotation.Nonnull + private String diskFormat; + + 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_MIN_DISK_SIZE = "minDiskSize"; + + @SerializedName(SERIALIZED_NAME_MIN_DISK_SIZE) + @javax.annotation.Nullable private Long minDiskSize; + + public static final String SERIALIZED_NAME_MIN_RAM = "minRam"; + + @SerializedName(SERIALIZED_NAME_MIN_RAM) + @javax.annotation.Nullable private Long minRam; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_OWNER = "owner"; + + @SerializedName(SERIALIZED_NAME_OWNER) + @javax.annotation.Nullable private UUID owner; + + public static final String SERIALIZED_NAME_PROTECTED = "protected"; + + @SerializedName(SERIALIZED_NAME_PROTECTED) + @javax.annotation.Nullable private Boolean _protected; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable private String scope; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable private Long size; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public CreateImagePayload() {} + + public CreateImagePayload( + ImageChecksum checksum, + OffsetDateTime createdAt, + UUID id, + UUID owner, + String scope, + Long size, + String status, + OffsetDateTime updatedAt) { + this(); + this.checksum = checksum; + this.createdAt = createdAt; + this.id = id; + this.owner = owner; + this.scope = scope; + this.size = size; + this.status = status; + this.updatedAt = updatedAt; + } + + public CreateImagePayload agent(@javax.annotation.Nullable ImageAgent agent) { + this.agent = agent; + return this; + } + + /** + * Get agent + * + * @return agent + */ + @javax.annotation.Nullable public ImageAgent getAgent() { + return agent; + } + + public void setAgent(@javax.annotation.Nullable ImageAgent agent) { + this.agent = agent; + } + + /** + * Get checksum + * + * @return checksum + */ + @javax.annotation.Nullable public ImageChecksum getChecksum() { + return checksum; + } + + public CreateImagePayload config(@javax.annotation.Nullable ImageConfig config) { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config + */ + @javax.annotation.Nullable public ImageConfig getConfig() { + return config; + } + + public void setConfig(@javax.annotation.Nullable ImageConfig config) { + this.config = config; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public CreateImagePayload 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; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public CreateImagePayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public CreateImagePayload minDiskSize(@javax.annotation.Nullable Long minDiskSize) { + this.minDiskSize = minDiskSize; + return this; + } + + /** + * Size in Gigabyte. + * + * @return minDiskSize + */ + @javax.annotation.Nullable public Long getMinDiskSize() { + return minDiskSize; + } + + public void setMinDiskSize(@javax.annotation.Nullable Long minDiskSize) { + this.minDiskSize = minDiskSize; + } + + public CreateImagePayload minRam(@javax.annotation.Nullable Long minRam) { + this.minRam = minRam; + return this; + } + + /** + * Size in Megabyte. + * + * @return minRam + */ + @javax.annotation.Nullable public Long getMinRam() { + return minRam; + } + + public void setMinRam(@javax.annotation.Nullable Long minRam) { + this.minRam = minRam; + } + + public CreateImagePayload 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; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return owner + */ + @javax.annotation.Nullable public UUID getOwner() { + return owner; + } + + public CreateImagePayload _protected(@javax.annotation.Nullable Boolean _protected) { + this._protected = _protected; + return this; + } + + /** + * When true the 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; + } + + /** + * Scope of an Image. Possible values: `public`, `local`, + * `projects`, `organization`. + * + * @return scope + */ + @javax.annotation.Nullable public String getScope() { + return scope; + } + + /** + * Size in bytes. + * + * @return size + */ + @javax.annotation.Nullable public Long getSize() { + return size; + } + + /** + * The status of an image object. Possible values: `AVAILABLE`, `CREATING`, + * `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateImagePayload createImagePayload = (CreateImagePayload) o; + return Objects.equals(this.agent, createImagePayload.agent) + && Objects.equals(this.checksum, createImagePayload.checksum) + && Objects.equals(this.config, createImagePayload.config) + && Objects.equals(this.createdAt, createImagePayload.createdAt) + && Objects.equals(this.diskFormat, createImagePayload.diskFormat) + && Objects.equals(this.id, createImagePayload.id) + && Objects.equals(this.labels, createImagePayload.labels) + && Objects.equals(this.minDiskSize, createImagePayload.minDiskSize) + && Objects.equals(this.minRam, createImagePayload.minRam) + && Objects.equals(this.name, createImagePayload.name) + && Objects.equals(this.owner, createImagePayload.owner) + && Objects.equals(this._protected, createImagePayload._protected) + && Objects.equals(this.scope, createImagePayload.scope) + && Objects.equals(this.size, createImagePayload.size) + && Objects.equals(this.status, createImagePayload.status) + && Objects.equals(this.updatedAt, createImagePayload.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + agent, + checksum, + config, + createdAt, + diskFormat, + id, + labels, + minDiskSize, + minRam, + name, + owner, + _protected, + scope, + size, + status, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateImagePayload {\n"); + sb.append(" agent: ").append(toIndentedString(agent)).append("\n"); + sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + 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(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" minDiskSize: ").append(toIndentedString(minDiskSize)).append("\n"); + sb.append(" minRam: ").append(toIndentedString(minRam)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); + sb.append(" _protected: ").append(toIndentedString(_protected)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + 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("}"); + 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( + "agent", + "checksum", + "config", + "createdAt", + "diskFormat", + "id", + "labels", + "minDiskSize", + "minRam", + "name", + "owner", + "protected", + "scope", + "size", + "status", + "updatedAt")); + + // 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 CreateImagePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateImagePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `agent` + if (jsonObj.get("agent") != null && !jsonObj.get("agent").isJsonNull()) { + ImageAgent.validateJsonElement(jsonObj.get("agent")); + } + // validate the optional field `checksum` + if (jsonObj.get("checksum") != null && !jsonObj.get("checksum").isJsonNull()) { + ImageChecksum.validateJsonElement(jsonObj.get("checksum")); + } + // validate the optional field `config` + if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { + ImageConfig.validateJsonElement(jsonObj.get("config")); + } + if (!jsonObj.get("diskFormat").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `diskFormat` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("diskFormat").toString())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("owner") != null && !jsonObj.get("owner").isJsonNull()) + && !jsonObj.get("owner").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `owner` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("owner").toString())); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) + && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("scope").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!CreateImagePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateImagePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateImagePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateImagePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateImagePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateImagePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateImagePayload + * @throws IOException if the JSON string is invalid with respect to CreateImagePayload + */ + public static CreateImagePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateImagePayload.class); + } + + /** + * Convert an instance of CreateImagePayload 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 new file mode 100644 index 0000000..cd28864 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateKeyPairPayload.java @@ -0,0 +1,340 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.0") +public class CreateKeyPairPayload { + 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_FINGERPRINT = "fingerprint"; + + @SerializedName(SERIALIZED_NAME_FINGERPRINT) + @javax.annotation.Nullable private String fingerprint; + + 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_PUBLIC_KEY = "publicKey"; + + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + @javax.annotation.Nonnull + private String publicKey; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public CreateKeyPairPayload() {} + + public CreateKeyPairPayload( + OffsetDateTime createdAt, String fingerprint, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.fingerprint = fingerprint; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Object that represents an SSH keypair MD5 fingerprint. + * + * @return fingerprint + */ + @javax.annotation.Nullable public String getFingerprint() { + return fingerprint; + } + + public CreateKeyPairPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public CreateKeyPairPayload name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the + * following special characters: [@._-]. + * + * @return name + */ + @javax.annotation.Nullable public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + public CreateKeyPairPayload publicKey(@javax.annotation.Nonnull String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Object that represents a public SSH key. + * + * @return publicKey + */ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + public void setPublicKey(@javax.annotation.Nonnull String publicKey) { + this.publicKey = publicKey; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateKeyPairPayload createKeyPairPayload = (CreateKeyPairPayload) o; + return Objects.equals(this.createdAt, createKeyPairPayload.createdAt) + && Objects.equals(this.fingerprint, createKeyPairPayload.fingerprint) + && Objects.equals(this.labels, createKeyPairPayload.labels) + && Objects.equals(this.name, createKeyPairPayload.name) + && Objects.equals(this.publicKey, createKeyPairPayload.publicKey) + && Objects.equals(this.updatedAt, createKeyPairPayload.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, fingerprint, labels, name, publicKey, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateKeyPairPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + 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("}"); + 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", + "fingerprint", + "labels", + "name", + "publicKey", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("publicKey")); + } + + /** + * 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 CreateKeyPairPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateKeyPairPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("fingerprint") != null && !jsonObj.get("fingerprint").isJsonNull()) + && !jsonObj.get("fingerprint").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("fingerprint").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateKeyPairPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateKeyPairPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateKeyPairPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateKeyPairPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateKeyPairPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateKeyPairPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateKeyPairPayload + * @throws IOException if the JSON string is invalid with respect to CreateKeyPairPayload + */ + public static CreateKeyPairPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateKeyPairPayload.class); + } + + /** + * Convert an instance of CreateKeyPairPayload 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/CreateNetworkAddressFamily.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAddressFamily.java new file mode 100644 index 0000000..b37204e --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAddressFamily.java @@ -0,0 +1,223 @@ +/* + * 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.14.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 new file mode 100644 index 0000000..906828f --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaPayload.java @@ -0,0 +1,266 @@ +/* + * 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; + +/** CreateNetworkAreaPayload */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.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) + @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 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; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public CreateNetworkAreaPayload 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + 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); + } + + @Override + public int hashCode() { + return Objects.hash(addressFamily, labels, name); + } + + @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("}"); + 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("addressFamily", "labels", "name")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("addressFamily", "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 CreateNetworkAreaPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNetworkAreaPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + 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( + "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 (!CreateNetworkAreaPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNetworkAreaPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkAreaPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNetworkAreaPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateNetworkAreaPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateNetworkAreaPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNetworkAreaPayload + * @throws IOException if the JSON string is invalid with respect to CreateNetworkAreaPayload + */ + public static CreateNetworkAreaPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNetworkAreaPayload.class); + } + + /** + * Convert an instance of CreateNetworkAreaPayload 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/CreateNetworkAreaRangePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRangePayload.java new file mode 100644 index 0000000..12b1e1e --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRangePayload.java @@ -0,0 +1,224 @@ +/* + * 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; + +/** CreateNetworkAreaRangePayload */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateNetworkAreaRangePayload { + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private List ipv4 = new ArrayList<>(); + + public CreateNetworkAreaRangePayload() {} + + public CreateNetworkAreaRangePayload ipv4(@javax.annotation.Nullable List ipv4) { + this.ipv4 = ipv4; + return this; + } + + public CreateNetworkAreaRangePayload addIpv4Item(NetworkRange ipv4Item) { + if (this.ipv4 == null) { + this.ipv4 = new ArrayList<>(); + } + this.ipv4.add(ipv4Item); + return this; + } + + /** + * A list of network ranges. + * + * @return ipv4 + */ + @javax.annotation.Nullable public List getIpv4() { + return ipv4; + } + + public void setIpv4(@javax.annotation.Nullable List ipv4) { + this.ipv4 = ipv4; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateNetworkAreaRangePayload createNetworkAreaRangePayload = + (CreateNetworkAreaRangePayload) o; + return Objects.equals(this.ipv4, createNetworkAreaRangePayload.ipv4); + } + + @Override + public int hashCode() { + return Objects.hash(ipv4); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNetworkAreaRangePayload {\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 + * CreateNetworkAreaRangePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNetworkAreaRangePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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"); + 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++) { + NetworkRange.validateJsonElement(jsonArrayipv4.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNetworkAreaRangePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNetworkAreaRangePayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateNetworkAreaRangePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNetworkAreaRangePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateNetworkAreaRangePayload read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateNetworkAreaRangePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNetworkAreaRangePayload + * @throws IOException if the JSON string is invalid with respect to + * CreateNetworkAreaRangePayload + */ + public static CreateNetworkAreaRangePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNetworkAreaRangePayload.class); + } + + /** + * Convert an instance of CreateNetworkAreaRangePayload 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 new file mode 100644 index 0000000..a7f2ae0 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkAreaRoutePayload.java @@ -0,0 +1,224 @@ +/* + * 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; + +/** CreateNetworkAreaRoutePayload */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateNetworkAreaRoutePayload { + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private List ipv4 = new ArrayList<>(); + + public CreateNetworkAreaRoutePayload() {} + + public CreateNetworkAreaRoutePayload ipv4(@javax.annotation.Nullable List ipv4) { + this.ipv4 = ipv4; + return this; + } + + public CreateNetworkAreaRoutePayload addIpv4Item(Route ipv4Item) { + if (this.ipv4 == null) { + this.ipv4 = new ArrayList<>(); + } + this.ipv4.add(ipv4Item); + return this; + } + + /** + * A list of routes. + * + * @return ipv4 + */ + @javax.annotation.Nullable public List getIpv4() { + return ipv4; + } + + public void setIpv4(@javax.annotation.Nullable List ipv4) { + this.ipv4 = ipv4; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateNetworkAreaRoutePayload createNetworkAreaRoutePayload = + (CreateNetworkAreaRoutePayload) o; + return Objects.equals(this.ipv4, createNetworkAreaRoutePayload.ipv4); + } + + @Override + public int hashCode() { + return Objects.hash(ipv4); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNetworkAreaRoutePayload {\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 + * CreateNetworkAreaRoutePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNetworkAreaRoutePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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())) { + 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())); + } + } + 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)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateNetworkAreaRoutePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNetworkAreaRoutePayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateNetworkAreaRoutePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNetworkAreaRoutePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateNetworkAreaRoutePayload read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateNetworkAreaRoutePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNetworkAreaRoutePayload + * @throws IOException if the JSON string is invalid with respect to + * CreateNetworkAreaRoutePayload + */ + public static CreateNetworkAreaRoutePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNetworkAreaRoutePayload.class); + } + + /** + * Convert an instance of CreateNetworkAreaRoutePayload 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 new file mode 100644 index 0000000..4d291ce --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv4Body.java @@ -0,0 +1,317 @@ +/* + * 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.14.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/CreateNetworkIPv6Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6Body.java new file mode 100644 index 0000000..610c4ab --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkIPv6Body.java @@ -0,0 +1,317 @@ +/* + * 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.14.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/CreateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkPayload.java new file mode 100644 index 0000000..654dc1b --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNetworkPayload.java @@ -0,0 +1,318 @@ +/* + * 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; + +/** Object that represents the request body for a network create. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.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_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_ROUTED = "routed"; + + @SerializedName(SERIALIZED_NAME_ROUTED) + @javax.annotation.Nullable private Boolean routed; + + public CreateNetworkPayload() {} + + public CreateNetworkPayload addressFamily( + @javax.annotation.Nullable CreateNetworkAddressFamily addressFamily) { + this.addressFamily = addressFamily; + return this; + } + + /** + * Get addressFamily + * + * @return addressFamily + */ + @javax.annotation.Nullable public CreateNetworkAddressFamily getAddressFamily() { + return addressFamily; + } + + public void setAddressFamily( + @javax.annotation.Nullable CreateNetworkAddressFamily addressFamily) { + this.addressFamily = addressFamily; + } + + public CreateNetworkPayload 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 CreateNetworkPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public CreateNetworkPayload 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 CreateNetworkPayload routed(@javax.annotation.Nullable Boolean routed) { + this.routed = routed; + return this; + } + + /** + * Shows if the network is routed and therefore accessible from other networks. + * + * @return routed + */ + @javax.annotation.Nullable public Boolean getRouted() { + return routed; + } + + public void setRouted(@javax.annotation.Nullable Boolean routed) { + this.routed = routed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateNetworkPayload createNetworkPayload = (CreateNetworkPayload) o; + return Objects.equals(this.addressFamily, createNetworkPayload.addressFamily) + && Objects.equals(this.dhcp, createNetworkPayload.dhcp) + && Objects.equals(this.labels, createNetworkPayload.labels) + && Objects.equals(this.name, createNetworkPayload.name) + && Objects.equals(this.routed, createNetworkPayload.routed); + } + + @Override + public int hashCode() { + return Objects.hash(addressFamily, dhcp, labels, name, routed); + } + + @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(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" routed: ").append(toIndentedString(routed)).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("addressFamily", "dhcp", "labels", "name", "routed")); + + // 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 CreateNetworkPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNetworkPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + 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")); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!CreateNetworkPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNetworkPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateNetworkPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNetworkPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateNetworkPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateNetworkPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNetworkPayload + * @throws IOException if the JSON string is invalid with respect to CreateNetworkPayload + */ + public static CreateNetworkPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNetworkPayload.class); + } + + /** + * Convert an instance of CreateNetworkPayload 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/CreateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNicPayload.java new file mode 100644 index 0000000..4a9bd7f --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateNicPayload.java @@ -0,0 +1,591 @@ +/* + * 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; +import java.util.UUID; + +/** Object that represents a network interface. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateNicPayload { + public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; + + @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) + @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DEVICE = "device"; + + @SerializedName(SERIALIZED_NAME_DEVICE) + @javax.annotation.Nullable private UUID device; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private String ipv4; + + public static final String SERIALIZED_NAME_IPV6 = "ipv6"; + + @SerializedName(SERIALIZED_NAME_IPV6) + @javax.annotation.Nullable private String ipv6; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_MAC = "mac"; + + @SerializedName(SERIALIZED_NAME_MAC) + @javax.annotation.Nullable private String mac; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; + + public static final String SERIALIZED_NAME_NETWORK_ID = "networkId"; + + @SerializedName(SERIALIZED_NAME_NETWORK_ID) + @javax.annotation.Nullable private UUID networkId; + + public static final String SERIALIZED_NAME_NIC_SECURITY = "nicSecurity"; + + @SerializedName(SERIALIZED_NAME_NIC_SECURITY) + @javax.annotation.Nullable private Boolean nicSecurity = true; + + public static final String SERIALIZED_NAME_SECURITY_GROUPS = "securityGroups"; + + @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) + @javax.annotation.Nullable private List securityGroups = new ArrayList<>(); + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable private String type; + + public CreateNicPayload() {} + + public CreateNicPayload( + UUID device, UUID id, String mac, UUID networkId, String status, String type) { + this(); + this.device = device; + this.id = id; + this.mac = mac; + this.networkId = networkId; + this.status = status; + this.type = type; + } + + public CreateNicPayload allowedAddresses( + @javax.annotation.Nullable List allowedAddresses) { + this.allowedAddresses = allowedAddresses; + return this; + } + + public CreateNicPayload addAllowedAddressesItem(AllowedAddressesInner allowedAddressesItem) { + if (this.allowedAddresses == null) { + this.allowedAddresses = new ArrayList<>(); + } + this.allowedAddresses.add(allowedAddressesItem); + return this; + } + + /** + * A list of IPs or CIDR notations. + * + * @return allowedAddresses + */ + @javax.annotation.Nullable public List getAllowedAddresses() { + return allowedAddresses; + } + + public void setAllowedAddresses( + @javax.annotation.Nullable List allowedAddresses) { + this.allowedAddresses = allowedAddresses; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return device + */ + @javax.annotation.Nullable public UUID getDevice() { + return device; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public CreateNicPayload ipv4(@javax.annotation.Nullable String ipv4) { + this.ipv4 = ipv4; + return this; + } + + /** + * Object that represents an IP address. + * + * @return ipv4 + */ + @javax.annotation.Nullable public String getIpv4() { + return ipv4; + } + + public void setIpv4(@javax.annotation.Nullable String ipv4) { + this.ipv4 = ipv4; + } + + public CreateNicPayload ipv6(@javax.annotation.Nullable String ipv6) { + this.ipv6 = ipv6; + return this; + } + + /** + * String that represents an IPv6 address. + * + * @return ipv6 + */ + @javax.annotation.Nullable public String getIpv6() { + return ipv6; + } + + public void setIpv6(@javax.annotation.Nullable String ipv6) { + this.ipv6 = ipv6; + } + + public CreateNicPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + /** + * Object that represents an MAC address. + * + * @return mac + */ + @javax.annotation.Nullable public String getMac() { + return mac; + } + + public CreateNicPayload 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; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return networkId + */ + @javax.annotation.Nullable public UUID getNetworkId() { + return networkId; + } + + public CreateNicPayload nicSecurity(@javax.annotation.Nullable Boolean nicSecurity) { + this.nicSecurity = nicSecurity; + return this; + } + + /** + * If this is set to false, then no security groups will apply to this network interface. + * + * @return nicSecurity + */ + @javax.annotation.Nullable public Boolean getNicSecurity() { + return nicSecurity; + } + + public void setNicSecurity(@javax.annotation.Nullable Boolean nicSecurity) { + this.nicSecurity = nicSecurity; + } + + public CreateNicPayload securityGroups(@javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + public CreateNicPayload addSecurityGroupsItem(UUID securityGroupsItem) { + if (this.securityGroups == null) { + this.securityGroups = new ArrayList<>(); + } + this.securityGroups.add(securityGroupsItem); + return this; + } + + /** + * A list of UUIDs. + * + * @return securityGroups + */ + @javax.annotation.Nullable public List getSecurityGroups() { + return securityGroups; + } + + public void setSecurityGroups(@javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + } + + /** + * Possible values: `ACTIVE`, `DOWN`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Possible values: `server`, `metadata`, `gateway`, + * `none`. + * + * @return type + */ + @javax.annotation.Nullable public String getType() { + return type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateNicPayload createNicPayload = (CreateNicPayload) o; + return Objects.equals(this.allowedAddresses, createNicPayload.allowedAddresses) + && Objects.equals(this.device, createNicPayload.device) + && Objects.equals(this.id, createNicPayload.id) + && Objects.equals(this.ipv4, createNicPayload.ipv4) + && Objects.equals(this.ipv6, createNicPayload.ipv6) + && Objects.equals(this.labels, createNicPayload.labels) + && Objects.equals(this.mac, createNicPayload.mac) + && Objects.equals(this.name, createNicPayload.name) + && Objects.equals(this.networkId, createNicPayload.networkId) + && Objects.equals(this.nicSecurity, createNicPayload.nicSecurity) + && Objects.equals(this.securityGroups, createNicPayload.securityGroups) + && Objects.equals(this.status, createNicPayload.status) + && Objects.equals(this.type, createNicPayload.type); + } + + @Override + public int hashCode() { + return Objects.hash( + allowedAddresses, + device, + id, + ipv4, + ipv6, + labels, + mac, + name, + networkId, + nicSecurity, + securityGroups, + status, + type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNicPayload {\n"); + sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" device: ").append(toIndentedString(device)).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(" mac: ").append(toIndentedString(mac)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" networkId: ").append(toIndentedString(networkId)).append("\n"); + sb.append(" nicSecurity: ").append(toIndentedString(nicSecurity)).append("\n"); + 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("}"); + 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( + "allowedAddresses", + "device", + "id", + "ipv4", + "ipv6", + "labels", + "mac", + "name", + "networkId", + "nicSecurity", + "securityGroups", + "status", + "type")); + + // 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 CreateNicPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateNicPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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()) { + JsonArray jsonArrayallowedAddresses = jsonObj.getAsJsonArray("allowedAddresses"); + if (jsonArrayallowedAddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("allowedAddresses").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `allowedAddresses` to be an array in the JSON string but got `%s`", + jsonObj.get("allowedAddresses").toString())); + } + + // validate the optional field `allowedAddresses` (array) + for (int i = 0; i < jsonArrayallowedAddresses.size(); i++) { + AllowedAddressesInner.validateJsonElement(jsonArrayallowedAddresses.get(i)); + } + ; + } + } + if ((jsonObj.get("device") != null && !jsonObj.get("device").isJsonNull()) + && !jsonObj.get("device").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `device` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("device").toString())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) + && !jsonObj.get("ipv4").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ipv4` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ipv4").toString())); + } + if ((jsonObj.get("ipv6") != null && !jsonObj.get("ipv6").isJsonNull()) + && !jsonObj.get("ipv6").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ipv6` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ipv6").toString())); + } + if ((jsonObj.get("mac") != null && !jsonObj.get("mac").isJsonNull()) + && !jsonObj.get("mac").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `mac` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("mac").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("networkId") != null && !jsonObj.get("networkId").isJsonNull()) + && !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("securityGroups") != null + && !jsonObj.get("securityGroups").isJsonNull() + && !jsonObj.get("securityGroups").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", + jsonObj.get("securityGroups").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!CreateNicPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateNicPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateNicPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateNicPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateNicPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateNicPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateNicPayload + * @throws IOException if the JSON string is invalid with respect to CreateNicPayload + */ + public static CreateNicPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateNicPayload.class); + } + + /** + * Convert an instance of CreateNicPayload 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/CreateProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateProtocol.java new file mode 100644 index 0000000..1263344 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateProtocol.java @@ -0,0 +1,290 @@ +/* + * 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.JsonPrimitive; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateProtocol extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(CreateProtocol.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateProtocol.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateProtocol' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterLong = + gson.getDelegateAdapter(this, TypeToken.get(Long.class)); + final TypeAdapter adapterString = + gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateProtocol value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Long` + if (value.getActualInstance() instanceof Long) { + JsonPrimitive primitive = + adapterLong + .toJsonTree((Long) value.getActualInstance()) + .getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = + adapterString + .toJsonTree((String) value.getActualInstance()) + .getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas: Long, String"); + } + + @Override + public CreateProtocol read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Long + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be of type Number in the JSON string but got `%s`", + jsonElement.toString())); + } + actualAdapter = adapterLong; + match++; + log.log(Level.FINER, "Input data matches schema 'Long'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Long failed with `%s`.", + e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Long'", e); + } + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be of type String in the JSON string but got `%s`", + jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for String failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'String'", + e); + } + + if (match == 1) { + CreateProtocol ret = new CreateProtocol(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for CreateProtocol: %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 CreateProtocol() { + super("oneOf", Boolean.FALSE); + } + + public CreateProtocol(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Long", Long.class); + schemas.put("String", String.class); + } + + @Override + public Map> getSchemas() { + return CreateProtocol.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: Long, String + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Long) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Long, String"); + } + + /** + * Get the actual instance, which can be the following: Long, String + * + * @return The actual instance (Long, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Long`. If the actual instance is not `Long`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `Long` + * @throws ClassCastException if the instance is not `Long` + */ + public Long getLong() throws ClassCastException { + return (Long) super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateProtocol + */ + 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 Long + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException( + String.format( + "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())); + // continue to the next one + } + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException( + String.format( + "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())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "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())); + } + } + + /** + * Create an instance of CreateProtocol given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateProtocol + * @throws IOException if the JSON string is invalid with respect to CreateProtocol + */ + public static CreateProtocol fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateProtocol.class); + } + + /** + * Convert an instance of CreateProtocol 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/CreatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreatePublicIPPayload.java new file mode 100644 index 0000000..bdea159 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreatePublicIPPayload.java @@ -0,0 +1,297 @@ +/* + * 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; +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.14.0") +public class CreatePublicIPPayload { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IP = "ip"; + + @SerializedName(SERIALIZED_NAME_IP) + @javax.annotation.Nullable private String ip; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_NETWORK_INTERFACE = "networkInterface"; + + @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) + @javax.annotation.Nullable private UUID networkInterface; + + public CreatePublicIPPayload() {} + + public CreatePublicIPPayload(UUID id, String ip) { + this(); + this.id = id; + this.ip = ip; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + /** + * Object that represents an IP address. + * + * @return ip + */ + @javax.annotation.Nullable public String getIp() { + return ip; + } + + public CreatePublicIPPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public CreatePublicIPPayload networkInterface( + @javax.annotation.Nullable UUID networkInterface) { + this.networkInterface = networkInterface; + return this; + } + + /** + * Associate the public IP with a network interface (ID). + * + * @return networkInterface + */ + @javax.annotation.Nullable public UUID getNetworkInterface() { + return networkInterface; + } + + public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface) { + this.networkInterface = networkInterface; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePublicIPPayload createPublicIPPayload = (CreatePublicIPPayload) 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); + } + + 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(id, ip, labels, networkInterface); + } + + 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 CreatePublicIPPayload {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + 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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = + new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + + // 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 CreatePublicIPPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreatePublicIPPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("ip") != null && !jsonObj.get("ip").isJsonNull()) + && !jsonObj.get("ip").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ip` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ip").toString())); + } + if ((jsonObj.get("networkInterface") != null + && !jsonObj.get("networkInterface").isJsonNull()) + && !jsonObj.get("networkInterface").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `networkInterface` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("networkInterface").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreatePublicIPPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreatePublicIPPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreatePublicIPPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreatePublicIPPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreatePublicIPPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreatePublicIPPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreatePublicIPPayload + * @throws IOException if the JSON string is invalid with respect to CreatePublicIPPayload + */ + public static CreatePublicIPPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreatePublicIPPayload.class); + } + + /** + * Convert an instance of CreatePublicIPPayload 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/CreateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupPayload.java new file mode 100644 index 0000000..98782c7 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupPayload.java @@ -0,0 +1,409 @@ +/* + * 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.time.OffsetDateTime; +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 java.util.UUID; + +/** Object that represents a security group. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateSecurityGroupPayload { + 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) + @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_RULES = "rules"; + + @SerializedName(SERIALIZED_NAME_RULES) + @javax.annotation.Nullable private List rules; + + public static final String SERIALIZED_NAME_STATEFUL = "stateful"; + + @SerializedName(SERIALIZED_NAME_STATEFUL) + @javax.annotation.Nullable private Boolean stateful = true; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public CreateSecurityGroupPayload() {} + + public CreateSecurityGroupPayload( + OffsetDateTime createdAt, + UUID id, + List rules, + OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.id = id; + this.rules = rules; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public CreateSecurityGroupPayload 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). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public CreateSecurityGroupPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public CreateSecurityGroupPayload 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 list containing security group rule objects. + * + * @return rules + */ + @javax.annotation.Nullable public List getRules() { + return rules; + } + + public CreateSecurityGroupPayload stateful(@javax.annotation.Nullable Boolean stateful) { + this.stateful = stateful; + return this; + } + + /** + * Shows if a security group is stateful or stateless. You can only have one type of security + * groups per network interface/server. + * + * @return stateful + */ + @javax.annotation.Nullable public Boolean getStateful() { + return stateful; + } + + public void setStateful(@javax.annotation.Nullable Boolean stateful) { + this.stateful = stateful; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSecurityGroupPayload createSecurityGroupPayload = (CreateSecurityGroupPayload) o; + return Objects.equals(this.createdAt, createSecurityGroupPayload.createdAt) + && Objects.equals(this.description, createSecurityGroupPayload.description) + && Objects.equals(this.id, createSecurityGroupPayload.id) + && Objects.equals(this.labels, createSecurityGroupPayload.labels) + && Objects.equals(this.name, createSecurityGroupPayload.name) + && Objects.equals(this.rules, createSecurityGroupPayload.rules) + && Objects.equals(this.stateful, createSecurityGroupPayload.stateful) + && Objects.equals(this.updatedAt, createSecurityGroupPayload.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, description, id, labels, name, rules, stateful, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSecurityGroupPayload {\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"); + 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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = + new HashSet( + Arrays.asList( + "createdAt", + "description", + "id", + "labels", + "name", + "rules", + "stateful", + "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 CreateSecurityGroupPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateSecurityGroupPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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( + "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( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if (jsonObj.get("rules") != null && !jsonObj.get("rules").isJsonNull()) { + JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); + if (jsonArrayrules != null) { + // ensure the json data is an array + if (!jsonObj.get("rules").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rules` to be an array in the JSON string but got `%s`", + jsonObj.get("rules").toString())); + } + + // validate the optional field `rules` (array) + for (int i = 0; i < jsonArrayrules.size(); i++) { + SecurityGroupRule.validateJsonElement(jsonArrayrules.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSecurityGroupPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSecurityGroupPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateSecurityGroupPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSecurityGroupPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSecurityGroupPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSecurityGroupPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSecurityGroupPayload + * @throws IOException if the JSON string is invalid with respect to CreateSecurityGroupPayload + */ + public static CreateSecurityGroupPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSecurityGroupPayload.class); + } + + /** + * Convert an instance of CreateSecurityGroupPayload 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/CreateSecurityGroupRulePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRulePayload.java new file mode 100644 index 0000000..7e93ef3 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRulePayload.java @@ -0,0 +1,517 @@ +/* + * 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; +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.14.0") +public class CreateSecurityGroupRulePayload { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + + public static final String SERIALIZED_NAME_DIRECTION = "direction"; + + @SerializedName(SERIALIZED_NAME_DIRECTION) + @javax.annotation.Nonnull + private String direction; + + public static final String SERIALIZED_NAME_ETHERTYPE = "ethertype"; + + @SerializedName(SERIALIZED_NAME_ETHERTYPE) + @javax.annotation.Nullable private String ethertype = "IPv4"; + + public static final String SERIALIZED_NAME_ICMP_PARAMETERS = "icmpParameters"; + + @SerializedName(SERIALIZED_NAME_ICMP_PARAMETERS) + @javax.annotation.Nullable private ICMPParameters icmpParameters; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IP_RANGE = "ipRange"; + + @SerializedName(SERIALIZED_NAME_IP_RANGE) + @javax.annotation.Nullable private String ipRange; + + public static final String SERIALIZED_NAME_PORT_RANGE = "portRange"; + + @SerializedName(SERIALIZED_NAME_PORT_RANGE) + @javax.annotation.Nullable private PortRange portRange; + + public static final String SERIALIZED_NAME_REMOTE_SECURITY_GROUP_ID = "remoteSecurityGroupId"; + + @SerializedName(SERIALIZED_NAME_REMOTE_SECURITY_GROUP_ID) + @javax.annotation.Nullable private UUID remoteSecurityGroupId; + + public static final String SERIALIZED_NAME_SECURITY_GROUP_ID = "securityGroupId"; + + @SerializedName(SERIALIZED_NAME_SECURITY_GROUP_ID) + @javax.annotation.Nullable private UUID securityGroupId; + + public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; + + @SerializedName(SERIALIZED_NAME_PROTOCOL) + @javax.annotation.Nullable private CreateProtocol protocol; + + public CreateSecurityGroupRulePayload() {} + + public CreateSecurityGroupRulePayload(UUID id, UUID securityGroupId) { + this(); + this.id = id; + this.securityGroupId = securityGroupId; + } + + public CreateSecurityGroupRulePayload 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 CreateSecurityGroupRulePayload direction(@javax.annotation.Nonnull String direction) { + this.direction = direction; + return this; + } + + /** + * The direction of the traffic which the rule should match. Possible values: + * `ingress`, `egress`. + * + * @return direction + */ + @javax.annotation.Nonnull + public String getDirection() { + return direction; + } + + public void setDirection(@javax.annotation.Nonnull String direction) { + this.direction = direction; + } + + public CreateSecurityGroupRulePayload ethertype(@javax.annotation.Nullable String ethertype) { + this.ethertype = ethertype; + return this; + } + + /** + * The ethertype which the rule should match. Possible values: `IPv4`, + * `IPv6`. + * + * @return ethertype + */ + @javax.annotation.Nullable public String getEthertype() { + return ethertype; + } + + public void setEthertype(@javax.annotation.Nullable String ethertype) { + this.ethertype = ethertype; + } + + public CreateSecurityGroupRulePayload icmpParameters( + @javax.annotation.Nullable ICMPParameters icmpParameters) { + this.icmpParameters = icmpParameters; + return this; + } + + /** + * Get icmpParameters + * + * @return icmpParameters + */ + @javax.annotation.Nullable public ICMPParameters getIcmpParameters() { + return icmpParameters; + } + + public void setIcmpParameters(@javax.annotation.Nullable ICMPParameters icmpParameters) { + this.icmpParameters = icmpParameters; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public CreateSecurityGroupRulePayload ipRange(@javax.annotation.Nullable String ipRange) { + this.ipRange = ipRange; + return this; + } + + /** + * The remote IP range which the rule should match. + * + * @return ipRange + */ + @javax.annotation.Nullable public String getIpRange() { + return ipRange; + } + + public void setIpRange(@javax.annotation.Nullable String ipRange) { + this.ipRange = ipRange; + } + + public CreateSecurityGroupRulePayload portRange( + @javax.annotation.Nullable PortRange portRange) { + this.portRange = portRange; + return this; + } + + /** + * Get portRange + * + * @return portRange + */ + @javax.annotation.Nullable public PortRange getPortRange() { + return portRange; + } + + public void setPortRange(@javax.annotation.Nullable PortRange portRange) { + this.portRange = portRange; + } + + public CreateSecurityGroupRulePayload remoteSecurityGroupId( + @javax.annotation.Nullable UUID remoteSecurityGroupId) { + this.remoteSecurityGroupId = remoteSecurityGroupId; + return this; + } + + /** + * The remote security group which the rule should match. + * + * @return remoteSecurityGroupId + */ + @javax.annotation.Nullable public UUID getRemoteSecurityGroupId() { + return remoteSecurityGroupId; + } + + public void setRemoteSecurityGroupId(@javax.annotation.Nullable UUID remoteSecurityGroupId) { + this.remoteSecurityGroupId = remoteSecurityGroupId; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return securityGroupId + */ + @javax.annotation.Nullable public UUID getSecurityGroupId() { + return securityGroupId; + } + + public CreateSecurityGroupRulePayload protocol( + @javax.annotation.Nullable CreateProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * + * @return protocol + */ + @javax.annotation.Nullable public CreateProtocol getProtocol() { + return protocol; + } + + public void setProtocol(@javax.annotation.Nullable CreateProtocol protocol) { + this.protocol = protocol; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSecurityGroupRulePayload createSecurityGroupRulePayload = + (CreateSecurityGroupRulePayload) o; + return Objects.equals(this.description, createSecurityGroupRulePayload.description) + && Objects.equals(this.direction, createSecurityGroupRulePayload.direction) + && Objects.equals(this.ethertype, createSecurityGroupRulePayload.ethertype) + && Objects.equals( + this.icmpParameters, createSecurityGroupRulePayload.icmpParameters) + && Objects.equals(this.id, createSecurityGroupRulePayload.id) + && Objects.equals(this.ipRange, createSecurityGroupRulePayload.ipRange) + && Objects.equals(this.portRange, createSecurityGroupRulePayload.portRange) + && Objects.equals( + this.remoteSecurityGroupId, + createSecurityGroupRulePayload.remoteSecurityGroupId) + && Objects.equals( + this.securityGroupId, createSecurityGroupRulePayload.securityGroupId) + && Objects.equals(this.protocol, createSecurityGroupRulePayload.protocol); + } + + @Override + public int hashCode() { + return Objects.hash( + description, + direction, + ethertype, + icmpParameters, + id, + ipRange, + portRange, + remoteSecurityGroupId, + securityGroupId, + protocol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSecurityGroupRulePayload {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); + sb.append(" ethertype: ").append(toIndentedString(ethertype)).append("\n"); + sb.append(" icmpParameters: ").append(toIndentedString(icmpParameters)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ipRange: ").append(toIndentedString(ipRange)).append("\n"); + sb.append(" portRange: ").append(toIndentedString(portRange)).append("\n"); + sb.append(" remoteSecurityGroupId: ") + .append(toIndentedString(remoteSecurityGroupId)) + .append("\n"); + sb.append(" securityGroupId: ").append(toIndentedString(securityGroupId)).append("\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).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", + "direction", + "ethertype", + "icmpParameters", + "id", + "ipRange", + "portRange", + "remoteSecurityGroupId", + "securityGroupId", + "protocol")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("direction")); + } + + /** + * 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 + * CreateSecurityGroupRulePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateSecurityGroupRulePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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( + "Expected the field `direction` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("direction").toString())); + } + if ((jsonObj.get("ethertype") != null && !jsonObj.get("ethertype").isJsonNull()) + && !jsonObj.get("ethertype").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ethertype` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ethertype").toString())); + } + // validate the optional field `icmpParameters` + if (jsonObj.get("icmpParameters") != null && !jsonObj.get("icmpParameters").isJsonNull()) { + ICMPParameters.validateJsonElement(jsonObj.get("icmpParameters")); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("ipRange") != null && !jsonObj.get("ipRange").isJsonNull()) + && !jsonObj.get("ipRange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ipRange` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ipRange").toString())); + } + // validate the optional field `portRange` + if (jsonObj.get("portRange") != null && !jsonObj.get("portRange").isJsonNull()) { + PortRange.validateJsonElement(jsonObj.get("portRange")); + } + if ((jsonObj.get("remoteSecurityGroupId") != null + && !jsonObj.get("remoteSecurityGroupId").isJsonNull()) + && !jsonObj.get("remoteSecurityGroupId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `remoteSecurityGroupId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("remoteSecurityGroupId").toString())); + } + if ((jsonObj.get("securityGroupId") != null && !jsonObj.get("securityGroupId").isJsonNull()) + && !jsonObj.get("securityGroupId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `securityGroupId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("securityGroupId").toString())); + } + // validate the optional field `protocol` + if (jsonObj.get("protocol") != null && !jsonObj.get("protocol").isJsonNull()) { + CreateProtocol.validateJsonElement(jsonObj.get("protocol")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSecurityGroupRulePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSecurityGroupRulePayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateSecurityGroupRulePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSecurityGroupRulePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSecurityGroupRulePayload read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSecurityGroupRulePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSecurityGroupRulePayload + * @throws IOException if the JSON string is invalid with respect to + * CreateSecurityGroupRulePayload + */ + public static CreateSecurityGroupRulePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSecurityGroupRulePayload.class); + } + + /** + * Convert an instance of CreateSecurityGroupRulePayload 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/CreateSecurityGroupRuleProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRuleProtocol.java new file mode 100644 index 0000000..56bed82 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSecurityGroupRuleProtocol.java @@ -0,0 +1,200 @@ +/* + * 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 internet protocol which the rule should match. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateSecurityGroupRuleProtocol { + public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; + + @SerializedName(SERIALIZED_NAME_PROTOCOL) + @javax.annotation.Nullable private CreateProtocol protocol; + + public CreateSecurityGroupRuleProtocol() {} + + public CreateSecurityGroupRuleProtocol protocol( + @javax.annotation.Nullable CreateProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * + * @return protocol + */ + @javax.annotation.Nullable public CreateProtocol getProtocol() { + return protocol; + } + + public void setProtocol(@javax.annotation.Nullable CreateProtocol protocol) { + this.protocol = protocol; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSecurityGroupRuleProtocol createSecurityGroupRuleProtocol = + (CreateSecurityGroupRuleProtocol) o; + return Objects.equals(this.protocol, createSecurityGroupRuleProtocol.protocol); + } + + @Override + public int hashCode() { + return Objects.hash(protocol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSecurityGroupRuleProtocol {\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).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("protocol")); + + // 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 + * CreateSecurityGroupRuleProtocol + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateSecurityGroupRuleProtocol.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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()) { + CreateProtocol.validateJsonElement(jsonObj.get("protocol")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSecurityGroupRuleProtocol.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSecurityGroupRuleProtocol' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateSecurityGroupRuleProtocol.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSecurityGroupRuleProtocol value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSecurityGroupRuleProtocol read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSecurityGroupRuleProtocol given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSecurityGroupRuleProtocol + * @throws IOException if the JSON string is invalid with respect to + * CreateSecurityGroupRuleProtocol + */ + public static CreateSecurityGroupRuleProtocol fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSecurityGroupRuleProtocol.class); + } + + /** + * Convert an instance of CreateSecurityGroupRuleProtocol 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/CreateServerNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworking.java new file mode 100644 index 0000000..22c3712 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworking.java @@ -0,0 +1,197 @@ +/* + * 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; +import java.util.UUID; + +/** The initial networking setup for the server creation with a network. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateServerNetworking { + public static final String SERIALIZED_NAME_NETWORK_ID = "networkId"; + + @SerializedName(SERIALIZED_NAME_NETWORK_ID) + @javax.annotation.Nullable private UUID networkId; + + public CreateServerNetworking() {} + + public CreateServerNetworking networkId(@javax.annotation.Nullable UUID networkId) { + this.networkId = networkId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return networkId + */ + @javax.annotation.Nullable public UUID getNetworkId() { + return networkId; + } + + public void setNetworkId(@javax.annotation.Nullable UUID networkId) { + this.networkId = networkId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateServerNetworking createServerNetworking = (CreateServerNetworking) o; + return Objects.equals(this.networkId, createServerNetworking.networkId); + } + + @Override + public int hashCode() { + return Objects.hash(networkId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateServerNetworking {\n"); + sb.append(" networkId: ").append(toIndentedString(networkId)).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("networkId")); + + // 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 CreateServerNetworking + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateServerNetworking.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateServerNetworking is not found in the empty JSON string", + CreateServerNetworking.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateServerNetworking.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `CreateServerNetworking` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("networkId") != null && !jsonObj.get("networkId").isJsonNull()) + && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateServerNetworking.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateServerNetworking' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateServerNetworking.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateServerNetworking value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateServerNetworking read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateServerNetworking given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateServerNetworking + * @throws IOException if the JSON string is invalid with respect to CreateServerNetworking + */ + public static CreateServerNetworking fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateServerNetworking.class); + } + + /** + * Convert an instance of CreateServerNetworking 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/CreateServerNetworkingWithNics.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworkingWithNics.java new file mode 100644 index 0000000..d55f6b2 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerNetworkingWithNics.java @@ -0,0 +1,215 @@ +/* + * 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 java.util.UUID; + +/** 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.14.0") +public class CreateServerNetworkingWithNics { + public static final String SERIALIZED_NAME_NIC_IDS = "nicIds"; + + @SerializedName(SERIALIZED_NAME_NIC_IDS) + @javax.annotation.Nullable private List nicIds = new ArrayList<>(); + + public CreateServerNetworkingWithNics() {} + + public CreateServerNetworkingWithNics nicIds(@javax.annotation.Nullable List nicIds) { + this.nicIds = nicIds; + return this; + } + + public CreateServerNetworkingWithNics addNicIdsItem(UUID nicIdsItem) { + if (this.nicIds == null) { + this.nicIds = new ArrayList<>(); + } + this.nicIds.add(nicIdsItem); + return this; + } + + /** + * A list of UUIDs. + * + * @return nicIds + */ + @javax.annotation.Nullable public List getNicIds() { + return nicIds; + } + + public void setNicIds(@javax.annotation.Nullable List nicIds) { + this.nicIds = nicIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateServerNetworkingWithNics createServerNetworkingWithNics = + (CreateServerNetworkingWithNics) o; + return Objects.equals(this.nicIds, createServerNetworkingWithNics.nicIds); + } + + @Override + public int hashCode() { + return Objects.hash(nicIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateServerNetworkingWithNics {\n"); + sb.append(" nicIds: ").append(toIndentedString(nicIds)).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("nicIds")); + + // 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 + * CreateServerNetworkingWithNics + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateServerNetworkingWithNics.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateServerNetworkingWithNics is not found in the empty JSON string", + CreateServerNetworkingWithNics.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateServerNetworkingWithNics.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `CreateServerNetworkingWithNics` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("nicIds") != null + && !jsonObj.get("nicIds").isJsonNull() + && !jsonObj.get("nicIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `nicIds` to be an array in the JSON string but got `%s`", + jsonObj.get("nicIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateServerNetworkingWithNics.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateServerNetworkingWithNics' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateServerNetworkingWithNics.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateServerNetworkingWithNics value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateServerNetworkingWithNics read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateServerNetworkingWithNics given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateServerNetworkingWithNics + * @throws IOException if the JSON string is invalid with respect to + * CreateServerNetworkingWithNics + */ + public static CreateServerNetworkingWithNics fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateServerNetworkingWithNics.class); + } + + /** + * Convert an instance of CreateServerNetworkingWithNics 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/CreateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayload.java new file mode 100644 index 0000000..c19ec89 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayload.java @@ -0,0 +1,924 @@ +/* + * 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.time.OffsetDateTime; +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 java.util.UUID; + +/** Representation of a single server object. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateServerPayload { + public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; + + @SerializedName(SERIALIZED_NAME_AFFINITY_GROUP) + @javax.annotation.Nullable private UUID affinityGroup; + + public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; + + @SerializedName(SERIALIZED_NAME_AVAILABILITY_ZONE) + @javax.annotation.Nullable private String availabilityZone; + + public static final String SERIALIZED_NAME_BOOT_VOLUME = "bootVolume"; + + @SerializedName(SERIALIZED_NAME_BOOT_VOLUME) + @javax.annotation.Nullable private BootVolume bootVolume; + + 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_ERROR_MESSAGE = "errorMessage"; + + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + @javax.annotation.Nullable private String errorMessage; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IMAGE_ID = "imageId"; + + @SerializedName(SERIALIZED_NAME_IMAGE_ID) + @javax.annotation.Nullable private UUID imageId; + + public static final String SERIALIZED_NAME_KEYPAIR_NAME = "keypairName"; + + @SerializedName(SERIALIZED_NAME_KEYPAIR_NAME) + @javax.annotation.Nullable private String keypairName; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_LAUNCHED_AT = "launchedAt"; + + @SerializedName(SERIALIZED_NAME_LAUNCHED_AT) + @javax.annotation.Nullable private OffsetDateTime launchedAt; + + public static final String SERIALIZED_NAME_MACHINE_TYPE = "machineType"; + + @SerializedName(SERIALIZED_NAME_MACHINE_TYPE) + @javax.annotation.Nonnull + private String machineType; + + public static final String SERIALIZED_NAME_MAINTENANCE_WINDOW = "maintenanceWindow"; + + @SerializedName(SERIALIZED_NAME_MAINTENANCE_WINDOW) + @javax.annotation.Nullable private ServerMaintenance maintenanceWindow; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable private Object metadata; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_NETWORKING = "networking"; + + @SerializedName(SERIALIZED_NAME_NETWORKING) + @javax.annotation.Nullable private CreateServerPayloadNetworking networking; + + public static final String SERIALIZED_NAME_NICS = "nics"; + + @SerializedName(SERIALIZED_NAME_NICS) + @javax.annotation.Nullable private List nics; + + public static final String SERIALIZED_NAME_POWER_STATUS = "powerStatus"; + + @SerializedName(SERIALIZED_NAME_POWER_STATUS) + @javax.annotation.Nullable private String powerStatus; + + public static final String SERIALIZED_NAME_SECURITY_GROUPS = "securityGroups"; + + @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) + @javax.annotation.Nullable private List securityGroups; + + public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_MAILS = "serviceAccountMails"; + + @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_MAILS) + @javax.annotation.Nullable private List serviceAccountMails; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_USER_DATA = "userData"; + + @SerializedName(SERIALIZED_NAME_USER_DATA) + @javax.annotation.Nullable private byte[] userData; + + public static final String SERIALIZED_NAME_VOLUMES = "volumes"; + + @SerializedName(SERIALIZED_NAME_VOLUMES) + @javax.annotation.Nullable private List volumes; + + public CreateServerPayload() {} + + public CreateServerPayload( + OffsetDateTime createdAt, + String errorMessage, + UUID id, + OffsetDateTime launchedAt, + ServerMaintenance maintenanceWindow, + List nics, + String powerStatus, + String status, + OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.errorMessage = errorMessage; + this.id = id; + this.launchedAt = launchedAt; + this.maintenanceWindow = maintenanceWindow; + this.nics = nics; + this.powerStatus = powerStatus; + this.status = status; + this.updatedAt = updatedAt; + } + + public CreateServerPayload affinityGroup(@javax.annotation.Nullable UUID affinityGroup) { + this.affinityGroup = affinityGroup; + return this; + } + + /** + * The affinity group the server is assigned to. + * + * @return affinityGroup + */ + @javax.annotation.Nullable public UUID getAffinityGroup() { + return affinityGroup; + } + + public void setAffinityGroup(@javax.annotation.Nullable UUID affinityGroup) { + this.affinityGroup = affinityGroup; + } + + public CreateServerPayload availabilityZone( + @javax.annotation.Nullable String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * This is the availability zone requested during server creation. If none is provided during + * the creation request and an existing volume will be used as boot volume it will be set to the + * same availability zone as the volume. For requests with no volumes involved it will be set to + * the metro availability zone. + * + * @return availabilityZone + */ + @javax.annotation.Nullable public String getAvailabilityZone() { + return availabilityZone; + } + + public void setAvailabilityZone(@javax.annotation.Nullable String availabilityZone) { + this.availabilityZone = availabilityZone; + } + + public CreateServerPayload bootVolume(@javax.annotation.Nullable BootVolume bootVolume) { + this.bootVolume = bootVolume; + return this; + } + + /** + * Get bootVolume + * + * @return bootVolume + */ + @javax.annotation.Nullable public BootVolume getBootVolume() { + return bootVolume; + } + + public void setBootVolume(@javax.annotation.Nullable BootVolume bootVolume) { + this.bootVolume = bootVolume; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * An error message. + * + * @return errorMessage + */ + @javax.annotation.Nullable public String getErrorMessage() { + return errorMessage; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public CreateServerPayload imageId(@javax.annotation.Nullable UUID imageId) { + this.imageId = imageId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return imageId + */ + @javax.annotation.Nullable public UUID getImageId() { + return imageId; + } + + public void setImageId(@javax.annotation.Nullable UUID imageId) { + this.imageId = imageId; + } + + public CreateServerPayload keypairName(@javax.annotation.Nullable String keypairName) { + this.keypairName = keypairName; + return this; + } + + /** + * The SSH keypair used during the server creation. + * + * @return keypairName + */ + @javax.annotation.Nullable public String getKeypairName() { + return keypairName; + } + + public void setKeypairName(@javax.annotation.Nullable String keypairName) { + this.keypairName = keypairName; + } + + public CreateServerPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + /** + * Date-time when resource was launched. + * + * @return launchedAt + */ + @javax.annotation.Nullable public OffsetDateTime getLaunchedAt() { + return launchedAt; + } + + public CreateServerPayload machineType(@javax.annotation.Nonnull String machineType) { + this.machineType = machineType; + return this; + } + + /** + * Name of the machine type the server shall belong to. + * + * @return machineType + */ + @javax.annotation.Nonnull + public String getMachineType() { + return machineType; + } + + public void setMachineType(@javax.annotation.Nonnull String machineType) { + this.machineType = machineType; + } + + /** + * Get maintenanceWindow + * + * @return maintenanceWindow + */ + @javax.annotation.Nullable public ServerMaintenance getMaintenanceWindow() { + return maintenanceWindow; + } + + public CreateServerPayload metadata(@javax.annotation.Nullable Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. + * ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value + * for a key will remove that key. + * + * @return metadata + */ + @javax.annotation.Nullable public Object getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Object metadata) { + this.metadata = metadata; + } + + public CreateServerPayload name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name for a Server. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + public CreateServerPayload networking( + @javax.annotation.Nullable CreateServerPayloadNetworking networking) { + this.networking = networking; + return this; + } + + /** + * Get networking + * + * @return networking + */ + @javax.annotation.Nullable public CreateServerPayloadNetworking getNetworking() { + return networking; + } + + public void setNetworking(@javax.annotation.Nullable CreateServerPayloadNetworking networking) { + this.networking = networking; + } + + /** + * The list of network interfaces (NICs) attached to the server. Only shown when detailed + * information is requested. + * + * @return nics + */ + @javax.annotation.Nullable public List getNics() { + return nics; + } + + /** + * The power status of a server. Possible values: `CRASHED`, `ERROR`, + * `RUNNING`, `STOPPED`. + * + * @return powerStatus + */ + @javax.annotation.Nullable public String getPowerStatus() { + return powerStatus; + } + + public CreateServerPayload securityGroups( + @javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + public CreateServerPayload addSecurityGroupsItem(String securityGroupsItem) { + if (this.securityGroups == null) { + this.securityGroups = new ArrayList<>(); + } + this.securityGroups.add(securityGroupsItem); + return this; + } + + /** + * The initial security groups for the server creation. + * + * @return securityGroups + */ + @javax.annotation.Nullable public List getSecurityGroups() { + return securityGroups; + } + + public void setSecurityGroups(@javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + } + + public CreateServerPayload serviceAccountMails( + @javax.annotation.Nullable List serviceAccountMails) { + this.serviceAccountMails = serviceAccountMails; + return this; + } + + public CreateServerPayload addServiceAccountMailsItem(String serviceAccountMailsItem) { + if (this.serviceAccountMails == null) { + this.serviceAccountMails = new ArrayList<>(); + } + this.serviceAccountMails.add(serviceAccountMailsItem); + return this; + } + + /** + * A list of service account mails. Only shown when detailed information is requested. + * + * @return serviceAccountMails + */ + @javax.annotation.Nullable public List getServiceAccountMails() { + return serviceAccountMails; + } + + public void setServiceAccountMails( + @javax.annotation.Nullable List serviceAccountMails) { + this.serviceAccountMails = serviceAccountMails; + } + + /** + * The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, + * `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, + * `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, + * `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, + * `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, + * `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, + * `UNRESCUING`, `UPDATING`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public CreateServerPayload userData(@javax.annotation.Nullable byte[] userData) { + this.userData = userData; + return this; + } + + /** + * User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init + * to the server. Only shown when detailed information is requested. + * + * @return userData + */ + @javax.annotation.Nullable public byte[] getUserData() { + return userData; + } + + public void setUserData(@javax.annotation.Nullable byte[] userData) { + this.userData = userData; + } + + public CreateServerPayload volumes(@javax.annotation.Nullable List volumes) { + this.volumes = volumes; + return this; + } + + public CreateServerPayload addVolumesItem(UUID volumesItem) { + if (this.volumes == null) { + this.volumes = new ArrayList<>(); + } + this.volumes.add(volumesItem); + return this; + } + + /** + * The list of volumes attached to the server. + * + * @return volumes + */ + @javax.annotation.Nullable public List getVolumes() { + return volumes; + } + + public void setVolumes(@javax.annotation.Nullable List volumes) { + this.volumes = volumes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateServerPayload createServerPayload = (CreateServerPayload) o; + return Objects.equals(this.affinityGroup, createServerPayload.affinityGroup) + && Objects.equals(this.availabilityZone, createServerPayload.availabilityZone) + && Objects.equals(this.bootVolume, createServerPayload.bootVolume) + && Objects.equals(this.createdAt, createServerPayload.createdAt) + && Objects.equals(this.errorMessage, createServerPayload.errorMessage) + && Objects.equals(this.id, createServerPayload.id) + && Objects.equals(this.imageId, createServerPayload.imageId) + && Objects.equals(this.keypairName, createServerPayload.keypairName) + && Objects.equals(this.labels, createServerPayload.labels) + && Objects.equals(this.launchedAt, createServerPayload.launchedAt) + && Objects.equals(this.machineType, createServerPayload.machineType) + && Objects.equals(this.maintenanceWindow, createServerPayload.maintenanceWindow) + && Objects.equals(this.metadata, createServerPayload.metadata) + && Objects.equals(this.name, createServerPayload.name) + && Objects.equals(this.networking, createServerPayload.networking) + && Objects.equals(this.nics, createServerPayload.nics) + && Objects.equals(this.powerStatus, createServerPayload.powerStatus) + && Objects.equals(this.securityGroups, createServerPayload.securityGroups) + && Objects.equals(this.serviceAccountMails, createServerPayload.serviceAccountMails) + && Objects.equals(this.status, createServerPayload.status) + && Objects.equals(this.updatedAt, createServerPayload.updatedAt) + && Arrays.equals(this.userData, createServerPayload.userData) + && Objects.equals(this.volumes, createServerPayload.volumes); + } + + @Override + public int hashCode() { + return Objects.hash( + affinityGroup, + availabilityZone, + bootVolume, + createdAt, + errorMessage, + id, + imageId, + keypairName, + labels, + launchedAt, + machineType, + maintenanceWindow, + metadata, + name, + networking, + nics, + powerStatus, + securityGroups, + serviceAccountMails, + status, + updatedAt, + Arrays.hashCode(userData), + volumes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateServerPayload {\n"); + sb.append(" affinityGroup: ").append(toIndentedString(affinityGroup)).append("\n"); + sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); + sb.append(" bootVolume: ").append(toIndentedString(bootVolume)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" imageId: ").append(toIndentedString(imageId)).append("\n"); + sb.append(" keypairName: ").append(toIndentedString(keypairName)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" launchedAt: ").append(toIndentedString(launchedAt)).append("\n"); + sb.append(" machineType: ").append(toIndentedString(machineType)).append("\n"); + sb.append(" maintenanceWindow: ") + .append(toIndentedString(maintenanceWindow)) + .append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" networking: ").append(toIndentedString(networking)).append("\n"); + sb.append(" nics: ").append(toIndentedString(nics)).append("\n"); + sb.append(" powerStatus: ").append(toIndentedString(powerStatus)).append("\n"); + sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); + sb.append(" serviceAccountMails: ") + .append(toIndentedString(serviceAccountMails)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + 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("}"); + 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( + "affinityGroup", + "availabilityZone", + "bootVolume", + "createdAt", + "errorMessage", + "id", + "imageId", + "keypairName", + "labels", + "launchedAt", + "machineType", + "maintenanceWindow", + "metadata", + "name", + "networking", + "nics", + "powerStatus", + "securityGroups", + "serviceAccountMails", + "status", + "updatedAt", + "userData", + "volumes")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("machineType", "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 CreateServerPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateServerPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("affinityGroup") != null && !jsonObj.get("affinityGroup").isJsonNull()) + && !jsonObj.get("affinityGroup").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `affinityGroup` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("affinityGroup").toString())); + } + if ((jsonObj.get("availabilityZone") != null + && !jsonObj.get("availabilityZone").isJsonNull()) + && !jsonObj.get("availabilityZone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `availabilityZone` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("availabilityZone").toString())); + } + // validate the optional field `bootVolume` + if (jsonObj.get("bootVolume") != null && !jsonObj.get("bootVolume").isJsonNull()) { + BootVolume.validateJsonElement(jsonObj.get("bootVolume")); + } + if ((jsonObj.get("errorMessage") != null && !jsonObj.get("errorMessage").isJsonNull()) + && !jsonObj.get("errorMessage").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errorMessage` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("errorMessage").toString())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("imageId") != null && !jsonObj.get("imageId").isJsonNull()) + && !jsonObj.get("imageId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `imageId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("imageId").toString())); + } + if ((jsonObj.get("keypairName") != null && !jsonObj.get("keypairName").isJsonNull()) + && !jsonObj.get("keypairName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `machineType` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("machineType").toString())); + } + // validate the optional field `maintenanceWindow` + if (jsonObj.get("maintenanceWindow") != null + && !jsonObj.get("maintenanceWindow").isJsonNull()) { + ServerMaintenance.validateJsonElement(jsonObj.get("maintenanceWindow")); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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")); + } + if (jsonObj.get("nics") != null && !jsonObj.get("nics").isJsonNull()) { + JsonArray jsonArraynics = jsonObj.getAsJsonArray("nics"); + if (jsonArraynics != null) { + // ensure the json data is an array + if (!jsonObj.get("nics").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `nics` to be an array in the JSON string but got `%s`", + jsonObj.get("nics").toString())); + } + + // validate the optional field `nics` (array) + for (int i = 0; i < jsonArraynics.size(); i++) { + ServerNetwork.validateJsonElement(jsonArraynics.get(i)); + } + ; + } + } + if ((jsonObj.get("powerStatus") != null && !jsonObj.get("powerStatus").isJsonNull()) + && !jsonObj.get("powerStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `powerStatus` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("powerStatus").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("securityGroups") != null + && !jsonObj.get("securityGroups").isJsonNull() + && !jsonObj.get("securityGroups").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", + jsonObj.get("securityGroups").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("serviceAccountMails") != null + && !jsonObj.get("serviceAccountMails").isJsonNull() + && !jsonObj.get("serviceAccountMails").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `serviceAccountMails` to be an array in the JSON string but got `%s`", + jsonObj.get("serviceAccountMails").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("status").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("volumes") != null + && !jsonObj.get("volumes").isJsonNull() + && !jsonObj.get("volumes").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `volumes` to be an array in the JSON string but got `%s`", + jsonObj.get("volumes").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateServerPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateServerPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateServerPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateServerPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateServerPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateServerPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateServerPayload + * @throws IOException if the JSON string is invalid with respect to CreateServerPayload + */ + public static CreateServerPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateServerPayload.class); + } + + /** + * Convert an instance of CreateServerPayload 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/CreateServerPayloadNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayloadNetworking.java new file mode 100644 index 0000000..48f1bc1 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateServerPayloadNetworking.java @@ -0,0 +1,293 @@ +/* + * 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.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.14.0") +public class CreateServerPayloadNetworking extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(CreateServerPayloadNetworking.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 + } + 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, CreateServerPayloadNetworking 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 CreateServerPayloadNetworking 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( + "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( + "Deserialization for CreateServerNetworkingWithNics failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'CreateServerNetworkingWithNics'", + e); + } + + if (match == 1) { + CreateServerPayloadNetworking ret = + new CreateServerPayloadNetworking(); + 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())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public CreateServerPayloadNetworking() { + super("oneOf", Boolean.FALSE); + } + + public CreateServerPayloadNetworking(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("CreateServerNetworking", CreateServerNetworking.class); + schemas.put("CreateServerNetworkingWithNics", CreateServerNetworkingWithNics.class); + } + + @Override + public Map> getSchemas() { + return CreateServerPayloadNetworking.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 + * CreateServerPayloadNetworking + */ + 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( + "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( + "Deserialization for CreateServerNetworkingWithNics failed with `%s`.", + e.getMessage())); + // continue to the next one + } + 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())); + } + } + + /** + * Create an instance of CreateServerPayloadNetworking 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 + */ + public static CreateServerPayloadNetworking fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateServerPayloadNetworking.class); + } + + /** + * Convert an instance of CreateServerPayloadNetworking 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 new file mode 100644 index 0000000..638a736 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateSnapshotPayload.java @@ -0,0 +1,385 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.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_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.Nullable private String name; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable private Long size; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_VOLUME_ID = "volumeId"; + + @SerializedName(SERIALIZED_NAME_VOLUME_ID) + @javax.annotation.Nonnull + private UUID volumeId; + + public CreateSnapshotPayload() {} + + public CreateSnapshotPayload( + OffsetDateTime createdAt, UUID id, Long size, String status, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.id = id; + this.size = size; + this.status = status; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public CreateSnapshotPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public CreateSnapshotPayload 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; + } + + /** + * Size in Gigabyte. + * + * @return size + */ + @javax.annotation.Nullable public Long getSize() { + return size; + } + + /** + * The status of a snapshot object. Possible values: `AVAILABLE`, + * `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, + * `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public CreateSnapshotPayload volumeId(@javax.annotation.Nonnull UUID volumeId) { + this.volumeId = volumeId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return volumeId + */ + @javax.annotation.Nonnull + public UUID getVolumeId() { + return volumeId; + } + + public void setVolumeId(@javax.annotation.Nonnull UUID volumeId) { + this.volumeId = volumeId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSnapshotPayload createSnapshotPayload = (CreateSnapshotPayload) o; + return Objects.equals(this.createdAt, createSnapshotPayload.createdAt) + && 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); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, id, labels, name, size, status, updatedAt, volumeId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSnapshotPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).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(" size: ").append(toIndentedString(size)).append("\n"); + 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("}"); + 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", + "id", + "labels", + "name", + "size", + "status", + "updatedAt", + "volumeId")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("volumeId")); + } + + /** + * 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 CreateSnapshotPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateSnapshotPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("volumeId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSnapshotPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSnapshotPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateSnapshotPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSnapshotPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSnapshotPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSnapshotPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSnapshotPayload + * @throws IOException if the JSON string is invalid with respect to CreateSnapshotPayload + */ + public static CreateSnapshotPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSnapshotPayload.class); + } + + /** + * Convert an instance of CreateSnapshotPayload 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/CreateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateVolumePayload.java new file mode 100644 index 0000000..eabd2aa --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/CreateVolumePayload.java @@ -0,0 +1,646 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; + +/** + * Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class CreateVolumePayload { + public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; + + @SerializedName(SERIALIZED_NAME_AVAILABILITY_ZONE) + @javax.annotation.Nonnull + private String availabilityZone; + + public static final String SERIALIZED_NAME_BOOTABLE = "bootable"; + + @SerializedName(SERIALIZED_NAME_BOOTABLE) + @javax.annotation.Nullable private Boolean bootable; + + 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_ENCRYPTED = "encrypted"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED) + @javax.annotation.Nullable private Boolean encrypted; + + public static final String SERIALIZED_NAME_ENCRYPTION_PARAMETERS = "encryptionParameters"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTION_PARAMETERS) + @javax.annotation.Nullable private VolumeEncryptionParameter encryptionParameters; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IMAGE_CONFIG = "imageConfig"; + + @SerializedName(SERIALIZED_NAME_IMAGE_CONFIG) + @javax.annotation.Nullable private ImageConfig imageConfig; + + 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_PERFORMANCE_CLASS = "performanceClass"; + + @SerializedName(SERIALIZED_NAME_PERFORMANCE_CLASS) + @javax.annotation.Nullable private String performanceClass; + + public static final String SERIALIZED_NAME_SERVER_ID = "serverId"; + + @SerializedName(SERIALIZED_NAME_SERVER_ID) + @javax.annotation.Nullable private UUID serverId; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable private Long size; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable private VolumeSource source; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public CreateVolumePayload() {} + + public CreateVolumePayload( + OffsetDateTime createdAt, + Boolean encrypted, + UUID id, + ImageConfig imageConfig, + UUID serverId, + String status, + OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.encrypted = encrypted; + this.id = id; + this.imageConfig = imageConfig; + this.serverId = serverId; + this.status = status; + this.updatedAt = updatedAt; + } + + public CreateVolumePayload availabilityZone(@javax.annotation.Nonnull String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Object that represents an availability zone. + * + * @return availabilityZone + */ + @javax.annotation.Nonnull + public String getAvailabilityZone() { + return availabilityZone; + } + + public void setAvailabilityZone(@javax.annotation.Nonnull String availabilityZone) { + this.availabilityZone = availabilityZone; + } + + public CreateVolumePayload bootable(@javax.annotation.Nullable Boolean bootable) { + this.bootable = bootable; + return this; + } + + /** + * Indicates if a volume is bootable. + * + * @return bootable + */ + @javax.annotation.Nullable public Boolean getBootable() { + return bootable; + } + + public void setBootable(@javax.annotation.Nullable Boolean bootable) { + this.bootable = bootable; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public CreateVolumePayload 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; + } + + public CreateVolumePayload encryptionParameters( + @javax.annotation.Nullable VolumeEncryptionParameter encryptionParameters) { + this.encryptionParameters = encryptionParameters; + return this; + } + + /** + * Get encryptionParameters + * + * @return encryptionParameters + */ + @javax.annotation.Nullable public VolumeEncryptionParameter getEncryptionParameters() { + return encryptionParameters; + } + + public void setEncryptionParameters( + @javax.annotation.Nullable VolumeEncryptionParameter encryptionParameters) { + this.encryptionParameters = encryptionParameters; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + /** + * Get imageConfig + * + * @return imageConfig + */ + @javax.annotation.Nullable public ImageConfig getImageConfig() { + return imageConfig; + } + + public CreateVolumePayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public CreateVolumePayload 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 CreateVolumePayload performanceClass( + @javax.annotation.Nullable String performanceClass) { + this.performanceClass = performanceClass; + return this; + } + + /** + * The name for a General Object. Matches Names and also UUIDs. + * + * @return performanceClass + */ + @javax.annotation.Nullable public String getPerformanceClass() { + return performanceClass; + } + + public void setPerformanceClass(@javax.annotation.Nullable String performanceClass) { + this.performanceClass = performanceClass; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return serverId + */ + @javax.annotation.Nullable public UUID getServerId() { + return serverId; + } + + public CreateVolumePayload size(@javax.annotation.Nullable Long size) { + this.size = size; + return this; + } + + /** + * Size in Gigabyte. + * + * @return size + */ + @javax.annotation.Nullable public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nullable Long size) { + this.size = size; + } + + public CreateVolumePayload source(@javax.annotation.Nullable VolumeSource source) { + this.source = source; + return this; + } + + /** + * Get source + * + * @return source + */ + @javax.annotation.Nullable public VolumeSource getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable VolumeSource source) { + this.source = source; + } + + /** + * The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, + * `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, + * `CREATING`, `DELETED`, `DELETING`, `DETACHING`, + * `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, + * `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, + * `MAINTENANCE`, `RESERVED`, `RESIZING`, + * `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateVolumePayload createVolumePayload = (CreateVolumePayload) o; + return Objects.equals(this.availabilityZone, createVolumePayload.availabilityZone) + && Objects.equals(this.bootable, createVolumePayload.bootable) + && Objects.equals(this.createdAt, createVolumePayload.createdAt) + && Objects.equals(this.description, createVolumePayload.description) + && Objects.equals(this.encrypted, createVolumePayload.encrypted) + && Objects.equals( + this.encryptionParameters, createVolumePayload.encryptionParameters) + && Objects.equals(this.id, createVolumePayload.id) + && Objects.equals(this.imageConfig, createVolumePayload.imageConfig) + && Objects.equals(this.labels, createVolumePayload.labels) + && Objects.equals(this.name, createVolumePayload.name) + && Objects.equals(this.performanceClass, createVolumePayload.performanceClass) + && Objects.equals(this.serverId, createVolumePayload.serverId) + && Objects.equals(this.size, createVolumePayload.size) + && Objects.equals(this.source, createVolumePayload.source) + && Objects.equals(this.status, createVolumePayload.status) + && Objects.equals(this.updatedAt, createVolumePayload.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + availabilityZone, + bootable, + createdAt, + description, + encrypted, + encryptionParameters, + id, + imageConfig, + labels, + name, + performanceClass, + serverId, + size, + source, + status, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateVolumePayload {\n"); + sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); + sb.append(" bootable: ").append(toIndentedString(bootable)).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(" encryptionParameters: ") + .append(toIndentedString(encryptionParameters)) + .append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + 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(" performanceClass: ").append(toIndentedString(performanceClass)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + 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("}"); + 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( + "availabilityZone", + "bootable", + "createdAt", + "description", + "encrypted", + "encryptionParameters", + "id", + "imageConfig", + "labels", + "name", + "performanceClass", + "serverId", + "size", + "source", + "status", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("availabilityZone")); + } + + /** + * 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 CreateVolumePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateVolumePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("availabilityZone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } + // validate the optional field `encryptionParameters` + if (jsonObj.get("encryptionParameters") != null + && !jsonObj.get("encryptionParameters").isJsonNull()) { + VolumeEncryptionParameter.validateJsonElement(jsonObj.get("encryptionParameters")); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + // validate the optional field `imageConfig` + if (jsonObj.get("imageConfig") != null && !jsonObj.get("imageConfig").isJsonNull()) { + ImageConfig.validateJsonElement(jsonObj.get("imageConfig")); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("performanceClass") != null + && !jsonObj.get("performanceClass").isJsonNull()) + && !jsonObj.get("performanceClass").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `performanceClass` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("performanceClass").toString())); + } + if ((jsonObj.get("serverId") != null && !jsonObj.get("serverId").isJsonNull()) + && !jsonObj.get("serverId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `serverId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("serverId").toString())); + } + // validate the optional field `source` + if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { + VolumeSource.validateJsonElement(jsonObj.get("source")); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!CreateVolumePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateVolumePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateVolumePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateVolumePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateVolumePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateVolumePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateVolumePayload + * @throws IOException if the JSON string is invalid with respect to CreateVolumePayload + */ + public static CreateVolumePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateVolumePayload.class); + } + + /** + * Convert an instance of CreateVolumePayload 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 new file mode 100644 index 0000000..7681de4 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Error.java @@ -0,0 +1,232 @@ +/* + * 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; + +/** Error with HTTP error code and an error message. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class Error { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nonnull + private Long code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @javax.annotation.Nonnull + private String msg; + + public Error() {} + + public Error code(@javax.annotation.Nonnull Long code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @javax.annotation.Nonnull + public Long getCode() { + return code; + } + + public void setCode(@javax.annotation.Nonnull Long code) { + this.code = code; + } + + public Error msg(@javax.annotation.Nonnull String msg) { + this.msg = msg; + return this; + } + + /** + * An error message. + * + * @return msg + */ + @javax.annotation.Nonnull + public String getMsg() { + return msg; + } + + public void setMsg(@javax.annotation.Nonnull String msg) { + this.msg = msg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Error error = (Error) o; + return Objects.equals(this.code, error.code) && Objects.equals(this.msg, error.msg); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Error {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).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("code", "msg")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("code", "msg")); + } + + /** + * 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 Error + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Error.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Error.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Error' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Error.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Error value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Error read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Error given an JSON string + * + * @param jsonString JSON string + * @return An instance of Error + * @throws IOException if the JSON string is invalid with respect to Error + */ + public static Error fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Error.class); + } + + /** + * Convert an instance of Error 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/GetServerLog200Response.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/GetServerLog200Response.java new file mode 100644 index 0000000..50fe307 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/GetServerLog200Response.java @@ -0,0 +1,197 @@ +/* + * 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; + +/** GetServerLog200Response */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class GetServerLog200Response { + public static final String SERIALIZED_NAME_OUTPUT = "output"; + + @SerializedName(SERIALIZED_NAME_OUTPUT) + @javax.annotation.Nullable private String output; + + public GetServerLog200Response() {} + + public GetServerLog200Response output(@javax.annotation.Nullable String output) { + this.output = output; + return this; + } + + /** + * Get output + * + * @return output + */ + @javax.annotation.Nullable public String getOutput() { + return output; + } + + public void setOutput(@javax.annotation.Nullable String output) { + this.output = output; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerLog200Response getServerLog200Response = (GetServerLog200Response) o; + return Objects.equals(this.output, getServerLog200Response.output); + } + + @Override + public int hashCode() { + return Objects.hash(output); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetServerLog200Response {\n"); + sb.append(" output: ").append(toIndentedString(output)).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("output")); + + // 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 GetServerLog200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetServerLog200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `output` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("output").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetServerLog200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetServerLog200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetServerLog200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetServerLog200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetServerLog200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetServerLog200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetServerLog200Response + * @throws IOException if the JSON string is invalid with respect to GetServerLog200Response + */ + public static GetServerLog200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetServerLog200Response.class); + } + + /** + * Convert an instance of GetServerLog200Response 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/ICMPParameters.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ICMPParameters.java new file mode 100644 index 0000000..408dfb3 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ICMPParameters.java @@ -0,0 +1,227 @@ +/* + * 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; + +/** Object that represents ICMP parameters. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ICMPParameters { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nonnull + private Long code; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private Long type; + + public ICMPParameters() {} + + public ICMPParameters code(@javax.annotation.Nonnull Long code) { + this.code = code; + return this; + } + + /** + * ICMP code. Can be set if the protocol is ICMP. minimum: 0 maximum: 255 + * + * @return code + */ + @javax.annotation.Nonnull + public Long getCode() { + return code; + } + + public void setCode(@javax.annotation.Nonnull Long code) { + this.code = code; + } + + public ICMPParameters type(@javax.annotation.Nonnull Long type) { + this.type = type; + return this; + } + + /** + * ICMP type. Can be set if the protocol is ICMP. minimum: 0 maximum: 255 + * + * @return type + */ + @javax.annotation.Nonnull + public Long getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull Long type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ICMPParameters icMPParameters = (ICMPParameters) o; + return Objects.equals(this.code, icMPParameters.code) + && Objects.equals(this.type, icMPParameters.type); + } + + @Override + public int hashCode() { + return Objects.hash(code, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ICMPParameters {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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("code", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("code", "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 ICMPParameters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ICMPParameters.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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 (!ICMPParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ICMPParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ICMPParameters.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ICMPParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ICMPParameters read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ICMPParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of ICMPParameters + * @throws IOException if the JSON string is invalid with respect to ICMPParameters + */ + public static ICMPParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ICMPParameters.class); + } + + /** + * Convert an instance of ICMPParameters 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/Image.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Image.java new file mode 100644 index 0000000..9d66df7 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Image.java @@ -0,0 +1,621 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; + +/** + * Object that represents an Image and its parameters. Used for Creating and returning (get/list). + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class Image { + public static final String SERIALIZED_NAME_AGENT = "agent"; + + @SerializedName(SERIALIZED_NAME_AGENT) + @javax.annotation.Nullable private ImageAgent agent; + + public static final String SERIALIZED_NAME_CHECKSUM = "checksum"; + + @SerializedName(SERIALIZED_NAME_CHECKSUM) + @javax.annotation.Nullable private ImageChecksum checksum; + + public static final String SERIALIZED_NAME_CONFIG = "config"; + + @SerializedName(SERIALIZED_NAME_CONFIG) + @javax.annotation.Nullable private ImageConfig config; + + 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_DISK_FORMAT = "diskFormat"; + + @SerializedName(SERIALIZED_NAME_DISK_FORMAT) + @javax.annotation.Nonnull + private String diskFormat; + + 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_MIN_DISK_SIZE = "minDiskSize"; + + @SerializedName(SERIALIZED_NAME_MIN_DISK_SIZE) + @javax.annotation.Nullable private Long minDiskSize; + + public static final String SERIALIZED_NAME_MIN_RAM = "minRam"; + + @SerializedName(SERIALIZED_NAME_MIN_RAM) + @javax.annotation.Nullable private Long minRam; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_OWNER = "owner"; + + @SerializedName(SERIALIZED_NAME_OWNER) + @javax.annotation.Nullable private UUID owner; + + public static final String SERIALIZED_NAME_PROTECTED = "protected"; + + @SerializedName(SERIALIZED_NAME_PROTECTED) + @javax.annotation.Nullable private Boolean _protected; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable private String scope; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable private Long size; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public Image() {} + + public Image( + ImageChecksum checksum, + OffsetDateTime createdAt, + UUID id, + UUID owner, + String scope, + Long size, + String status, + OffsetDateTime updatedAt) { + this(); + this.checksum = checksum; + this.createdAt = createdAt; + this.id = id; + this.owner = owner; + this.scope = scope; + this.size = size; + this.status = status; + this.updatedAt = updatedAt; + } + + public Image agent(@javax.annotation.Nullable ImageAgent agent) { + this.agent = agent; + return this; + } + + /** + * Get agent + * + * @return agent + */ + @javax.annotation.Nullable public ImageAgent getAgent() { + return agent; + } + + public void setAgent(@javax.annotation.Nullable ImageAgent agent) { + this.agent = agent; + } + + /** + * Get checksum + * + * @return checksum + */ + @javax.annotation.Nullable public ImageChecksum getChecksum() { + return checksum; + } + + public Image config(@javax.annotation.Nullable ImageConfig config) { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config + */ + @javax.annotation.Nullable public ImageConfig getConfig() { + return config; + } + + public void setConfig(@javax.annotation.Nullable ImageConfig config) { + this.config = config; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public Image 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; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public Image labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public Image minDiskSize(@javax.annotation.Nullable Long minDiskSize) { + this.minDiskSize = minDiskSize; + return this; + } + + /** + * Size in Gigabyte. + * + * @return minDiskSize + */ + @javax.annotation.Nullable public Long getMinDiskSize() { + return minDiskSize; + } + + public void setMinDiskSize(@javax.annotation.Nullable Long minDiskSize) { + this.minDiskSize = minDiskSize; + } + + public Image minRam(@javax.annotation.Nullable Long minRam) { + this.minRam = minRam; + return this; + } + + /** + * Size in Megabyte. + * + * @return minRam + */ + @javax.annotation.Nullable public Long getMinRam() { + return minRam; + } + + public void setMinRam(@javax.annotation.Nullable Long minRam) { + this.minRam = minRam; + } + + public Image 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; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return owner + */ + @javax.annotation.Nullable public UUID getOwner() { + return owner; + } + + public Image _protected(@javax.annotation.Nullable Boolean _protected) { + this._protected = _protected; + return this; + } + + /** + * When true the 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; + } + + /** + * Scope of an Image. Possible values: `public`, `local`, + * `projects`, `organization`. + * + * @return scope + */ + @javax.annotation.Nullable public String getScope() { + return scope; + } + + /** + * Size in bytes. + * + * @return size + */ + @javax.annotation.Nullable public Long getSize() { + return size; + } + + /** + * The status of an image object. Possible values: `AVAILABLE`, `CREATING`, + * `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Image image = (Image) o; + return Objects.equals(this.agent, image.agent) + && Objects.equals(this.checksum, image.checksum) + && Objects.equals(this.config, image.config) + && Objects.equals(this.createdAt, image.createdAt) + && Objects.equals(this.diskFormat, image.diskFormat) + && Objects.equals(this.id, image.id) + && Objects.equals(this.labels, image.labels) + && Objects.equals(this.minDiskSize, image.minDiskSize) + && Objects.equals(this.minRam, image.minRam) + && Objects.equals(this.name, image.name) + && Objects.equals(this.owner, image.owner) + && Objects.equals(this._protected, image._protected) + && Objects.equals(this.scope, image.scope) + && Objects.equals(this.size, image.size) + && Objects.equals(this.status, image.status) + && Objects.equals(this.updatedAt, image.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + agent, + checksum, + config, + createdAt, + diskFormat, + id, + labels, + minDiskSize, + minRam, + name, + owner, + _protected, + scope, + size, + status, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Image {\n"); + sb.append(" agent: ").append(toIndentedString(agent)).append("\n"); + sb.append(" checksum: ").append(toIndentedString(checksum)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + 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(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" minDiskSize: ").append(toIndentedString(minDiskSize)).append("\n"); + sb.append(" minRam: ").append(toIndentedString(minRam)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); + sb.append(" _protected: ").append(toIndentedString(_protected)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + 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("}"); + 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( + "agent", + "checksum", + "config", + "createdAt", + "diskFormat", + "id", + "labels", + "minDiskSize", + "minRam", + "name", + "owner", + "protected", + "scope", + "size", + "status", + "updatedAt")); + + // 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 Image + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Image.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `agent` + if (jsonObj.get("agent") != null && !jsonObj.get("agent").isJsonNull()) { + ImageAgent.validateJsonElement(jsonObj.get("agent")); + } + // validate the optional field `checksum` + if (jsonObj.get("checksum") != null && !jsonObj.get("checksum").isJsonNull()) { + ImageChecksum.validateJsonElement(jsonObj.get("checksum")); + } + // validate the optional field `config` + if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { + ImageConfig.validateJsonElement(jsonObj.get("config")); + } + if (!jsonObj.get("diskFormat").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `diskFormat` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("diskFormat").toString())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("owner") != null && !jsonObj.get("owner").isJsonNull()) + && !jsonObj.get("owner").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `owner` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("owner").toString())); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) + && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `scope` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("scope").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!Image.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Image' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Image.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Image value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Image read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Image given an JSON string + * + * @param jsonString JSON string + * @return An instance of Image + * @throws IOException if the JSON string is invalid with respect to Image + */ + public static Image fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Image.class); + } + + /** + * Convert an instance of Image 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/ImageAgent.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageAgent.java new file mode 100644 index 0000000..283c6f8 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageAgent.java @@ -0,0 +1,216 @@ +/* + * 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; + +/** Support status and default provioning setting for the STACKIT server agent. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ImageAgent { + public static final String SERIALIZED_NAME_PROVISION_BY_DEFAULT = "provisionByDefault"; + + @SerializedName(SERIALIZED_NAME_PROVISION_BY_DEFAULT) + @javax.annotation.Nullable private Boolean provisionByDefault; + + public static final String SERIALIZED_NAME_SUPPORTED = "supported"; + + @SerializedName(SERIALIZED_NAME_SUPPORTED) + @javax.annotation.Nullable private Boolean supported; + + public ImageAgent() {} + + public ImageAgent provisionByDefault(@javax.annotation.Nullable Boolean provisionByDefault) { + this.provisionByDefault = provisionByDefault; + return this; + } + + /** + * Default provioning of the STACKIT server agent for new servers. The default for new images is + * false. Can only be enabled when supported is also true. + * + * @return provisionByDefault + */ + @javax.annotation.Nullable public Boolean getProvisionByDefault() { + return provisionByDefault; + } + + public void setProvisionByDefault(@javax.annotation.Nullable Boolean provisionByDefault) { + this.provisionByDefault = provisionByDefault; + } + + public ImageAgent supported(@javax.annotation.Nullable Boolean supported) { + this.supported = supported; + return this; + } + + /** + * Indicates the STACKIT server agent for the image. The default for new images is false. + * + * @return supported + */ + @javax.annotation.Nullable public Boolean getSupported() { + return supported; + } + + public void setSupported(@javax.annotation.Nullable Boolean supported) { + this.supported = supported; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageAgent imageAgent = (ImageAgent) o; + return Objects.equals(this.provisionByDefault, imageAgent.provisionByDefault) + && Objects.equals(this.supported, imageAgent.supported); + } + + @Override + public int hashCode() { + return Objects.hash(provisionByDefault, supported); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageAgent {\n"); + sb.append(" provisionByDefault: ") + .append(toIndentedString(provisionByDefault)) + .append("\n"); + sb.append(" supported: ").append(toIndentedString(supported)).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("provisionByDefault", "supported")); + + // 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 ImageAgent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImageAgent.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImageAgent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImageAgent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ImageAgent.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ImageAgent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ImageAgent read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ImageAgent given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImageAgent + * @throws IOException if the JSON string is invalid with respect to ImageAgent + */ + public static ImageAgent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImageAgent.class); + } + + /** + * Convert an instance of ImageAgent 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/ImageChecksum.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageChecksum.java new file mode 100644 index 0000000..57c520c --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageChecksum.java @@ -0,0 +1,240 @@ +/* + * 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; + +/** Representation of an image checksum. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ImageChecksum { + public static final String SERIALIZED_NAME_ALGORITHM = "algorithm"; + + @SerializedName(SERIALIZED_NAME_ALGORITHM) + @javax.annotation.Nonnull + private String algorithm; + + public static final String SERIALIZED_NAME_DIGEST = "digest"; + + @SerializedName(SERIALIZED_NAME_DIGEST) + @javax.annotation.Nonnull + private String digest; + + public ImageChecksum() {} + + public ImageChecksum algorithm(@javax.annotation.Nonnull String algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Algorithm for the checksum of the image data. Possible values: `md5`, + * `sha512`. + * + * @return algorithm + */ + @javax.annotation.Nonnull + public String getAlgorithm() { + return algorithm; + } + + public void setAlgorithm(@javax.annotation.Nonnull String algorithm) { + this.algorithm = algorithm; + } + + public ImageChecksum digest(@javax.annotation.Nonnull String digest) { + this.digest = digest; + return this; + } + + /** + * Hexdigest of the checksum of the image data. + * + * @return digest + */ + @javax.annotation.Nonnull + public String getDigest() { + return digest; + } + + public void setDigest(@javax.annotation.Nonnull String digest) { + this.digest = digest; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageChecksum imageChecksum = (ImageChecksum) o; + return Objects.equals(this.algorithm, imageChecksum.algorithm) + && Objects.equals(this.digest, imageChecksum.digest); + } + + @Override + public int hashCode() { + return Objects.hash(algorithm, digest); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageChecksum {\n"); + sb.append(" algorithm: ").append(toIndentedString(algorithm)).append("\n"); + sb.append(" digest: ").append(toIndentedString(digest)).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("algorithm", "digest")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("algorithm", "digest")); + } + + /** + * 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 ImageChecksum + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImageChecksum.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("algorithm").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `digest` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("digest").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImageChecksum.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImageChecksum' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ImageChecksum.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ImageChecksum value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ImageChecksum read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ImageChecksum given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImageChecksum + * @throws IOException if the JSON string is invalid with respect to ImageChecksum + */ + public static ImageChecksum fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImageChecksum.class); + } + + /** + * Convert an instance of ImageChecksum 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/ImageConfig.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageConfig.java new file mode 100644 index 0000000..4924911 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageConfig.java @@ -0,0 +1,648 @@ +/* + * 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; +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.14.0") +public class ImageConfig { + public static final String SERIALIZED_NAME_ARCHITECTURE = "architecture"; + + @SerializedName(SERIALIZED_NAME_ARCHITECTURE) + @javax.annotation.Nullable private String architecture; + + public static final String SERIALIZED_NAME_BOOT_MENU = "bootMenu"; + + @SerializedName(SERIALIZED_NAME_BOOT_MENU) + @javax.annotation.Nullable private Boolean bootMenu; + + public static final String SERIALIZED_NAME_CDROM_BUS = "cdromBus"; + + @SerializedName(SERIALIZED_NAME_CDROM_BUS) + @javax.annotation.Nullable private String cdromBus; + + public static final String SERIALIZED_NAME_DISK_BUS = "diskBus"; + + @SerializedName(SERIALIZED_NAME_DISK_BUS) + @javax.annotation.Nullable private String diskBus; + + public static final String SERIALIZED_NAME_NIC_MODEL = "nicModel"; + + @SerializedName(SERIALIZED_NAME_NIC_MODEL) + @javax.annotation.Nullable private String nicModel; + + public static final String SERIALIZED_NAME_OPERATING_SYSTEM = "operatingSystem"; + + @SerializedName(SERIALIZED_NAME_OPERATING_SYSTEM) + @javax.annotation.Nullable private String operatingSystem; + + public static final String SERIALIZED_NAME_OPERATING_SYSTEM_DISTRO = "operatingSystemDistro"; + + @SerializedName(SERIALIZED_NAME_OPERATING_SYSTEM_DISTRO) + @javax.annotation.Nullable private String operatingSystemDistro; + + public static final String SERIALIZED_NAME_OPERATING_SYSTEM_VERSION = "operatingSystemVersion"; + + @SerializedName(SERIALIZED_NAME_OPERATING_SYSTEM_VERSION) + @javax.annotation.Nullable private String operatingSystemVersion; + + public static final String SERIALIZED_NAME_RESCUE_BUS = "rescueBus"; + + @SerializedName(SERIALIZED_NAME_RESCUE_BUS) + @javax.annotation.Nullable private String rescueBus; + + public static final String SERIALIZED_NAME_RESCUE_DEVICE = "rescueDevice"; + + @SerializedName(SERIALIZED_NAME_RESCUE_DEVICE) + @javax.annotation.Nullable private String rescueDevice; + + public static final String SERIALIZED_NAME_SECURE_BOOT = "secureBoot"; + + @SerializedName(SERIALIZED_NAME_SECURE_BOOT) + @javax.annotation.Nullable private Boolean secureBoot; + + public static final String SERIALIZED_NAME_UEFI = "uefi"; + + @SerializedName(SERIALIZED_NAME_UEFI) + @javax.annotation.Nullable private Boolean uefi; + + public static final String SERIALIZED_NAME_VIDEO_MODEL = "videoModel"; + + @SerializedName(SERIALIZED_NAME_VIDEO_MODEL) + @javax.annotation.Nullable private String videoModel; + + public static final String SERIALIZED_NAME_VIRTIO_SCSI = "virtioScsi"; + + @SerializedName(SERIALIZED_NAME_VIRTIO_SCSI) + @javax.annotation.Nullable private Boolean virtioScsi; + + public ImageConfig() {} + + public ImageConfig architecture(@javax.annotation.Nullable String architecture) { + this.architecture = architecture; + return this; + } + + /** + * Represents CPU architecture. The default for new images is x86. Possible values: + * `arm64`, `x86`. + * + * @return architecture + */ + @javax.annotation.Nullable public String getArchitecture() { + return architecture; + } + + public void setArchitecture(@javax.annotation.Nullable String architecture) { + this.architecture = architecture; + } + + public ImageConfig bootMenu(@javax.annotation.Nullable Boolean bootMenu) { + this.bootMenu = bootMenu; + return this; + } + + /** + * Enables the BIOS bootmenu. The default for new images is disabled. + * + * @return bootMenu + */ + @javax.annotation.Nullable public Boolean getBootMenu() { + return bootMenu; + } + + public void setBootMenu(@javax.annotation.Nullable Boolean bootMenu) { + this.bootMenu = bootMenu; + } + + public ImageConfig cdromBus(@javax.annotation.Nullable String cdromBus) { + this.cdromBus = cdromBus; + return this; + } + + /** + * Sets CDROM bus controller type. Possible values: `scsi`, `virtio`, + * `ide`, `usb`. + * + * @return cdromBus + */ + @javax.annotation.Nullable public String getCdromBus() { + return cdromBus; + } + + public void setCdromBus(@javax.annotation.Nullable String cdromBus) { + this.cdromBus = cdromBus; + } + + public ImageConfig diskBus(@javax.annotation.Nullable String diskBus) { + this.diskBus = diskBus; + return this; + } + + /** + * Sets Disk bus controller type. Possible values: `scsi`, `virtio`, + * `ide`, `usb`. + * + * @return diskBus + */ + @javax.annotation.Nullable public String getDiskBus() { + return diskBus; + } + + public void setDiskBus(@javax.annotation.Nullable String diskBus) { + this.diskBus = diskBus; + } + + public ImageConfig nicModel(@javax.annotation.Nullable String nicModel) { + this.nicModel = nicModel; + return this; + } + + /** + * Sets virtual nic model. Possible values: `e1000`, `e1000e`, + * `ne2k_pci`, `pcnet`, `rtl8139`, `virtio`, + * `vmxnet3`. + * + * @return nicModel + */ + @javax.annotation.Nullable public String getNicModel() { + return nicModel; + } + + public void setNicModel(@javax.annotation.Nullable String nicModel) { + this.nicModel = nicModel; + } + + public ImageConfig operatingSystem(@javax.annotation.Nullable String operatingSystem) { + this.operatingSystem = operatingSystem; + return this; + } + + /** + * Enables OS specific optimizations. Possible values: `windows`, `linux`. + * + * @return operatingSystem + */ + @javax.annotation.Nullable public String getOperatingSystem() { + return operatingSystem; + } + + public void setOperatingSystem(@javax.annotation.Nullable String operatingSystem) { + this.operatingSystem = operatingSystem; + } + + public ImageConfig operatingSystemDistro( + @javax.annotation.Nullable String operatingSystemDistro) { + this.operatingSystemDistro = operatingSystemDistro; + return this; + } + + /** + * Operating System Distribution. + * + * @return operatingSystemDistro + */ + @javax.annotation.Nullable public String getOperatingSystemDistro() { + return operatingSystemDistro; + } + + public void setOperatingSystemDistro(@javax.annotation.Nullable String operatingSystemDistro) { + this.operatingSystemDistro = operatingSystemDistro; + } + + public ImageConfig operatingSystemVersion( + @javax.annotation.Nullable String operatingSystemVersion) { + this.operatingSystemVersion = operatingSystemVersion; + return this; + } + + /** + * Version of the OS. + * + * @return operatingSystemVersion + */ + @javax.annotation.Nullable public String getOperatingSystemVersion() { + return operatingSystemVersion; + } + + public void setOperatingSystemVersion( + @javax.annotation.Nullable String operatingSystemVersion) { + this.operatingSystemVersion = operatingSystemVersion; + } + + public ImageConfig rescueBus(@javax.annotation.Nullable String rescueBus) { + this.rescueBus = rescueBus; + return this; + } + + /** + * Sets the device bus when the image is used as a rescue image. Possible values: + * `sata`, `scsi`, `virtio`, `usb`. + * + * @return rescueBus + */ + @javax.annotation.Nullable public String getRescueBus() { + return rescueBus; + } + + public void setRescueBus(@javax.annotation.Nullable String rescueBus) { + this.rescueBus = rescueBus; + } + + public ImageConfig rescueDevice(@javax.annotation.Nullable String rescueDevice) { + this.rescueDevice = rescueDevice; + return this; + } + + /** + * Sets the device when the image is used as a rescue image. Possible values: `cdrom`, + * `disk`. + * + * @return rescueDevice + */ + @javax.annotation.Nullable public String getRescueDevice() { + return rescueDevice; + } + + public void setRescueDevice(@javax.annotation.Nullable String rescueDevice) { + this.rescueDevice = rescueDevice; + } + + public ImageConfig secureBoot(@javax.annotation.Nullable Boolean secureBoot) { + this.secureBoot = secureBoot; + return this; + } + + /** + * Enables Secure Boot. The default for new images is disabled. + * + * @return secureBoot + */ + @javax.annotation.Nullable public Boolean getSecureBoot() { + return secureBoot; + } + + public void setSecureBoot(@javax.annotation.Nullable Boolean secureBoot) { + this.secureBoot = secureBoot; + } + + public ImageConfig uefi(@javax.annotation.Nullable Boolean uefi) { + this.uefi = uefi; + return this; + } + + /** + * Configure UEFI boot. The default for new images is enabled. + * + * @return uefi + */ + @javax.annotation.Nullable public Boolean getUefi() { + return uefi; + } + + public void setUefi(@javax.annotation.Nullable Boolean uefi) { + this.uefi = uefi; + } + + public ImageConfig videoModel(@javax.annotation.Nullable String videoModel) { + this.videoModel = videoModel; + return this; + } + + /** + * Sets Graphic device model. Possible values: `vga`, `cirrus`, + * `vmvga`, `qxl`, `virtio`, `none`. + * + * @return videoModel + */ + @javax.annotation.Nullable public String getVideoModel() { + return videoModel; + } + + public void setVideoModel(@javax.annotation.Nullable String videoModel) { + this.videoModel = videoModel; + } + + public ImageConfig virtioScsi(@javax.annotation.Nullable Boolean virtioScsi) { + this.virtioScsi = virtioScsi; + return this; + } + + /** + * Enables the use of VirtIO SCSI to provide block device access. By default servers use VirtIO + * Block. + * + * @return virtioScsi + */ + @javax.annotation.Nullable public Boolean getVirtioScsi() { + return virtioScsi; + } + + public void setVirtioScsi(@javax.annotation.Nullable Boolean virtioScsi) { + this.virtioScsi = virtioScsi; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageConfig imageConfig = (ImageConfig) o; + return Objects.equals(this.architecture, imageConfig.architecture) + && Objects.equals(this.bootMenu, imageConfig.bootMenu) + && Objects.equals(this.cdromBus, imageConfig.cdromBus) + && Objects.equals(this.diskBus, imageConfig.diskBus) + && Objects.equals(this.nicModel, imageConfig.nicModel) + && Objects.equals(this.operatingSystem, imageConfig.operatingSystem) + && Objects.equals(this.operatingSystemDistro, imageConfig.operatingSystemDistro) + && Objects.equals(this.operatingSystemVersion, imageConfig.operatingSystemVersion) + && Objects.equals(this.rescueBus, imageConfig.rescueBus) + && Objects.equals(this.rescueDevice, imageConfig.rescueDevice) + && Objects.equals(this.secureBoot, imageConfig.secureBoot) + && Objects.equals(this.uefi, imageConfig.uefi) + && Objects.equals(this.videoModel, imageConfig.videoModel) + && Objects.equals(this.virtioScsi, imageConfig.virtioScsi); + } + + 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( + architecture, + bootMenu, + cdromBus, + diskBus, + nicModel, + operatingSystem, + operatingSystemDistro, + operatingSystemVersion, + rescueBus, + rescueDevice, + secureBoot, + uefi, + videoModel, + virtioScsi); + } + + 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 ImageConfig {\n"); + sb.append(" architecture: ").append(toIndentedString(architecture)).append("\n"); + sb.append(" bootMenu: ").append(toIndentedString(bootMenu)).append("\n"); + sb.append(" cdromBus: ").append(toIndentedString(cdromBus)).append("\n"); + sb.append(" diskBus: ").append(toIndentedString(diskBus)).append("\n"); + sb.append(" nicModel: ").append(toIndentedString(nicModel)).append("\n"); + sb.append(" operatingSystem: ").append(toIndentedString(operatingSystem)).append("\n"); + sb.append(" operatingSystemDistro: ") + .append(toIndentedString(operatingSystemDistro)) + .append("\n"); + sb.append(" operatingSystemVersion: ") + .append(toIndentedString(operatingSystemVersion)) + .append("\n"); + sb.append(" rescueBus: ").append(toIndentedString(rescueBus)).append("\n"); + sb.append(" rescueDevice: ").append(toIndentedString(rescueDevice)).append("\n"); + sb.append(" secureBoot: ").append(toIndentedString(secureBoot)).append("\n"); + 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("}"); + 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( + "architecture", + "bootMenu", + "cdromBus", + "diskBus", + "nicModel", + "operatingSystem", + "operatingSystemDistro", + "operatingSystemVersion", + "rescueBus", + "rescueDevice", + "secureBoot", + "uefi", + "videoModel", + "virtioScsi")); + + // 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 ImageConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImageConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `architecture` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("architecture").toString())); + } + if ((jsonObj.get("cdromBus") != null && !jsonObj.get("cdromBus").isJsonNull()) + && !jsonObj.get("cdromBus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cdromBus` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("cdromBus").toString())); + } + if ((jsonObj.get("diskBus") != null && !jsonObj.get("diskBus").isJsonNull()) + && !jsonObj.get("diskBus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `diskBus` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("diskBus").toString())); + } + if ((jsonObj.get("nicModel") != null && !jsonObj.get("nicModel").isJsonNull()) + && !jsonObj.get("nicModel").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `nicModel` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("nicModel").toString())); + } + if ((jsonObj.get("operatingSystem") != null && !jsonObj.get("operatingSystem").isJsonNull()) + && !jsonObj.get("operatingSystem").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `operatingSystem` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("operatingSystem").toString())); + } + if ((jsonObj.get("operatingSystemDistro") != null + && !jsonObj.get("operatingSystemDistro").isJsonNull()) + && !jsonObj.get("operatingSystemDistro").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `operatingSystemDistro` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("operatingSystemDistro").toString())); + } + if ((jsonObj.get("operatingSystemVersion") != null + && !jsonObj.get("operatingSystemVersion").isJsonNull()) + && !jsonObj.get("operatingSystemVersion").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `operatingSystemVersion` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("operatingSystemVersion").toString())); + } + if ((jsonObj.get("rescueBus") != null && !jsonObj.get("rescueBus").isJsonNull()) + && !jsonObj.get("rescueBus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rescueBus` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("rescueBus").toString())); + } + if ((jsonObj.get("rescueDevice") != null && !jsonObj.get("rescueDevice").isJsonNull()) + && !jsonObj.get("rescueDevice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rescueDevice` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("rescueDevice").toString())); + } + if ((jsonObj.get("videoModel") != null && !jsonObj.get("videoModel").isJsonNull()) + && !jsonObj.get("videoModel").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `videoModel` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("videoModel").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImageConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImageConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ImageConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ImageConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ImageConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ImageConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImageConfig + * @throws IOException if the JSON string is invalid with respect to ImageConfig + */ + public static ImageConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImageConfig.class); + } + + /** + * Convert an instance of ImageConfig 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/ImageCreateResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageCreateResponse.java new file mode 100644 index 0000000..b032637 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageCreateResponse.java @@ -0,0 +1,242 @@ +/* + * 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.net.URI; +import java.util.Arrays; +import java.util.HashSet; +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.14.0") +public class ImageCreateResponse { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private UUID id; + + public static final String SERIALIZED_NAME_UPLOAD_URL = "uploadUrl"; + + @SerializedName(SERIALIZED_NAME_UPLOAD_URL) + @javax.annotation.Nonnull + private URI uploadUrl; + + public ImageCreateResponse() {} + + public ImageCreateResponse 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 ImageCreateResponse uploadUrl(@javax.annotation.Nonnull URI uploadUrl) { + this.uploadUrl = uploadUrl; + return this; + } + + /** + * Get uploadUrl + * + * @return uploadUrl + */ + @javax.annotation.Nonnull + public URI getUploadUrl() { + return uploadUrl; + } + + public void setUploadUrl(@javax.annotation.Nonnull URI uploadUrl) { + this.uploadUrl = uploadUrl; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageCreateResponse imageCreateResponse = (ImageCreateResponse) o; + return Objects.equals(this.id, imageCreateResponse.id) + && Objects.equals(this.uploadUrl, imageCreateResponse.uploadUrl); + } + + @Override + public int hashCode() { + return Objects.hash(id, uploadUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageCreateResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" uploadUrl: ").append(toIndentedString(uploadUrl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "uploadUrl")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "uploadUrl")); + } + + /** + * 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 ImageCreateResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImageCreateResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `uploadUrl` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("uploadUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImageCreateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImageCreateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ImageCreateResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ImageCreateResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ImageCreateResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ImageCreateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImageCreateResponse + * @throws IOException if the JSON string is invalid with respect to ImageCreateResponse + */ + public static ImageCreateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImageCreateResponse.class); + } + + /** + * Convert an instance of ImageCreateResponse 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 new file mode 100644 index 0000000..2a3f0ea --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageListResponse.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Image list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ImageListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public ImageListResponse() {} + + public ImageListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public ImageListResponse addItemsItem(Image itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list containing image objects. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageListResponse imageListResponse = (ImageListResponse) o; + return Objects.equals(this.items, imageListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 ImageListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImageListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + Image.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImageListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImageListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ImageListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ImageListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ImageListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ImageListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImageListResponse + * @throws IOException if the JSON string is invalid with respect to ImageListResponse + */ + public static ImageListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImageListResponse.class); + } + + /** + * Convert an instance of ImageListResponse 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/ImageShare.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShare.java new file mode 100644 index 0000000..e0f288a --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShare.java @@ -0,0 +1,237 @@ +/* + * 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 java.util.UUID; + +/** + * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ImageShare { + public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; + + @SerializedName(SERIALIZED_NAME_PARENT_ORGANIZATION) + @javax.annotation.Nullable private Boolean parentOrganization; + + public static final String SERIALIZED_NAME_PROJECTS = "projects"; + + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable private List projects = new ArrayList<>(); + + public ImageShare() {} + + public ImageShare parentOrganization(@javax.annotation.Nullable Boolean parentOrganization) { + this.parentOrganization = parentOrganization; + return this; + } + + /** + * Image is shared with all projects inside the image owners organization. + * + * @return parentOrganization + */ + @javax.annotation.Nullable public Boolean getParentOrganization() { + return parentOrganization; + } + + public void setParentOrganization(@javax.annotation.Nullable Boolean parentOrganization) { + this.parentOrganization = parentOrganization; + } + + public ImageShare projects(@javax.annotation.Nullable List projects) { + this.projects = projects; + return this; + } + + public ImageShare addProjectsItem(UUID projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * List of all projects the Image is shared with. + * + * @return projects + */ + @javax.annotation.Nullable public List getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List projects) { + this.projects = projects; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageShare imageShare = (ImageShare) o; + return Objects.equals(this.parentOrganization, imageShare.parentOrganization) + && Objects.equals(this.projects, imageShare.projects); + } + + @Override + public int hashCode() { + return Objects.hash(parentOrganization, projects); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageShare {\n"); + sb.append(" parentOrganization: ") + .append(toIndentedString(parentOrganization)) + .append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).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("parentOrganization", "projects")); + + // 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 ImageShare + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImageShare.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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 + && !jsonObj.get("projects").isJsonNull() + && !jsonObj.get("projects").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `projects` to be an array in the JSON string but got `%s`", + jsonObj.get("projects").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImageShare.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImageShare' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ImageShare.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ImageShare value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ImageShare read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ImageShare given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImageShare + * @throws IOException if the JSON string is invalid with respect to ImageShare + */ + public static ImageShare fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImageShare.class); + } + + /** + * Convert an instance of ImageShare 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/ImageShareConsumer.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShareConsumer.java new file mode 100644 index 0000000..0941a29 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ImageShareConsumer.java @@ -0,0 +1,261 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.0") +public class ImageShareConsumer { + public static final String SERIALIZED_NAME_CONSUMER_PROJECT_ID = "consumerProjectId"; + + @SerializedName(SERIALIZED_NAME_CONSUMER_PROJECT_ID) + @javax.annotation.Nullable private UUID consumerProjectId; + + 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_IMAGE_ID = "imageId"; + + @SerializedName(SERIALIZED_NAME_IMAGE_ID) + @javax.annotation.Nullable private UUID imageId; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public ImageShareConsumer() {} + + public ImageShareConsumer( + UUID consumerProjectId, + OffsetDateTime createdAt, + UUID imageId, + OffsetDateTime updatedAt) { + this(); + this.consumerProjectId = consumerProjectId; + this.createdAt = createdAt; + this.imageId = imageId; + this.updatedAt = updatedAt; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return consumerProjectId + */ + @javax.annotation.Nullable public UUID getConsumerProjectId() { + return consumerProjectId; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return imageId + */ + @javax.annotation.Nullable public UUID getImageId() { + return imageId; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageShareConsumer imageShareConsumer = (ImageShareConsumer) 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); + } + + @Override + public int hashCode() { + return Objects.hash(consumerProjectId, createdAt, imageId, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageShareConsumer {\n"); + sb.append(" consumerProjectId: ") + .append(toIndentedString(consumerProjectId)) + .append("\n"); + 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("}"); + 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("consumerProjectId", "createdAt", "imageId", "updatedAt")); + + // 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 ImageShareConsumer + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ImageShareConsumer.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `consumerProjectId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("consumerProjectId").toString())); + } + if ((jsonObj.get("imageId") != null && !jsonObj.get("imageId").isJsonNull()) + && !jsonObj.get("imageId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `imageId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("imageId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ImageShareConsumer.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ImageShareConsumer' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ImageShareConsumer.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ImageShareConsumer value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ImageShareConsumer read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ImageShareConsumer given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImageShareConsumer + * @throws IOException if the JSON string is invalid with respect to ImageShareConsumer + */ + public static ImageShareConsumer fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ImageShareConsumer.class); + } + + /** + * Convert an instance of ImageShareConsumer 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/KeyPairListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/KeyPairListResponse.java new file mode 100644 index 0000000..cac5b49 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/KeyPairListResponse.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** SSH keypair list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class KeyPairListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public KeyPairListResponse() {} + + public KeyPairListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public KeyPairListResponse addItemsItem(Keypair itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of SSH keypairs. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + KeyPairListResponse keyPairListResponse = (KeyPairListResponse) o; + return Objects.equals(this.items, keyPairListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class KeyPairListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 KeyPairListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!KeyPairListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + Keypair.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!KeyPairListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'KeyPairListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(KeyPairListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, KeyPairListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public KeyPairListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of KeyPairListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of KeyPairListResponse + * @throws IOException if the JSON string is invalid with respect to KeyPairListResponse + */ + public static KeyPairListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, KeyPairListResponse.class); + } + + /** + * Convert an instance of KeyPairListResponse 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/Keypair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Keypair.java new file mode 100644 index 0000000..1b8ee74 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Keypair.java @@ -0,0 +1,338 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.0") +public class Keypair { + 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_FINGERPRINT = "fingerprint"; + + @SerializedName(SERIALIZED_NAME_FINGERPRINT) + @javax.annotation.Nullable private String fingerprint; + + 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_PUBLIC_KEY = "publicKey"; + + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + @javax.annotation.Nonnull + private String publicKey; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public Keypair() {} + + public Keypair(OffsetDateTime createdAt, String fingerprint, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.fingerprint = fingerprint; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Object that represents an SSH keypair MD5 fingerprint. + * + * @return fingerprint + */ + @javax.annotation.Nullable public String getFingerprint() { + return fingerprint; + } + + public Keypair labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public Keypair name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the + * following special characters: [@._-]. + * + * @return name + */ + @javax.annotation.Nullable public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + public Keypair publicKey(@javax.annotation.Nonnull String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Object that represents a public SSH key. + * + * @return publicKey + */ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + public void setPublicKey(@javax.annotation.Nonnull String publicKey) { + this.publicKey = publicKey; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Keypair keypair = (Keypair) o; + return Objects.equals(this.createdAt, keypair.createdAt) + && Objects.equals(this.fingerprint, keypair.fingerprint) + && Objects.equals(this.labels, keypair.labels) + && Objects.equals(this.name, keypair.name) + && Objects.equals(this.publicKey, keypair.publicKey) + && Objects.equals(this.updatedAt, keypair.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, fingerprint, labels, name, publicKey, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Keypair {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + 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("}"); + 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", + "fingerprint", + "labels", + "name", + "publicKey", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("publicKey")); + } + + /** + * 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 Keypair + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Keypair.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("fingerprint") != null && !jsonObj.get("fingerprint").isJsonNull()) + && !jsonObj.get("fingerprint").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("fingerprint").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Keypair.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Keypair' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Keypair.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Keypair value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Keypair read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Keypair given an JSON string + * + * @param jsonString JSON string + * @return An instance of Keypair + * @throws IOException if the JSON string is invalid with respect to Keypair + */ + public static Keypair fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Keypair.class); + } + + /** + * Convert an instance of Keypair 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/MachineType.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineType.java new file mode 100644 index 0000000..79ba2fb --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineType.java @@ -0,0 +1,349 @@ +/* + * 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; + +/** + * Machine Type. Filterable Fields: `disk`, `extraSpecs`, `name`, + * `ram`, `vcpus`. + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class MachineType { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + + public static final String SERIALIZED_NAME_DISK = "disk"; + + @SerializedName(SERIALIZED_NAME_DISK) + @javax.annotation.Nonnull + private Long disk; + + public static final String SERIALIZED_NAME_EXTRA_SPECS = "extraSpecs"; + + @SerializedName(SERIALIZED_NAME_EXTRA_SPECS) + @javax.annotation.Nullable private Object extraSpecs; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_RAM = "ram"; + + @SerializedName(SERIALIZED_NAME_RAM) + @javax.annotation.Nonnull + private Long ram; + + public static final String SERIALIZED_NAME_VCPUS = "vcpus"; + + @SerializedName(SERIALIZED_NAME_VCPUS) + @javax.annotation.Nonnull + private Long vcpus; + + public MachineType() {} + + public MachineType 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 MachineType disk(@javax.annotation.Nonnull Long disk) { + this.disk = disk; + return this; + } + + /** + * Size in Gigabyte. + * + * @return disk + */ + @javax.annotation.Nonnull + public Long getDisk() { + return disk; + } + + public void setDisk(@javax.annotation.Nonnull Long disk) { + this.disk = disk; + } + + public MachineType extraSpecs(@javax.annotation.Nullable Object extraSpecs) { + this.extraSpecs = extraSpecs; + return this; + } + + /** + * Properties to control certain aspects or scheduling behavior for an object. + * + * @return extraSpecs + */ + @javax.annotation.Nullable public Object getExtraSpecs() { + return extraSpecs; + } + + public void setExtraSpecs(@javax.annotation.Nullable Object extraSpecs) { + this.extraSpecs = extraSpecs; + } + + public MachineType 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 MachineType ram(@javax.annotation.Nonnull Long ram) { + this.ram = ram; + return this; + } + + /** + * Size in Megabyte. + * + * @return ram + */ + @javax.annotation.Nonnull + public Long getRam() { + return ram; + } + + public void setRam(@javax.annotation.Nonnull Long ram) { + this.ram = ram; + } + + public MachineType vcpus(@javax.annotation.Nonnull Long vcpus) { + this.vcpus = vcpus; + return this; + } + + /** + * The number of virtual CPUs of a server. minimum: 1 + * + * @return vcpus + */ + @javax.annotation.Nonnull + public Long getVcpus() { + return vcpus; + } + + public void setVcpus(@javax.annotation.Nonnull Long vcpus) { + this.vcpus = vcpus; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MachineType machineType = (MachineType) o; + return Objects.equals(this.description, machineType.description) + && Objects.equals(this.disk, machineType.disk) + && Objects.equals(this.extraSpecs, machineType.extraSpecs) + && Objects.equals(this.name, machineType.name) + && Objects.equals(this.ram, machineType.ram) + && Objects.equals(this.vcpus, machineType.vcpus); + } + + @Override + public int hashCode() { + return Objects.hash(description, disk, extraSpecs, name, ram, vcpus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MachineType {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" disk: ").append(toIndentedString(disk)).append("\n"); + sb.append(" extraSpecs: ").append(toIndentedString(extraSpecs)).append("\n"); + 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("}"); + 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", "disk", "extraSpecs", "name", "ram", "vcpus")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("disk", "name", "ram", "vcpus")); + } + + /** + * 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 MachineType + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MachineType.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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( + "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 (!MachineType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MachineType' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MachineType.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MachineType value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MachineType read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MachineType given an JSON string + * + * @param jsonString JSON string + * @return An instance of MachineType + * @throws IOException if the JSON string is invalid with respect to MachineType + */ + public static MachineType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MachineType.class); + } + + /** + * Convert an instance of MachineType 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/MachineTypeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineTypeListResponse.java new file mode 100644 index 0000000..022ebb6 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/MachineTypeListResponse.java @@ -0,0 +1,227 @@ +/* + * 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; + +/** Machine type list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class MachineTypeListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public MachineTypeListResponse() {} + + public MachineTypeListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public MachineTypeListResponse addItemsItem(MachineType itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * Machine type list. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MachineTypeListResponse machineTypeListResponse = (MachineTypeListResponse) o; + return Objects.equals(this.items, machineTypeListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MachineTypeListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 MachineTypeListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MachineTypeListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + MachineType.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MachineTypeListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MachineTypeListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(MachineTypeListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, MachineTypeListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MachineTypeListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of MachineTypeListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of MachineTypeListResponse + * @throws IOException if the JSON string is invalid with respect to MachineTypeListResponse + */ + public static MachineTypeListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MachineTypeListResponse.class); + } + + /** + * Convert an instance of MachineTypeListResponse 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/NIC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NIC.java new file mode 100644 index 0000000..a72f4a6 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NIC.java @@ -0,0 +1,589 @@ +/* + * 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; +import java.util.UUID; + +/** Object that represents a network interface. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class NIC { + public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; + + @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) + @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DEVICE = "device"; + + @SerializedName(SERIALIZED_NAME_DEVICE) + @javax.annotation.Nullable private UUID device; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private String ipv4; + + public static final String SERIALIZED_NAME_IPV6 = "ipv6"; + + @SerializedName(SERIALIZED_NAME_IPV6) + @javax.annotation.Nullable private String ipv6; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_MAC = "mac"; + + @SerializedName(SERIALIZED_NAME_MAC) + @javax.annotation.Nullable private String mac; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; + + public static final String SERIALIZED_NAME_NETWORK_ID = "networkId"; + + @SerializedName(SERIALIZED_NAME_NETWORK_ID) + @javax.annotation.Nullable private UUID networkId; + + public static final String SERIALIZED_NAME_NIC_SECURITY = "nicSecurity"; + + @SerializedName(SERIALIZED_NAME_NIC_SECURITY) + @javax.annotation.Nullable private Boolean nicSecurity = true; + + public static final String SERIALIZED_NAME_SECURITY_GROUPS = "securityGroups"; + + @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) + @javax.annotation.Nullable private List securityGroups = new ArrayList<>(); + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable private String type; + + public NIC() {} + + public NIC(UUID device, UUID id, String mac, UUID networkId, String status, String type) { + this(); + this.device = device; + this.id = id; + this.mac = mac; + this.networkId = networkId; + this.status = status; + this.type = type; + } + + public NIC allowedAddresses( + @javax.annotation.Nullable List allowedAddresses) { + this.allowedAddresses = allowedAddresses; + return this; + } + + public NIC addAllowedAddressesItem(AllowedAddressesInner allowedAddressesItem) { + if (this.allowedAddresses == null) { + this.allowedAddresses = new ArrayList<>(); + } + this.allowedAddresses.add(allowedAddressesItem); + return this; + } + + /** + * A list of IPs or CIDR notations. + * + * @return allowedAddresses + */ + @javax.annotation.Nullable public List getAllowedAddresses() { + return allowedAddresses; + } + + public void setAllowedAddresses( + @javax.annotation.Nullable List allowedAddresses) { + this.allowedAddresses = allowedAddresses; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return device + */ + @javax.annotation.Nullable public UUID getDevice() { + return device; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public NIC ipv4(@javax.annotation.Nullable String ipv4) { + this.ipv4 = ipv4; + return this; + } + + /** + * Object that represents an IP address. + * + * @return ipv4 + */ + @javax.annotation.Nullable public String getIpv4() { + return ipv4; + } + + public void setIpv4(@javax.annotation.Nullable String ipv4) { + this.ipv4 = ipv4; + } + + public NIC ipv6(@javax.annotation.Nullable String ipv6) { + this.ipv6 = ipv6; + return this; + } + + /** + * String that represents an IPv6 address. + * + * @return ipv6 + */ + @javax.annotation.Nullable public String getIpv6() { + return ipv6; + } + + public void setIpv6(@javax.annotation.Nullable String ipv6) { + this.ipv6 = ipv6; + } + + public NIC labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + /** + * Object that represents an MAC address. + * + * @return mac + */ + @javax.annotation.Nullable public String getMac() { + return mac; + } + + public NIC 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; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return networkId + */ + @javax.annotation.Nullable public UUID getNetworkId() { + return networkId; + } + + public NIC nicSecurity(@javax.annotation.Nullable Boolean nicSecurity) { + this.nicSecurity = nicSecurity; + return this; + } + + /** + * If this is set to false, then no security groups will apply to this network interface. + * + * @return nicSecurity + */ + @javax.annotation.Nullable public Boolean getNicSecurity() { + return nicSecurity; + } + + public void setNicSecurity(@javax.annotation.Nullable Boolean nicSecurity) { + this.nicSecurity = nicSecurity; + } + + public NIC securityGroups(@javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + public NIC addSecurityGroupsItem(UUID securityGroupsItem) { + if (this.securityGroups == null) { + this.securityGroups = new ArrayList<>(); + } + this.securityGroups.add(securityGroupsItem); + return this; + } + + /** + * A list of UUIDs. + * + * @return securityGroups + */ + @javax.annotation.Nullable public List getSecurityGroups() { + return securityGroups; + } + + public void setSecurityGroups(@javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + } + + /** + * Possible values: `ACTIVE`, `DOWN`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Possible values: `server`, `metadata`, `gateway`, + * `none`. + * + * @return type + */ + @javax.annotation.Nullable public String getType() { + return type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NIC NIC = (NIC) o; + return Objects.equals(this.allowedAddresses, NIC.allowedAddresses) + && Objects.equals(this.device, NIC.device) + && Objects.equals(this.id, NIC.id) + && Objects.equals(this.ipv4, NIC.ipv4) + && Objects.equals(this.ipv6, NIC.ipv6) + && Objects.equals(this.labels, NIC.labels) + && Objects.equals(this.mac, NIC.mac) + && Objects.equals(this.name, NIC.name) + && Objects.equals(this.networkId, NIC.networkId) + && Objects.equals(this.nicSecurity, NIC.nicSecurity) + && Objects.equals(this.securityGroups, NIC.securityGroups) + && Objects.equals(this.status, NIC.status) + && Objects.equals(this.type, NIC.type); + } + + @Override + public int hashCode() { + return Objects.hash( + allowedAddresses, + device, + id, + ipv4, + ipv6, + labels, + mac, + name, + networkId, + nicSecurity, + securityGroups, + status, + type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NIC {\n"); + sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" device: ").append(toIndentedString(device)).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(" mac: ").append(toIndentedString(mac)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" networkId: ").append(toIndentedString(networkId)).append("\n"); + sb.append(" nicSecurity: ").append(toIndentedString(nicSecurity)).append("\n"); + 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("}"); + 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( + "allowedAddresses", + "device", + "id", + "ipv4", + "ipv6", + "labels", + "mac", + "name", + "networkId", + "nicSecurity", + "securityGroups", + "status", + "type")); + + // 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 NIC + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NIC.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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()) { + JsonArray jsonArrayallowedAddresses = jsonObj.getAsJsonArray("allowedAddresses"); + if (jsonArrayallowedAddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("allowedAddresses").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `allowedAddresses` to be an array in the JSON string but got `%s`", + jsonObj.get("allowedAddresses").toString())); + } + + // validate the optional field `allowedAddresses` (array) + for (int i = 0; i < jsonArrayallowedAddresses.size(); i++) { + AllowedAddressesInner.validateJsonElement(jsonArrayallowedAddresses.get(i)); + } + ; + } + } + if ((jsonObj.get("device") != null && !jsonObj.get("device").isJsonNull()) + && !jsonObj.get("device").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `device` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("device").toString())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) + && !jsonObj.get("ipv4").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ipv4` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ipv4").toString())); + } + if ((jsonObj.get("ipv6") != null && !jsonObj.get("ipv6").isJsonNull()) + && !jsonObj.get("ipv6").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ipv6` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ipv6").toString())); + } + if ((jsonObj.get("mac") != null && !jsonObj.get("mac").isJsonNull()) + && !jsonObj.get("mac").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `mac` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("mac").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("networkId") != null && !jsonObj.get("networkId").isJsonNull()) + && !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("securityGroups") != null + && !jsonObj.get("securityGroups").isJsonNull() + && !jsonObj.get("securityGroups").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", + jsonObj.get("securityGroups").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!NIC.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NIC' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NIC.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NIC value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NIC read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NIC given an JSON string + * + * @param jsonString JSON string + * @return An instance of NIC + * @throws IOException if the JSON string is invalid with respect to NIC + */ + public static NIC fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NIC.class); + } + + /** + * Convert an instance of NIC 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/NICListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NICListResponse.java new file mode 100644 index 0000000..fe3a685 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NICListResponse.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** NIC list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class NICListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public NICListResponse() {} + + public NICListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public NICListResponse addItemsItem(NIC itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of network interfaces. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NICListResponse niCListResponse = (NICListResponse) o; + return Objects.equals(this.items, niCListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NICListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 NICListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NICListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + NIC.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NICListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NICListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NICListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NICListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NICListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NICListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of NICListResponse + * @throws IOException if the JSON string is invalid with respect to NICListResponse + */ + public static NICListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NICListResponse.class); + } + + /** + * Convert an instance of NICListResponse 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/Network.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Network.java new file mode 100644 index 0000000..d0de4ad --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Network.java @@ -0,0 +1,709 @@ +/* + * 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.time.OffsetDateTime; +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 java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Object that represents a network. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class Network { + 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_DHCP = "dhcp"; + + @SerializedName(SERIALIZED_NAME_DHCP) + @javax.annotation.Nullable private Boolean dhcp; + + public static final String SERIALIZED_NAME_GATEWAY = "gateway"; + + @SerializedName(SERIALIZED_NAME_GATEWAY) + @javax.annotation.Nullable private String gateway; + + public static final String SERIALIZED_NAME_GATEWAYV6 = "gatewayv6"; + + @SerializedName(SERIALIZED_NAME_GATEWAYV6) + @javax.annotation.Nullable private String gatewayv6; + + 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_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"; + + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nonnull + private String state; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public Network() {} + + public Network(OffsetDateTime createdAt, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public Network 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 Network 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 Network gatewayv6(@javax.annotation.Nullable String gatewayv6) { + this.gatewayv6 = gatewayv6; + 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 gatewayv6 + */ + @javax.annotation.Nullable public String getGatewayv6() { + return gatewayv6; + } + + public void setGatewayv6(@javax.annotation.Nullable String gatewayv6) { + this.gatewayv6 = gatewayv6; + } + + public Network labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public Network name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + 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); + 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 Network nameserversV6(@javax.annotation.Nullable List nameserversV6) { + this.nameserversV6 = nameserversV6; + return this; + } + + public Network addNameserversV6Item(String nameserversV6Item) { + if (this.nameserversV6 == null) { + this.nameserversV6 = new ArrayList<>(); + } + this.nameserversV6.add(nameserversV6Item); + return this; + } + + /** + * A list containing DNS Servers/Nameservers for IPv6. + * + * @return nameserversV6 + */ + @javax.annotation.Nullable public List getNameserversV6() { + return nameserversV6; + } + + public void setNameserversV6(@javax.annotation.Nullable List nameserversV6) { + this.nameserversV6 = nameserversV6; + } + + public Network networkId(@javax.annotation.Nonnull UUID networkId) { + this.networkId = networkId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return networkId + */ + @javax.annotation.Nonnull + public UUID getNetworkId() { + return networkId; + } + + 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; + } + + /** + * 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 + * + * @return prefixesV6 + */ + @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; + } + + /** + * Object that represents an IP address. + * + * @return publicIp + */ + @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; + } + + /** + * Shows if the network is routed and therefore accessible from other networks. + * + * @return routed + */ + @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; + return this; + } + + /** + * The state of a resource object. Possible values: `CREATING`, `CREATED`, + * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, + * `UPDATING`. + * + * @return state + */ + @javax.annotation.Nonnull + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nonnull String state) { + this.state = state; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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.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())); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + dhcp, + gateway, + gatewayv6, + 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; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + 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(" 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(" updatedAt: ").append(toIndentedString(updatedAt)).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", + "dhcp", + "gateway", + "gatewayv6", + "labels", + "name", + "nameservers", + "nameserversV6", + "networkId", + "prefixes", + "prefixesV6", + "publicIp", + "routed", + "state", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("name", "networkId", "state")); + } + + /** + * 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 Network + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Network.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "Expected the field `gateway` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("gateway").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())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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()) { + 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())); + } + 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 { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Network.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Network' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Network.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Network value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Network read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Network given an JSON string + * + * @param jsonString JSON string + * @return An instance of Network + * @throws IOException if the JSON string is invalid with respect to Network + */ + public static Network fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Network.class); + } + + /** + * Convert an instance of Network 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/NetworkArea.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkArea.java new file mode 100644 index 0000000..d84001e --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkArea.java @@ -0,0 +1,409 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.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"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private NetworkAreaIPv4 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 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; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public NetworkArea() {} + + public NetworkArea(OffsetDateTime createdAt, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + 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. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public NetworkArea ipv4(@javax.annotation.Nullable NetworkAreaIPv4 ipv4) { + this.ipv4 = ipv4; + return this; + } + + /** + * Get ipv4 + * + * @return ipv4 + */ + @javax.annotation.Nullable public NetworkAreaIPv4 getIpv4() { + return ipv4; + } + + public void setIpv4(@javax.annotation.Nullable NetworkAreaIPv4 ipv4) { + this.ipv4 = ipv4; + } + + public NetworkArea labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public NetworkArea name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + 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() { + return projectCount; + } + + public void setProjectCount(@javax.annotation.Nonnull Long projectCount) { + this.projectCount = projectCount; + } + + public NetworkArea state(@javax.annotation.Nonnull String state) { + this.state = state; + return this; + } + + /** + * The state of a resource object. Possible values: `CREATING`, `CREATED`, + * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, + * `UPDATING`. + * + * @return state + */ + @javax.annotation.Nonnull + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nonnull String state) { + this.state = state; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + 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) + && 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); + } + + @Override + public int hashCode() { + return Objects.hash(areaId, createdAt, ipv4, labels, name, projectCount, state, updatedAt); + } + + @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(" 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("}"); + 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( + "areaId", + "createdAt", + "ipv4", + "labels", + "name", + "projectCount", + "state", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = + new HashSet(Arrays.asList("areaId", "name", "projectCount", "state")); + } + + /** + * 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 NetworkArea + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NetworkArea.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("areaId").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")); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NetworkArea.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NetworkArea' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NetworkArea.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NetworkArea value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NetworkArea read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NetworkArea given an JSON string + * + * @param jsonString JSON string + * @return An instance of NetworkArea + * @throws IOException if the JSON string is invalid with respect to NetworkArea + */ + public static NetworkArea fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NetworkArea.class); + } + + /** + * Convert an instance of NetworkArea 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/NetworkAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkAreaIPv4.java new file mode 100644 index 0000000..7dcaf50 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkAreaIPv4.java @@ -0,0 +1,438 @@ +/* + * 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.14.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 new file mode 100644 index 0000000..4df5cf3 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkAreaListResponse.java @@ -0,0 +1,227 @@ +/* + * 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; + +/** Network area list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class NetworkAreaListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public NetworkAreaListResponse() {} + + public NetworkAreaListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public NetworkAreaListResponse addItemsItem(NetworkArea itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of network areas. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NetworkAreaListResponse networkAreaListResponse = (NetworkAreaListResponse) o; + return Objects.equals(this.items, networkAreaListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NetworkAreaListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 NetworkAreaListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NetworkAreaListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + NetworkArea.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NetworkAreaListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NetworkAreaListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NetworkAreaListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NetworkAreaListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NetworkAreaListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NetworkAreaListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of NetworkAreaListResponse + * @throws IOException if the JSON string is invalid with respect to NetworkAreaListResponse + */ + public static NetworkAreaListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NetworkAreaListResponse.class); + } + + /** + * Convert an instance of NetworkAreaListResponse 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 new file mode 100644 index 0000000..56be4d7 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkListResponse.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Network list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class NetworkListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public NetworkListResponse() {} + + public NetworkListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public NetworkListResponse addItemsItem(Network itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of networks. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NetworkListResponse networkListResponse = (NetworkListResponse) o; + return Objects.equals(this.items, networkListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NetworkListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 NetworkListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NetworkListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + Network.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NetworkListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NetworkListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NetworkListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NetworkListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NetworkListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NetworkListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of NetworkListResponse + * @throws IOException if the JSON string is invalid with respect to NetworkListResponse + */ + public static NetworkListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NetworkListResponse.class); + } + + /** + * Convert an instance of NetworkListResponse 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/NetworkRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRange.java new file mode 100644 index 0000000..e8f4f47 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRange.java @@ -0,0 +1,272 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.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"; + + @SerializedName(SERIALIZED_NAME_NETWORK_RANGE_ID) + @javax.annotation.Nullable private UUID networkRangeId; + + public static final String SERIALIZED_NAME_PREFIX = "prefix"; + + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nonnull + private String prefix; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public NetworkRange() {} + + public NetworkRange(OffsetDateTime createdAt, UUID networkRangeId, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.networkRangeId = networkRangeId; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return networkRangeId + */ + @javax.annotation.Nullable public UUID getNetworkRangeId() { + return networkRangeId; + } + + public NetworkRange prefix(@javax.annotation.Nonnull String prefix) { + this.prefix = prefix; + return this; + } + + /** + * 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; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NetworkRange networkRange = (NetworkRange) o; + return Objects.equals(this.createdAt, networkRange.createdAt) + && Objects.equals(this.networkRangeId, networkRange.networkRangeId) + && Objects.equals(this.prefix, networkRange.prefix) + && Objects.equals(this.updatedAt, networkRange.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, networkRangeId, prefix, updatedAt); + } + + @Override + 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(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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", "networkRangeId", "prefix", "updatedAt")); + + // 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 NetworkRange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NetworkRange.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("networkRangeId") != null && !jsonObj.get("networkRangeId").isJsonNull()) + && !jsonObj.get("networkRangeId").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())); + } + 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NetworkRange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NetworkRange' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NetworkRange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NetworkRange value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NetworkRange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NetworkRange given an JSON string + * + * @param jsonString JSON string + * @return An instance of NetworkRange + * @throws IOException if the JSON string is invalid with respect to NetworkRange + */ + public static NetworkRange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NetworkRange.class); + } + + /** + * Convert an instance of NetworkRange 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/NetworkRangeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRangeListResponse.java new file mode 100644 index 0000000..4da8392 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/NetworkRangeListResponse.java @@ -0,0 +1,227 @@ +/* + * 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; + +/** Network Range list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class NetworkRangeListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public NetworkRangeListResponse() {} + + public NetworkRangeListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public NetworkRangeListResponse addItemsItem(NetworkRange itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of network ranges. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NetworkRangeListResponse networkRangeListResponse = (NetworkRangeListResponse) o; + return Objects.equals(this.items, networkRangeListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NetworkRangeListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 NetworkRangeListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NetworkRangeListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + NetworkRange.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NetworkRangeListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NetworkRangeListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NetworkRangeListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NetworkRangeListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NetworkRangeListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NetworkRangeListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of NetworkRangeListResponse + * @throws IOException if the JSON string is invalid with respect to NetworkRangeListResponse + */ + public static NetworkRangeListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NetworkRangeListResponse.class); + } + + /** + * Convert an instance of NetworkRangeListResponse 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 new file mode 100644 index 0000000..0c5daf1 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkAreaPayload.java @@ -0,0 +1,260 @@ +/* + * 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; + +/** PartialUpdateNetworkAreaPayload */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.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) + @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 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; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public PartialUpdateNetworkAreaPayload 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PartialUpdateNetworkAreaPayload partialUpdateNetworkAreaPayload = + (PartialUpdateNetworkAreaPayload) o; + return Objects.equals(this.addressFamily, partialUpdateNetworkAreaPayload.addressFamily) + && Objects.equals(this.labels, partialUpdateNetworkAreaPayload.labels) + && Objects.equals(this.name, partialUpdateNetworkAreaPayload.name); + } + + @Override + public int hashCode() { + return Objects.hash(addressFamily, labels, name); + } + + @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("}"); + 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("addressFamily", "labels", "name")); + + // 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 + * PartialUpdateNetworkAreaPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PartialUpdateNetworkAreaPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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 (!PartialUpdateNetworkAreaPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PartialUpdateNetworkAreaPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(PartialUpdateNetworkAreaPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PartialUpdateNetworkAreaPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PartialUpdateNetworkAreaPayload read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PartialUpdateNetworkAreaPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of PartialUpdateNetworkAreaPayload + * @throws IOException if the JSON string is invalid with respect to + * PartialUpdateNetworkAreaPayload + */ + public static PartialUpdateNetworkAreaPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PartialUpdateNetworkAreaPayload.class); + } + + /** + * Convert an instance of PartialUpdateNetworkAreaPayload 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/PartialUpdateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkPayload.java new file mode 100644 index 0000000..b9060a6 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PartialUpdateNetworkPayload.java @@ -0,0 +1,309 @@ +/* + * 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; + +/** Object that represents the request body for a network update. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.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_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_ROUTED = "routed"; + + @SerializedName(SERIALIZED_NAME_ROUTED) + @javax.annotation.Nullable private Boolean routed; + + public PartialUpdateNetworkPayload() {} + + public PartialUpdateNetworkPayload addressFamily( + @javax.annotation.Nullable UpdateNetworkAddressFamily addressFamily) { + this.addressFamily = addressFamily; + return this; + } + + /** + * Get addressFamily + * + * @return addressFamily + */ + @javax.annotation.Nullable public UpdateNetworkAddressFamily getAddressFamily() { + return addressFamily; + } + + public void setAddressFamily( + @javax.annotation.Nullable UpdateNetworkAddressFamily addressFamily) { + this.addressFamily = addressFamily; + } + + public PartialUpdateNetworkPayload 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 PartialUpdateNetworkPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public PartialUpdateNetworkPayload 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 PartialUpdateNetworkPayload routed(@javax.annotation.Nullable Boolean routed) { + this.routed = routed; + return this; + } + + /** + * Shows if the network is routed and therefore accessible from other networks. + * + * @return routed + */ + @javax.annotation.Nullable public Boolean getRouted() { + return routed; + } + + public void setRouted(@javax.annotation.Nullable Boolean routed) { + this.routed = routed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PartialUpdateNetworkPayload partialUpdateNetworkPayload = (PartialUpdateNetworkPayload) o; + return Objects.equals(this.addressFamily, partialUpdateNetworkPayload.addressFamily) + && Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) + && Objects.equals(this.labels, partialUpdateNetworkPayload.labels) + && Objects.equals(this.name, partialUpdateNetworkPayload.name) + && Objects.equals(this.routed, partialUpdateNetworkPayload.routed); + } + + @Override + public int hashCode() { + return Objects.hash(addressFamily, dhcp, labels, name, routed); + } + + @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(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" routed: ").append(toIndentedString(routed)).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("addressFamily", "dhcp", "labels", "name", "routed")); + + // 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 + * PartialUpdateNetworkPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PartialUpdateNetworkPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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")); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!PartialUpdateNetworkPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PartialUpdateNetworkPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PartialUpdateNetworkPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PartialUpdateNetworkPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PartialUpdateNetworkPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PartialUpdateNetworkPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of PartialUpdateNetworkPayload + * @throws IOException if the JSON string is invalid with respect to PartialUpdateNetworkPayload + */ + public static PartialUpdateNetworkPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PartialUpdateNetworkPayload.class); + } + + /** + * Convert an instance of PartialUpdateNetworkPayload 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/PortRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PortRange.java new file mode 100644 index 0000000..7421129 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PortRange.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Object that represents a range of ports. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class PortRange { + public static final String SERIALIZED_NAME_MAX = "max"; + + @SerializedName(SERIALIZED_NAME_MAX) + @javax.annotation.Nonnull + private Long max; + + public static final String SERIALIZED_NAME_MIN = "min"; + + @SerializedName(SERIALIZED_NAME_MIN) + @javax.annotation.Nonnull + private Long min; + + public PortRange() {} + + public PortRange max(@javax.annotation.Nonnull Long max) { + this.max = max; + return this; + } + + /** + * The maximum port number. Should be greater or equal to the minimum. minimum: 0 maximum: 65535 + * + * @return max + */ + @javax.annotation.Nonnull + public Long getMax() { + return max; + } + + public void setMax(@javax.annotation.Nonnull Long max) { + this.max = max; + } + + public PortRange min(@javax.annotation.Nonnull Long min) { + this.min = min; + return this; + } + + /** + * The minimum port number. Should be less or equal to the maximum. minimum: 0 maximum: 65535 + * + * @return min + */ + @javax.annotation.Nonnull + public Long getMin() { + return min; + } + + public void setMin(@javax.annotation.Nonnull Long min) { + this.min = min; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PortRange portRange = (PortRange) o; + return Objects.equals(this.max, portRange.max) && Objects.equals(this.min, portRange.min); + } + + @Override + public int hashCode() { + return Objects.hash(max, min); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PortRange {\n"); + sb.append(" max: ").append(toIndentedString(max)).append("\n"); + sb.append(" min: ").append(toIndentedString(min)).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("max", "min")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("max", "min")); + } + + /** + * 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 PortRange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PortRange.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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 (!PortRange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PortRange' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PortRange.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PortRange value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PortRange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PortRange given an JSON string + * + * @param jsonString JSON string + * @return An instance of PortRange + * @throws IOException if the JSON string is invalid with respect to PortRange + */ + public static PortRange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PortRange.class); + } + + /** + * Convert an instance of PortRange 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/Project.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Project.java new file mode 100644 index 0000000..7b08f0f --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Project.java @@ -0,0 +1,372 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.0") +public class Project { + public static final String SERIALIZED_NAME_AREA_ID = "areaId"; + + @SerializedName(SERIALIZED_NAME_AREA_ID) + @javax.annotation.Nonnull + private AreaId 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_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"; + + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nonnull + private String state; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public Project() {} + + public Project(OffsetDateTime createdAt, String openstackProjectId, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.openstackProjectId = openstackProjectId; + this.updatedAt = updatedAt; + } + + public Project areaId(@javax.annotation.Nonnull AreaId areaId) { + this.areaId = areaId; + return this; + } + + /** + * Get areaId + * + * @return areaId + */ + @javax.annotation.Nonnull + public AreaId getAreaId() { + return areaId; + } + + public void setAreaId(@javax.annotation.Nonnull AreaId areaId) { + this.areaId = areaId; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public Project internetAccess(@javax.annotation.Nullable Boolean internetAccess) { + this.internetAccess = internetAccess; + return this; + } + + /** + * Get internetAccess + * + * @return internetAccess + */ + @javax.annotation.Nullable public Boolean getInternetAccess() { + return internetAccess; + } + + public void setInternetAccess(@javax.annotation.Nullable Boolean internetAccess) { + this.internetAccess = internetAccess; + } + + /** + * The identifier (ID) of the OpenStack project in the main region eu01. + * + * @return openstackProjectId + */ + @javax.annotation.Nullable public String getOpenstackProjectId() { + return openstackProjectId; + } + + public Project projectId(@javax.annotation.Nonnull UUID projectId) { + this.projectId = projectId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return projectId + */ + @javax.annotation.Nonnull + public UUID getProjectId() { + return projectId; + } + + public void setProjectId(@javax.annotation.Nonnull UUID projectId) { + this.projectId = projectId; + } + + public Project state(@javax.annotation.Nonnull String state) { + this.state = state; + return this; + } + + /** + * The state of a resource object. Possible values: `CREATING`, `CREATED`, + * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, + * `UPDATING`. + * + * @return state + */ + @javax.annotation.Nonnull + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nonnull String state) { + this.state = state; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Project project = (Project) o; + return Objects.equals(this.areaId, project.areaId) + && Objects.equals(this.createdAt, project.createdAt) + && 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); + } + + @Override + public int hashCode() { + return Objects.hash( + areaId, createdAt, internetAccess, openstackProjectId, projectId, state, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Project {\n"); + sb.append(" areaId: ").append(toIndentedString(areaId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).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(" updatedAt: ").append(toIndentedString(updatedAt)).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( + "areaId", + "createdAt", + "internetAccess", + "openstackProjectId", + "projectId", + "state", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("areaId", "projectId", "state")); + } + + /** + * 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 Project + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Project.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + 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()) { + 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())); + } + 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 { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Project.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Project' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Project.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Project value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Project read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Project given an JSON string + * + * @param jsonString JSON string + * @return An instance of Project + * @throws IOException if the JSON string is invalid with respect to Project + */ + public static Project fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Project.class); + } + + /** + * Convert an instance of Project 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/ProjectListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ProjectListResponse.java new file mode 100644 index 0000000..00f691d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ProjectListResponse.java @@ -0,0 +1,222 @@ +/* + * 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 java.util.UUID; + +/** Project list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ProjectListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public ProjectListResponse() {} + + public ProjectListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public ProjectListResponse addItemsItem(UUID itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of STACKIT projects. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectListResponse projectListResponse = (ProjectListResponse) o; + return Objects.equals(this.items, projectListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 ProjectListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("items") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ProjectListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectListResponse + * @throws IOException if the JSON string is invalid with respect to ProjectListResponse + */ + public static ProjectListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectListResponse.class); + } + + /** + * Convert an instance of ProjectListResponse 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/Protocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Protocol.java new file mode 100644 index 0000000..7100d3e --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Protocol.java @@ -0,0 +1,225 @@ +/* + * 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 schema for a protocol of a security group rule. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class Protocol { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; + + public static final String SERIALIZED_NAME_NUMBER = "number"; + + @SerializedName(SERIALIZED_NAME_NUMBER) + @javax.annotation.Nullable private Long number; + + public Protocol() {} + + public Protocol name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The protocol name which the rule should match. Possible values: `ah`, + * `dccp`, `egp`, `esp`, `gre`, `icmp`, + * `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, + * `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, + * `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, + * `udp`, `udplite`, `vrrp`. + * + * @return name + */ + @javax.annotation.Nullable public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + public Protocol number(@javax.annotation.Nullable Long number) { + this.number = number; + return this; + } + + /** + * The protocol number which the rule should match. minimum: 0 maximum: 255 + * + * @return number + */ + @javax.annotation.Nullable public Long getNumber() { + return number; + } + + public void setNumber(@javax.annotation.Nullable Long number) { + this.number = number; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Protocol protocol = (Protocol) o; + return Objects.equals(this.name, protocol.name) + && Objects.equals(this.number, protocol.number); + } + + @Override + public int hashCode() { + return Objects.hash(name, number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Protocol {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).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("name", "number")); + + // 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 Protocol + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Protocol.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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 (!Protocol.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Protocol' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Protocol.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Protocol value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Protocol read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Protocol given an JSON string + * + * @param jsonString JSON string + * @return An instance of Protocol + * @throws IOException if the JSON string is invalid with respect to Protocol + */ + public static Protocol fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Protocol.class); + } + + /** + * Convert an instance of Protocol 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/PublicIp.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIp.java new file mode 100644 index 0000000..74e27ad --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIp.java @@ -0,0 +1,295 @@ +/* + * 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; +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.14.0") +public class PublicIp { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IP = "ip"; + + @SerializedName(SERIALIZED_NAME_IP) + @javax.annotation.Nullable private String ip; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_NETWORK_INTERFACE = "networkInterface"; + + @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) + @javax.annotation.Nullable private UUID networkInterface; + + public PublicIp() {} + + public PublicIp(UUID id, String ip) { + this(); + this.id = id; + this.ip = ip; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + /** + * Object that represents an IP address. + * + * @return ip + */ + @javax.annotation.Nullable public String getIp() { + return ip; + } + + public PublicIp labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public PublicIp networkInterface(@javax.annotation.Nullable UUID networkInterface) { + this.networkInterface = networkInterface; + return this; + } + + /** + * Associate the public IP with a network interface (ID). + * + * @return networkInterface + */ + @javax.annotation.Nullable public UUID getNetworkInterface() { + return networkInterface; + } + + public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface) { + this.networkInterface = networkInterface; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicIp publicIp = (PublicIp) 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); + } + + 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(id, ip, labels, networkInterface); + } + + 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 PublicIp {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + 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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = + new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + + // 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 PublicIp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicIp.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("ip") != null && !jsonObj.get("ip").isJsonNull()) + && !jsonObj.get("ip").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ip` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ip").toString())); + } + if ((jsonObj.get("networkInterface") != null + && !jsonObj.get("networkInterface").isJsonNull()) + && !jsonObj.get("networkInterface").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `networkInterface` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("networkInterface").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PublicIp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicIp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PublicIp.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PublicIp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PublicIp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PublicIp given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicIp + * @throws IOException if the JSON string is invalid with respect to PublicIp + */ + public static PublicIp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicIp.class); + } + + /** + * Convert an instance of PublicIp 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/PublicIpListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIpListResponse.java new file mode 100644 index 0000000..32fb07a --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicIpListResponse.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Public IP list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class PublicIpListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public PublicIpListResponse() {} + + public PublicIpListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public PublicIpListResponse addItemsItem(PublicIp itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of public IPs. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicIpListResponse publicIpListResponse = (PublicIpListResponse) o; + return Objects.equals(this.items, publicIpListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicIpListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 PublicIpListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicIpListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + PublicIp.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PublicIpListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicIpListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PublicIpListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PublicIpListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PublicIpListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PublicIpListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicIpListResponse + * @throws IOException if the JSON string is invalid with respect to PublicIpListResponse + */ + public static PublicIpListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicIpListResponse.class); + } + + /** + * Convert an instance of PublicIpListResponse 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/PublicNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetwork.java new file mode 100644 index 0000000..7f6beaa --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetwork.java @@ -0,0 +1,206 @@ +/* + * 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; + +/** Public network. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class PublicNetwork { + public static final String SERIALIZED_NAME_CIDR = "cidr"; + + @SerializedName(SERIALIZED_NAME_CIDR) + @javax.annotation.Nonnull + private String cidr; + + public PublicNetwork() {} + + public PublicNetwork cidr(@javax.annotation.Nonnull String cidr) { + this.cidr = cidr; + return this; + } + + /** + * Classless Inter-Domain Routing (CIDR). + * + * @return cidr + */ + @javax.annotation.Nonnull + public String getCidr() { + return cidr; + } + + public void setCidr(@javax.annotation.Nonnull String cidr) { + this.cidr = cidr; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicNetwork publicNetwork = (PublicNetwork) o; + return Objects.equals(this.cidr, publicNetwork.cidr); + } + + @Override + public int hashCode() { + return Objects.hash(cidr); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicNetwork {\n"); + sb.append(" cidr: ").append(toIndentedString(cidr)).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("cidr")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("cidr")); + } + + /** + * 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 PublicNetwork + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicNetwork.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("cidr").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cidr` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("cidr").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PublicNetwork.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicNetwork' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PublicNetwork.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PublicNetwork value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PublicNetwork read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PublicNetwork given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicNetwork + * @throws IOException if the JSON string is invalid with respect to PublicNetwork + */ + public static PublicNetwork fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicNetwork.class); + } + + /** + * Convert an instance of PublicNetwork 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/PublicNetworkListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetworkListResponse.java new file mode 100644 index 0000000..e3aafcb --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/PublicNetworkListResponse.java @@ -0,0 +1,227 @@ +/* + * 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; + +/** Public network list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class PublicNetworkListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public PublicNetworkListResponse() {} + + public PublicNetworkListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public PublicNetworkListResponse addItemsItem(PublicNetwork itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of public networks. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicNetworkListResponse publicNetworkListResponse = (PublicNetworkListResponse) o; + return Objects.equals(this.items, publicNetworkListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicNetworkListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 PublicNetworkListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicNetworkListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + PublicNetwork.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PublicNetworkListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicNetworkListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PublicNetworkListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PublicNetworkListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PublicNetworkListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PublicNetworkListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicNetworkListResponse + * @throws IOException if the JSON string is invalid with respect to PublicNetworkListResponse + */ + public static PublicNetworkListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicNetworkListResponse.class); + } + + /** + * Convert an instance of PublicNetworkListResponse 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/Quota.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Quota.java new file mode 100644 index 0000000..3c36408 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Quota.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Object that represents a single resource quota. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class Quota { + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + @javax.annotation.Nonnull + private Long limit; + + public static final String SERIALIZED_NAME_USAGE = "usage"; + + @SerializedName(SERIALIZED_NAME_USAGE) + @javax.annotation.Nonnull + private Long usage; + + public Quota() {} + + public Quota limit(@javax.annotation.Nonnull Long limit) { + this.limit = limit; + return this; + } + + /** + * Get limit + * + * @return limit + */ + @javax.annotation.Nonnull + public Long getLimit() { + return limit; + } + + public void setLimit(@javax.annotation.Nonnull Long limit) { + this.limit = limit; + } + + public Quota usage(@javax.annotation.Nonnull Long usage) { + this.usage = usage; + return this; + } + + /** + * Get usage + * + * @return usage + */ + @javax.annotation.Nonnull + public Long getUsage() { + return usage; + } + + public void setUsage(@javax.annotation.Nonnull Long usage) { + this.usage = usage; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Quota quota = (Quota) o; + return Objects.equals(this.limit, quota.limit) && Objects.equals(this.usage, quota.usage); + } + + @Override + public int hashCode() { + return Objects.hash(limit, usage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Quota {\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" usage: ").append(toIndentedString(usage)).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("limit", "usage")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("limit", "usage")); + } + + /** + * 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 Quota + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Quota.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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 (!Quota.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Quota' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Quota.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Quota value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Quota read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Quota given an JSON string + * + * @param jsonString JSON string + * @return An instance of Quota + * @throws IOException if the JSON string is invalid with respect to Quota + */ + public static Quota fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Quota.class); + } + + /** + * Convert an instance of Quota 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/QuotaList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaList.java new file mode 100644 index 0000000..6f471dd --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaList.java @@ -0,0 +1,563 @@ +/* + * 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; + +/** Object that represents the quotas for a project. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class QuotaList { + public static final String SERIALIZED_NAME_BACKUP_GIGABYTES = "backupGigabytes"; + + @SerializedName(SERIALIZED_NAME_BACKUP_GIGABYTES) + @javax.annotation.Nonnull + private Quota backupGigabytes; + + public static final String SERIALIZED_NAME_BACKUPS = "backups"; + + @SerializedName(SERIALIZED_NAME_BACKUPS) + @javax.annotation.Nonnull + private Quota backups; + + public static final String SERIALIZED_NAME_GIGABYTES = "gigabytes"; + + @SerializedName(SERIALIZED_NAME_GIGABYTES) + @javax.annotation.Nonnull + private Quota gigabytes; + + public static final String SERIALIZED_NAME_NETWORKS = "networks"; + + @SerializedName(SERIALIZED_NAME_NETWORKS) + @javax.annotation.Nonnull + private Quota networks; + + public static final String SERIALIZED_NAME_NICS = "nics"; + + @SerializedName(SERIALIZED_NAME_NICS) + @javax.annotation.Nonnull + private Quota nics; + + public static final String SERIALIZED_NAME_PUBLIC_IPS = "publicIps"; + + @SerializedName(SERIALIZED_NAME_PUBLIC_IPS) + @javax.annotation.Nonnull + private Quota publicIps; + + public static final String SERIALIZED_NAME_RAM = "ram"; + + @SerializedName(SERIALIZED_NAME_RAM) + @javax.annotation.Nonnull + private Quota ram; + + public static final String SERIALIZED_NAME_SECURITY_GROUP_RULES = "securityGroupRules"; + + @SerializedName(SERIALIZED_NAME_SECURITY_GROUP_RULES) + @javax.annotation.Nonnull + private Quota securityGroupRules; + + public static final String SERIALIZED_NAME_SECURITY_GROUPS = "securityGroups"; + + @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) + @javax.annotation.Nonnull + private Quota securityGroups; + + public static final String SERIALIZED_NAME_SNAPSHOTS = "snapshots"; + + @SerializedName(SERIALIZED_NAME_SNAPSHOTS) + @javax.annotation.Nonnull + private Quota snapshots; + + public static final String SERIALIZED_NAME_VCPU = "vcpu"; + + @SerializedName(SERIALIZED_NAME_VCPU) + @javax.annotation.Nonnull + private Quota vcpu; + + public static final String SERIALIZED_NAME_VOLUMES = "volumes"; + + @SerializedName(SERIALIZED_NAME_VOLUMES) + @javax.annotation.Nonnull + private Quota volumes; + + public QuotaList() {} + + public QuotaList backupGigabytes(@javax.annotation.Nonnull Quota backupGigabytes) { + this.backupGigabytes = backupGigabytes; + return this; + } + + /** + * Total size in GiB of backups. + * + * @return backupGigabytes + */ + @javax.annotation.Nonnull + public Quota getBackupGigabytes() { + return backupGigabytes; + } + + public void setBackupGigabytes(@javax.annotation.Nonnull Quota backupGigabytes) { + this.backupGigabytes = backupGigabytes; + } + + public QuotaList backups(@javax.annotation.Nonnull Quota backups) { + this.backups = backups; + return this; + } + + /** + * Number of backups. + * + * @return backups + */ + @javax.annotation.Nonnull + public Quota getBackups() { + return backups; + } + + public void setBackups(@javax.annotation.Nonnull Quota backups) { + this.backups = backups; + } + + public QuotaList gigabytes(@javax.annotation.Nonnull Quota gigabytes) { + this.gigabytes = gigabytes; + return this; + } + + /** + * Total size in GiB of volumes and snapshots. + * + * @return gigabytes + */ + @javax.annotation.Nonnull + public Quota getGigabytes() { + return gigabytes; + } + + public void setGigabytes(@javax.annotation.Nonnull Quota gigabytes) { + this.gigabytes = gigabytes; + } + + public QuotaList networks(@javax.annotation.Nonnull Quota networks) { + this.networks = networks; + return this; + } + + /** + * Number of networks. + * + * @return networks + */ + @javax.annotation.Nonnull + public Quota getNetworks() { + return networks; + } + + public void setNetworks(@javax.annotation.Nonnull Quota networks) { + this.networks = networks; + } + + public QuotaList nics(@javax.annotation.Nonnull Quota nics) { + this.nics = nics; + return this; + } + + /** + * Number of network interfaces. + * + * @return nics + */ + @javax.annotation.Nonnull + public Quota getNics() { + return nics; + } + + public void setNics(@javax.annotation.Nonnull Quota nics) { + this.nics = nics; + } + + public QuotaList publicIps(@javax.annotation.Nonnull Quota publicIps) { + this.publicIps = publicIps; + return this; + } + + /** + * Number of public IP addresses. + * + * @return publicIps + */ + @javax.annotation.Nonnull + public Quota getPublicIps() { + return publicIps; + } + + public void setPublicIps(@javax.annotation.Nonnull Quota publicIps) { + this.publicIps = publicIps; + } + + public QuotaList ram(@javax.annotation.Nonnull Quota ram) { + this.ram = ram; + return this; + } + + /** + * Amount of server RAM in MiB. + * + * @return ram + */ + @javax.annotation.Nonnull + public Quota getRam() { + return ram; + } + + public void setRam(@javax.annotation.Nonnull Quota ram) { + this.ram = ram; + } + + public QuotaList securityGroupRules(@javax.annotation.Nonnull Quota securityGroupRules) { + this.securityGroupRules = securityGroupRules; + return this; + } + + /** + * Number of security group rules. + * + * @return securityGroupRules + */ + @javax.annotation.Nonnull + public Quota getSecurityGroupRules() { + return securityGroupRules; + } + + public void setSecurityGroupRules(@javax.annotation.Nonnull Quota securityGroupRules) { + this.securityGroupRules = securityGroupRules; + } + + public QuotaList securityGroups(@javax.annotation.Nonnull Quota securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + /** + * Number of security groups. + * + * @return securityGroups + */ + @javax.annotation.Nonnull + public Quota getSecurityGroups() { + return securityGroups; + } + + public void setSecurityGroups(@javax.annotation.Nonnull Quota securityGroups) { + this.securityGroups = securityGroups; + } + + public QuotaList snapshots(@javax.annotation.Nonnull Quota snapshots) { + this.snapshots = snapshots; + return this; + } + + /** + * Number of snapshots. + * + * @return snapshots + */ + @javax.annotation.Nonnull + public Quota getSnapshots() { + return snapshots; + } + + public void setSnapshots(@javax.annotation.Nonnull Quota snapshots) { + this.snapshots = snapshots; + } + + public QuotaList vcpu(@javax.annotation.Nonnull Quota vcpu) { + this.vcpu = vcpu; + return this; + } + + /** + * Number of server cores. + * + * @return vcpu + */ + @javax.annotation.Nonnull + public Quota getVcpu() { + return vcpu; + } + + public void setVcpu(@javax.annotation.Nonnull Quota vcpu) { + this.vcpu = vcpu; + } + + public QuotaList volumes(@javax.annotation.Nonnull Quota volumes) { + this.volumes = volumes; + return this; + } + + /** + * Number of volumes. + * + * @return volumes + */ + @javax.annotation.Nonnull + public Quota getVolumes() { + return volumes; + } + + public void setVolumes(@javax.annotation.Nonnull Quota volumes) { + this.volumes = volumes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuotaList quotaList = (QuotaList) o; + return Objects.equals(this.backupGigabytes, quotaList.backupGigabytes) + && Objects.equals(this.backups, quotaList.backups) + && Objects.equals(this.gigabytes, quotaList.gigabytes) + && Objects.equals(this.networks, quotaList.networks) + && Objects.equals(this.nics, quotaList.nics) + && Objects.equals(this.publicIps, quotaList.publicIps) + && Objects.equals(this.ram, quotaList.ram) + && Objects.equals(this.securityGroupRules, quotaList.securityGroupRules) + && Objects.equals(this.securityGroups, quotaList.securityGroups) + && Objects.equals(this.snapshots, quotaList.snapshots) + && Objects.equals(this.vcpu, quotaList.vcpu) + && Objects.equals(this.volumes, quotaList.volumes); + } + + @Override + public int hashCode() { + return Objects.hash( + backupGigabytes, + backups, + gigabytes, + networks, + nics, + publicIps, + ram, + securityGroupRules, + securityGroups, + snapshots, + vcpu, + volumes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuotaList {\n"); + sb.append(" backupGigabytes: ").append(toIndentedString(backupGigabytes)).append("\n"); + sb.append(" backups: ").append(toIndentedString(backups)).append("\n"); + sb.append(" gigabytes: ").append(toIndentedString(gigabytes)).append("\n"); + sb.append(" networks: ").append(toIndentedString(networks)).append("\n"); + sb.append(" nics: ").append(toIndentedString(nics)).append("\n"); + sb.append(" publicIps: ").append(toIndentedString(publicIps)).append("\n"); + sb.append(" ram: ").append(toIndentedString(ram)).append("\n"); + sb.append(" securityGroupRules: ") + .append(toIndentedString(securityGroupRules)) + .append("\n"); + sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); + 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("}"); + 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( + "backupGigabytes", + "backups", + "gigabytes", + "networks", + "nics", + "publicIps", + "ram", + "securityGroupRules", + "securityGroups", + "snapshots", + "vcpu", + "volumes")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = + new HashSet( + Arrays.asList( + "backupGigabytes", + "backups", + "gigabytes", + "networks", + "nics", + "publicIps", + "ram", + "securityGroupRules", + "securityGroups", + "snapshots", + "vcpu", + "volumes")); + } + + /** + * 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 QuotaList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QuotaList.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `backupGigabytes` + Quota.validateJsonElement(jsonObj.get("backupGigabytes")); + // validate the required field `backups` + Quota.validateJsonElement(jsonObj.get("backups")); + // validate the required field `gigabytes` + Quota.validateJsonElement(jsonObj.get("gigabytes")); + // validate the required field `networks` + Quota.validateJsonElement(jsonObj.get("networks")); + // validate the required field `nics` + Quota.validateJsonElement(jsonObj.get("nics")); + // validate the required field `publicIps` + Quota.validateJsonElement(jsonObj.get("publicIps")); + // validate the required field `ram` + Quota.validateJsonElement(jsonObj.get("ram")); + // validate the required field `securityGroupRules` + Quota.validateJsonElement(jsonObj.get("securityGroupRules")); + // validate the required field `securityGroups` + Quota.validateJsonElement(jsonObj.get("securityGroups")); + // validate the required field `snapshots` + Quota.validateJsonElement(jsonObj.get("snapshots")); + // validate the required field `vcpu` + Quota.validateJsonElement(jsonObj.get("vcpu")); + // validate the required field `volumes` + Quota.validateJsonElement(jsonObj.get("volumes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuotaList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuotaList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(QuotaList.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, QuotaList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QuotaList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QuotaList given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuotaList + * @throws IOException if the JSON string is invalid with respect to QuotaList + */ + public static QuotaList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuotaList.class); + } + + /** + * Convert an instance of QuotaList 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/QuotaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaListResponse.java new file mode 100644 index 0000000..2c68b2a --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/QuotaListResponse.java @@ -0,0 +1,203 @@ +/* + * 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; + +/** Quotas list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class QuotaListResponse { + public static final String SERIALIZED_NAME_QUOTAS = "quotas"; + + @SerializedName(SERIALIZED_NAME_QUOTAS) + @javax.annotation.Nonnull + private QuotaList quotas; + + public QuotaListResponse() {} + + public QuotaListResponse quotas(@javax.annotation.Nonnull QuotaList quotas) { + this.quotas = quotas; + return this; + } + + /** + * Get quotas + * + * @return quotas + */ + @javax.annotation.Nonnull + public QuotaList getQuotas() { + return quotas; + } + + public void setQuotas(@javax.annotation.Nonnull QuotaList quotas) { + this.quotas = quotas; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuotaListResponse quotaListResponse = (QuotaListResponse) o; + return Objects.equals(this.quotas, quotaListResponse.quotas); + } + + @Override + public int hashCode() { + return Objects.hash(quotas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuotaListResponse {\n"); + sb.append(" quotas: ").append(toIndentedString(quotas)).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("quotas")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("quotas")); + } + + /** + * 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 QuotaListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QuotaListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `quotas` + QuotaList.validateJsonElement(jsonObj.get("quotas")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuotaListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuotaListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(QuotaListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, QuotaListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QuotaListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QuotaListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuotaListResponse + * @throws IOException if the JSON string is invalid with respect to QuotaListResponse + */ + public static QuotaListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuotaListResponse.class); + } + + /** + * Convert an instance of QuotaListResponse 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 new file mode 100644 index 0000000..da7590d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Request.java @@ -0,0 +1,410 @@ +/* + * 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; + +/** Object that represents a request. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class Request { + public static final String SERIALIZED_NAME_DETAILS = "details"; + + @SerializedName(SERIALIZED_NAME_DETAILS) + @javax.annotation.Nullable private String details; + + public static final String SERIALIZED_NAME_REQUEST_ACTION = "requestAction"; + + @SerializedName(SERIALIZED_NAME_REQUEST_ACTION) + @javax.annotation.Nonnull + private String requestAction; + + public static final String SERIALIZED_NAME_REQUEST_ID = "requestId"; + + @SerializedName(SERIALIZED_NAME_REQUEST_ID) + @javax.annotation.Nonnull + private String requestId; + + public static final String SERIALIZED_NAME_REQUEST_TYPE = "requestType"; + + @SerializedName(SERIALIZED_NAME_REQUEST_TYPE) + @javax.annotation.Nonnull + private String requestType; + + public static final String SERIALIZED_NAME_RESOURCES = "resources"; + + @SerializedName(SERIALIZED_NAME_RESOURCES) + @javax.annotation.Nonnull + private List resources = new ArrayList<>(); + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private String status; + + public Request() {} + + public Request details(@javax.annotation.Nullable String details) { + this.details = details; + return this; + } + + /** + * Get details + * + * @return details + */ + @javax.annotation.Nullable public String getDetails() { + return details; + } + + public void setDetails(@javax.annotation.Nullable String details) { + this.details = details; + } + + public Request requestAction(@javax.annotation.Nonnull String requestAction) { + this.requestAction = requestAction; + return this; + } + + /** + * Object that represents a resource action. Possible values: `CREATE`, + * `DELETE`, `UPDATE`. + * + * @return requestAction + */ + @javax.annotation.Nonnull + public String getRequestAction() { + return requestAction; + } + + public void setRequestAction(@javax.annotation.Nonnull String requestAction) { + this.requestAction = requestAction; + } + + public Request requestId(@javax.annotation.Nonnull String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Identifier (ID) representing a single API request. + * + * @return requestId + */ + @javax.annotation.Nonnull + public String getRequestId() { + return requestId; + } + + public void setRequestId(@javax.annotation.Nonnull String requestId) { + this.requestId = requestId; + } + + public Request requestType(@javax.annotation.Nonnull String requestType) { + this.requestType = requestType; + return this; + } + + /** + * Object that represents a resource type. Possible values: `BACKUP`, + * `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, + * `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, + * `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. + * + * @return requestType + */ + @javax.annotation.Nonnull + public String getRequestType() { + return requestType; + } + + public void setRequestType(@javax.annotation.Nonnull String requestType) { + this.requestType = requestType; + } + + public Request resources(@javax.annotation.Nonnull List resources) { + this.resources = resources; + return this; + } + + public Request addResourcesItem(RequestResource resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources + */ + @javax.annotation.Nonnull + public List getResources() { + return resources; + } + + public void setResources(@javax.annotation.Nonnull List resources) { + this.resources = resources; + } + + public Request status(@javax.annotation.Nonnull String status) { + this.status = status; + return this; + } + + /** + * The state of a resource object. Possible values: `CREATING`, `CREATED`, + * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, + * `UPDATING`. + * + * @return status + */ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Request request = (Request) o; + return Objects.equals(this.details, request.details) + && Objects.equals(this.requestAction, request.requestAction) + && Objects.equals(this.requestId, request.requestId) + && Objects.equals(this.requestType, request.requestType) + && Objects.equals(this.resources, request.resources) + && Objects.equals(this.status, request.status); + } + + @Override + public int hashCode() { + return Objects.hash(details, requestAction, requestId, requestType, resources, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Request {\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append(" requestAction: ").append(toIndentedString(requestAction)).append("\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + 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("}"); + 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( + "details", + "requestAction", + "requestId", + "requestType", + "resources", + "status")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = + new HashSet( + Arrays.asList( + "requestAction", + "requestId", + "requestType", + "resources", + "status")); + } + + /** + * 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 Request + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Request.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) + && !jsonObj.get("details").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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( + "Expected the field `requestType` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("requestType").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("resources").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resources` to be an array in the JSON string but got `%s`", + jsonObj.get("resources").toString())); + } + + JsonArray jsonArrayresources = jsonObj.getAsJsonArray("resources"); + // validate the required field `resources` (array) + for (int i = 0; i < jsonArrayresources.size(); i++) { + RequestResource.validateJsonElement(jsonArrayresources.get(i)); + } + ; + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Request.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Request read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of Request + * @throws IOException if the JSON string is invalid with respect to Request + */ + public static Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Request.class); + } + + /** + * Convert an instance of Request 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/RequestResource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RequestResource.java new file mode 100644 index 0000000..0e39005 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RequestResource.java @@ -0,0 +1,279 @@ +/* + * 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; +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.14.0") +public class RequestResource { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private UUID id; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private String status; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public RequestResource() {} + + public RequestResource 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 RequestResource status(@javax.annotation.Nonnull String status) { + this.status = status; + return this; + } + + /** + * The state of a resource object. Possible values: `CREATING`, `CREATED`, + * `DELETING`, `DELETED`, `FAILED`, `UPDATED`, + * `UPDATING`. + * + * @return status + */ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull String status) { + this.status = status; + } + + public RequestResource type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Object that represents a resource type. Possible values: `BACKUP`, + * `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, + * `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, + * `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestResource requestResource = (RequestResource) o; + return Objects.equals(this.id, requestResource.id) + && Objects.equals(this.status, requestResource.status) + && Objects.equals(this.type, requestResource.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestResource {\n"); + 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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "status", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "status", "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 RequestResource + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequestResource.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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 (!RequestResource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestResource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RequestResource.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RequestResource value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RequestResource read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RequestResource given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestResource + * @throws IOException if the JSON string is invalid with respect to RequestResource + */ + public static RequestResource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestResource.class); + } + + /** + * Convert an instance of RequestResource 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/RescueServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RescueServerPayload.java new file mode 100644 index 0000000..0cfa1ed --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RescueServerPayload.java @@ -0,0 +1,208 @@ +/* + * 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; +import java.util.UUID; + +/** RescueServerPayload */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class RescueServerPayload { + public static final String SERIALIZED_NAME_IMAGE = "image"; + + @SerializedName(SERIALIZED_NAME_IMAGE) + @javax.annotation.Nonnull + private UUID image; + + public RescueServerPayload() {} + + public RescueServerPayload image(@javax.annotation.Nonnull UUID image) { + this.image = image; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return image + */ + @javax.annotation.Nonnull + public UUID getImage() { + return image; + } + + public void setImage(@javax.annotation.Nonnull UUID image) { + this.image = image; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RescueServerPayload rescueServerPayload = (RescueServerPayload) o; + return Objects.equals(this.image, rescueServerPayload.image); + } + + @Override + public int hashCode() { + return Objects.hash(image); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RescueServerPayload {\n"); + sb.append(" image: ").append(toIndentedString(image)).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("image")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("image")); + } + + /** + * 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 RescueServerPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RescueServerPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("image").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `image` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("image").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RescueServerPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RescueServerPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RescueServerPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RescueServerPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RescueServerPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RescueServerPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of RescueServerPayload + * @throws IOException if the JSON string is invalid with respect to RescueServerPayload + */ + public static RescueServerPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RescueServerPayload.class); + } + + /** + * Convert an instance of RescueServerPayload 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/ResizeServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeServerPayload.java new file mode 100644 index 0000000..587ea9f --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeServerPayload.java @@ -0,0 +1,207 @@ +/* + * 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; + +/** ResizeServerPayload */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ResizeServerPayload { + public static final String SERIALIZED_NAME_MACHINE_TYPE = "machineType"; + + @SerializedName(SERIALIZED_NAME_MACHINE_TYPE) + @javax.annotation.Nonnull + private String machineType; + + public ResizeServerPayload() {} + + public ResizeServerPayload machineType(@javax.annotation.Nonnull String machineType) { + this.machineType = machineType; + return this; + } + + /** + * The name for a General Object. Matches Names and also UUIDs. + * + * @return machineType + */ + @javax.annotation.Nonnull + public String getMachineType() { + return machineType; + } + + public void setMachineType(@javax.annotation.Nonnull String machineType) { + this.machineType = machineType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResizeServerPayload resizeServerPayload = (ResizeServerPayload) o; + return Objects.equals(this.machineType, resizeServerPayload.machineType); + } + + @Override + public int hashCode() { + return Objects.hash(machineType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResizeServerPayload {\n"); + sb.append(" machineType: ").append(toIndentedString(machineType)).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("machineType")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("machineType")); + } + + /** + * 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 ResizeServerPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResizeServerPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("machineType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `machineType` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("machineType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ResizeServerPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResizeServerPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ResizeServerPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ResizeServerPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ResizeServerPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ResizeServerPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResizeServerPayload + * @throws IOException if the JSON string is invalid with respect to ResizeServerPayload + */ + public static ResizeServerPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResizeServerPayload.class); + } + + /** + * Convert an instance of ResizeServerPayload 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/ResizeVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeVolumePayload.java new file mode 100644 index 0000000..8c4261c --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ResizeVolumePayload.java @@ -0,0 +1,201 @@ +/* + * 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; + +/** ResizeVolumePayload */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ResizeVolumePayload { + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nonnull + private Long size; + + public ResizeVolumePayload() {} + + public ResizeVolumePayload size(@javax.annotation.Nonnull Long size) { + this.size = size; + return this; + } + + /** + * Size in Gigabyte. + * + * @return size + */ + @javax.annotation.Nonnull + public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nonnull Long size) { + this.size = size; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResizeVolumePayload resizeVolumePayload = (ResizeVolumePayload) o; + return Objects.equals(this.size, resizeVolumePayload.size); + } + + @Override + public int hashCode() { + return Objects.hash(size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResizeVolumePayload {\n"); + sb.append(" size: ").append(toIndentedString(size)).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("size")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("size")); + } + + /** + * 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 ResizeVolumePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResizeVolumePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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 (!ResizeVolumePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResizeVolumePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ResizeVolumePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ResizeVolumePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ResizeVolumePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ResizeVolumePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResizeVolumePayload + * @throws IOException if the JSON string is invalid with respect to ResizeVolumePayload + */ + public static ResizeVolumePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResizeVolumePayload.class); + } + + /** + * Convert an instance of ResizeVolumePayload 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/Route.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Route.java new file mode 100644 index 0000000..63c8a8d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Route.java @@ -0,0 +1,339 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.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_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_NEXTHOP = "nexthop"; + + @SerializedName(SERIALIZED_NAME_NEXTHOP) + @javax.annotation.Nonnull + private 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; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public Route() {} + + public Route(OffsetDateTime createdAt, UUID routeId, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.routeId = routeId; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public Route labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public Route nexthop(@javax.annotation.Nonnull String nexthop) { + this.nexthop = nexthop; + return this; + } + + /** + * Object that represents an IP address. + * + * @return nexthop + */ + @javax.annotation.Nonnull + public String getNexthop() { + return nexthop; + } + + public void setNexthop(@javax.annotation.Nonnull String nexthop) { + this.nexthop = nexthop; + } + + public Route prefix(@javax.annotation.Nonnull String prefix) { + this.prefix = prefix; + return this; + } + + /** + * 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; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return routeId + */ + @javax.annotation.Nullable public UUID getRouteId() { + return routeId; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Route route = (Route) o; + return Objects.equals(this.createdAt, route.createdAt) + && 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); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, labels, nexthop, prefix, routeId, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Route {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).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("}"); + 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", + "labels", + "nexthop", + "prefix", + "routeId", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("nexthop", "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 Route + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Route.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + 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()) { + 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Route.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Route' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Route.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Route value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Route read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Route given an JSON string + * + * @param jsonString JSON string + * @return An instance of Route + * @throws IOException if the JSON string is invalid with respect to Route + */ + public static Route fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Route.class); + } + + /** + * Convert an instance of Route 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 new file mode 100644 index 0000000..12e36bf --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/RouteListResponse.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Route list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class RouteListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public RouteListResponse() {} + + public RouteListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public RouteListResponse 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RouteListResponse routeListResponse = (RouteListResponse) o; + return Objects.equals(this.items, routeListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RouteListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 RouteListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RouteListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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 (!RouteListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RouteListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RouteListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RouteListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RouteListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RouteListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RouteListResponse + * @throws IOException if the JSON string is invalid with respect to RouteListResponse + */ + public static RouteListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RouteListResponse.class); + } + + /** + * Convert an instance of RouteListResponse 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 new file mode 100644 index 0000000..93e01de --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroup.java @@ -0,0 +1,407 @@ +/* + * 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.time.OffsetDateTime; +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 java.util.UUID; + +/** Object that represents a security group. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class SecurityGroup { + 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) + @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_RULES = "rules"; + + @SerializedName(SERIALIZED_NAME_RULES) + @javax.annotation.Nullable private List rules; + + public static final String SERIALIZED_NAME_STATEFUL = "stateful"; + + @SerializedName(SERIALIZED_NAME_STATEFUL) + @javax.annotation.Nullable private Boolean stateful = true; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public SecurityGroup() {} + + public SecurityGroup( + OffsetDateTime createdAt, + UUID id, + List rules, + OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.id = id; + this.rules = rules; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public SecurityGroup 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). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public SecurityGroup labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public SecurityGroup 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 list containing security group rule objects. + * + * @return rules + */ + @javax.annotation.Nullable public List getRules() { + return rules; + } + + public SecurityGroup stateful(@javax.annotation.Nullable Boolean stateful) { + this.stateful = stateful; + return this; + } + + /** + * Shows if a security group is stateful or stateless. You can only have one type of security + * groups per network interface/server. + * + * @return stateful + */ + @javax.annotation.Nullable public Boolean getStateful() { + return stateful; + } + + public void setStateful(@javax.annotation.Nullable Boolean stateful) { + this.stateful = stateful; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityGroup securityGroup = (SecurityGroup) o; + return Objects.equals(this.createdAt, securityGroup.createdAt) + && Objects.equals(this.description, securityGroup.description) + && Objects.equals(this.id, securityGroup.id) + && Objects.equals(this.labels, securityGroup.labels) + && Objects.equals(this.name, securityGroup.name) + && Objects.equals(this.rules, securityGroup.rules) + && Objects.equals(this.stateful, securityGroup.stateful) + && Objects.equals(this.updatedAt, securityGroup.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, description, id, labels, name, rules, stateful, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityGroup {\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"); + 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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = + new HashSet( + Arrays.asList( + "createdAt", + "description", + "id", + "labels", + "name", + "rules", + "stateful", + "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 SecurityGroup + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecurityGroup.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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( + "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( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if (jsonObj.get("rules") != null && !jsonObj.get("rules").isJsonNull()) { + JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); + if (jsonArrayrules != null) { + // ensure the json data is an array + if (!jsonObj.get("rules").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rules` to be an array in the JSON string but got `%s`", + jsonObj.get("rules").toString())); + } + + // validate the optional field `rules` (array) + for (int i = 0; i < jsonArrayrules.size(); i++) { + SecurityGroupRule.validateJsonElement(jsonArrayrules.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SecurityGroup.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecurityGroup' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SecurityGroup.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SecurityGroup value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SecurityGroup read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SecurityGroup given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecurityGroup + * @throws IOException if the JSON string is invalid with respect to SecurityGroup + */ + public static SecurityGroup fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecurityGroup.class); + } + + /** + * Convert an instance of SecurityGroup 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/SecurityGroupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupListResponse.java new file mode 100644 index 0000000..a47e4ce --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupListResponse.java @@ -0,0 +1,227 @@ +/* + * 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; + +/** Security group list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class SecurityGroupListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public SecurityGroupListResponse() {} + + public SecurityGroupListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public SecurityGroupListResponse addItemsItem(SecurityGroup itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list containing security group objects. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityGroupListResponse securityGroupListResponse = (SecurityGroupListResponse) o; + return Objects.equals(this.items, securityGroupListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityGroupListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 SecurityGroupListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecurityGroupListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + SecurityGroup.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SecurityGroupListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecurityGroupListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SecurityGroupListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SecurityGroupListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SecurityGroupListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SecurityGroupListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecurityGroupListResponse + * @throws IOException if the JSON string is invalid with respect to SecurityGroupListResponse + */ + public static SecurityGroupListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecurityGroupListResponse.class); + } + + /** + * Convert an instance of SecurityGroupListResponse 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/SecurityGroupRule.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRule.java new file mode 100644 index 0000000..57b639d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRule.java @@ -0,0 +1,505 @@ +/* + * 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; +import java.util.UUID; + +/** Object that represents a security group rule. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class SecurityGroupRule { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + + public static final String SERIALIZED_NAME_DIRECTION = "direction"; + + @SerializedName(SERIALIZED_NAME_DIRECTION) + @javax.annotation.Nonnull + private String direction; + + public static final String SERIALIZED_NAME_ETHERTYPE = "ethertype"; + + @SerializedName(SERIALIZED_NAME_ETHERTYPE) + @javax.annotation.Nullable private String ethertype = "IPv4"; + + public static final String SERIALIZED_NAME_ICMP_PARAMETERS = "icmpParameters"; + + @SerializedName(SERIALIZED_NAME_ICMP_PARAMETERS) + @javax.annotation.Nullable private ICMPParameters icmpParameters; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IP_RANGE = "ipRange"; + + @SerializedName(SERIALIZED_NAME_IP_RANGE) + @javax.annotation.Nullable private String ipRange; + + public static final String SERIALIZED_NAME_PORT_RANGE = "portRange"; + + @SerializedName(SERIALIZED_NAME_PORT_RANGE) + @javax.annotation.Nullable private PortRange portRange; + + public static final String SERIALIZED_NAME_REMOTE_SECURITY_GROUP_ID = "remoteSecurityGroupId"; + + @SerializedName(SERIALIZED_NAME_REMOTE_SECURITY_GROUP_ID) + @javax.annotation.Nullable private UUID remoteSecurityGroupId; + + public static final String SERIALIZED_NAME_SECURITY_GROUP_ID = "securityGroupId"; + + @SerializedName(SERIALIZED_NAME_SECURITY_GROUP_ID) + @javax.annotation.Nullable private UUID securityGroupId; + + public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; + + @SerializedName(SERIALIZED_NAME_PROTOCOL) + @javax.annotation.Nullable private Protocol protocol; + + public SecurityGroupRule() {} + + public SecurityGroupRule(UUID id, UUID securityGroupId) { + this(); + this.id = id; + this.securityGroupId = securityGroupId; + } + + public SecurityGroupRule 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 SecurityGroupRule direction(@javax.annotation.Nonnull String direction) { + this.direction = direction; + return this; + } + + /** + * The direction of the traffic which the rule should match. Possible values: + * `ingress`, `egress`. + * + * @return direction + */ + @javax.annotation.Nonnull + public String getDirection() { + return direction; + } + + public void setDirection(@javax.annotation.Nonnull String direction) { + this.direction = direction; + } + + public SecurityGroupRule ethertype(@javax.annotation.Nullable String ethertype) { + this.ethertype = ethertype; + return this; + } + + /** + * The ethertype which the rule should match. Possible values: `IPv4`, + * `IPv6`. + * + * @return ethertype + */ + @javax.annotation.Nullable public String getEthertype() { + return ethertype; + } + + public void setEthertype(@javax.annotation.Nullable String ethertype) { + this.ethertype = ethertype; + } + + public SecurityGroupRule icmpParameters( + @javax.annotation.Nullable ICMPParameters icmpParameters) { + this.icmpParameters = icmpParameters; + return this; + } + + /** + * Get icmpParameters + * + * @return icmpParameters + */ + @javax.annotation.Nullable public ICMPParameters getIcmpParameters() { + return icmpParameters; + } + + public void setIcmpParameters(@javax.annotation.Nullable ICMPParameters icmpParameters) { + this.icmpParameters = icmpParameters; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public SecurityGroupRule ipRange(@javax.annotation.Nullable String ipRange) { + this.ipRange = ipRange; + return this; + } + + /** + * The remote IP range which the rule should match. + * + * @return ipRange + */ + @javax.annotation.Nullable public String getIpRange() { + return ipRange; + } + + public void setIpRange(@javax.annotation.Nullable String ipRange) { + this.ipRange = ipRange; + } + + public SecurityGroupRule portRange(@javax.annotation.Nullable PortRange portRange) { + this.portRange = portRange; + return this; + } + + /** + * Get portRange + * + * @return portRange + */ + @javax.annotation.Nullable public PortRange getPortRange() { + return portRange; + } + + public void setPortRange(@javax.annotation.Nullable PortRange portRange) { + this.portRange = portRange; + } + + public SecurityGroupRule remoteSecurityGroupId( + @javax.annotation.Nullable UUID remoteSecurityGroupId) { + this.remoteSecurityGroupId = remoteSecurityGroupId; + return this; + } + + /** + * The remote security group which the rule should match. + * + * @return remoteSecurityGroupId + */ + @javax.annotation.Nullable public UUID getRemoteSecurityGroupId() { + return remoteSecurityGroupId; + } + + public void setRemoteSecurityGroupId(@javax.annotation.Nullable UUID remoteSecurityGroupId) { + this.remoteSecurityGroupId = remoteSecurityGroupId; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return securityGroupId + */ + @javax.annotation.Nullable public UUID getSecurityGroupId() { + return securityGroupId; + } + + public SecurityGroupRule protocol(@javax.annotation.Nullable Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * + * @return protocol + */ + @javax.annotation.Nullable public Protocol getProtocol() { + return protocol; + } + + public void setProtocol(@javax.annotation.Nullable Protocol protocol) { + this.protocol = protocol; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityGroupRule securityGroupRule = (SecurityGroupRule) o; + return Objects.equals(this.description, securityGroupRule.description) + && Objects.equals(this.direction, securityGroupRule.direction) + && Objects.equals(this.ethertype, securityGroupRule.ethertype) + && Objects.equals(this.icmpParameters, securityGroupRule.icmpParameters) + && Objects.equals(this.id, securityGroupRule.id) + && Objects.equals(this.ipRange, securityGroupRule.ipRange) + && Objects.equals(this.portRange, securityGroupRule.portRange) + && Objects.equals( + this.remoteSecurityGroupId, securityGroupRule.remoteSecurityGroupId) + && Objects.equals(this.securityGroupId, securityGroupRule.securityGroupId) + && Objects.equals(this.protocol, securityGroupRule.protocol); + } + + @Override + public int hashCode() { + return Objects.hash( + description, + direction, + ethertype, + icmpParameters, + id, + ipRange, + portRange, + remoteSecurityGroupId, + securityGroupId, + protocol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityGroupRule {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); + sb.append(" ethertype: ").append(toIndentedString(ethertype)).append("\n"); + sb.append(" icmpParameters: ").append(toIndentedString(icmpParameters)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ipRange: ").append(toIndentedString(ipRange)).append("\n"); + sb.append(" portRange: ").append(toIndentedString(portRange)).append("\n"); + sb.append(" remoteSecurityGroupId: ") + .append(toIndentedString(remoteSecurityGroupId)) + .append("\n"); + sb.append(" securityGroupId: ").append(toIndentedString(securityGroupId)).append("\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).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", + "direction", + "ethertype", + "icmpParameters", + "id", + "ipRange", + "portRange", + "remoteSecurityGroupId", + "securityGroupId", + "protocol")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("direction")); + } + + /** + * 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 SecurityGroupRule + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecurityGroupRule.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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( + "Expected the field `direction` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("direction").toString())); + } + if ((jsonObj.get("ethertype") != null && !jsonObj.get("ethertype").isJsonNull()) + && !jsonObj.get("ethertype").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ethertype` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ethertype").toString())); + } + // validate the optional field `icmpParameters` + if (jsonObj.get("icmpParameters") != null && !jsonObj.get("icmpParameters").isJsonNull()) { + ICMPParameters.validateJsonElement(jsonObj.get("icmpParameters")); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("ipRange") != null && !jsonObj.get("ipRange").isJsonNull()) + && !jsonObj.get("ipRange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ipRange` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ipRange").toString())); + } + // validate the optional field `portRange` + if (jsonObj.get("portRange") != null && !jsonObj.get("portRange").isJsonNull()) { + PortRange.validateJsonElement(jsonObj.get("portRange")); + } + if ((jsonObj.get("remoteSecurityGroupId") != null + && !jsonObj.get("remoteSecurityGroupId").isJsonNull()) + && !jsonObj.get("remoteSecurityGroupId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `remoteSecurityGroupId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("remoteSecurityGroupId").toString())); + } + if ((jsonObj.get("securityGroupId") != null && !jsonObj.get("securityGroupId").isJsonNull()) + && !jsonObj.get("securityGroupId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `securityGroupId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("securityGroupId").toString())); + } + // validate the optional field `protocol` + if (jsonObj.get("protocol") != null && !jsonObj.get("protocol").isJsonNull()) { + Protocol.validateJsonElement(jsonObj.get("protocol")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SecurityGroupRule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecurityGroupRule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SecurityGroupRule.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SecurityGroupRule value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SecurityGroupRule read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SecurityGroupRule given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecurityGroupRule + * @throws IOException if the JSON string is invalid with respect to SecurityGroupRule + */ + public static SecurityGroupRule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecurityGroupRule.class); + } + + /** + * Convert an instance of SecurityGroupRule 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/SecurityGroupRuleListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleListResponse.java new file mode 100644 index 0000000..0416247 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleListResponse.java @@ -0,0 +1,233 @@ +/* + * 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; + +/** Security group rule list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class SecurityGroupRuleListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public SecurityGroupRuleListResponse() {} + + public SecurityGroupRuleListResponse items( + @javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public SecurityGroupRuleListResponse addItemsItem(SecurityGroupRule itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list containing security group rule objects. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityGroupRuleListResponse securityGroupRuleListResponse = + (SecurityGroupRuleListResponse) o; + return Objects.equals(this.items, securityGroupRuleListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityGroupRuleListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 + * SecurityGroupRuleListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecurityGroupRuleListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + SecurityGroupRule.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SecurityGroupRuleListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecurityGroupRuleListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(SecurityGroupRuleListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SecurityGroupRuleListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SecurityGroupRuleListResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SecurityGroupRuleListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecurityGroupRuleListResponse + * @throws IOException if the JSON string is invalid with respect to + * SecurityGroupRuleListResponse + */ + public static SecurityGroupRuleListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecurityGroupRuleListResponse.class); + } + + /** + * Convert an instance of SecurityGroupRuleListResponse 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/SecurityGroupRuleProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleProtocol.java new file mode 100644 index 0000000..74f470b --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SecurityGroupRuleProtocol.java @@ -0,0 +1,194 @@ +/* + * 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 internet protocol which the rule matches. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class SecurityGroupRuleProtocol { + public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; + + @SerializedName(SERIALIZED_NAME_PROTOCOL) + @javax.annotation.Nullable private Protocol protocol; + + public SecurityGroupRuleProtocol() {} + + public SecurityGroupRuleProtocol protocol(@javax.annotation.Nullable Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * + * @return protocol + */ + @javax.annotation.Nullable public Protocol getProtocol() { + return protocol; + } + + public void setProtocol(@javax.annotation.Nullable Protocol protocol) { + this.protocol = protocol; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityGroupRuleProtocol securityGroupRuleProtocol = (SecurityGroupRuleProtocol) o; + return Objects.equals(this.protocol, securityGroupRuleProtocol.protocol); + } + + @Override + public int hashCode() { + return Objects.hash(protocol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityGroupRuleProtocol {\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).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("protocol")); + + // 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 SecurityGroupRuleProtocol + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecurityGroupRuleProtocol.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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()) { + Protocol.validateJsonElement(jsonObj.get("protocol")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SecurityGroupRuleProtocol.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecurityGroupRuleProtocol' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SecurityGroupRuleProtocol.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SecurityGroupRuleProtocol value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SecurityGroupRuleProtocol read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SecurityGroupRuleProtocol given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecurityGroupRuleProtocol + * @throws IOException if the JSON string is invalid with respect to SecurityGroupRuleProtocol + */ + public static SecurityGroupRuleProtocol fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecurityGroupRuleProtocol.class); + } + + /** + * Convert an instance of SecurityGroupRuleProtocol 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/Server.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Server.java new file mode 100644 index 0000000..df9183d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Server.java @@ -0,0 +1,919 @@ +/* + * 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.time.OffsetDateTime; +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 java.util.UUID; + +/** Representation of a single server object. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class Server { + public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; + + @SerializedName(SERIALIZED_NAME_AFFINITY_GROUP) + @javax.annotation.Nullable private UUID affinityGroup; + + public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; + + @SerializedName(SERIALIZED_NAME_AVAILABILITY_ZONE) + @javax.annotation.Nullable private String availabilityZone; + + public static final String SERIALIZED_NAME_BOOT_VOLUME = "bootVolume"; + + @SerializedName(SERIALIZED_NAME_BOOT_VOLUME) + @javax.annotation.Nullable private BootVolume bootVolume; + + 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_ERROR_MESSAGE = "errorMessage"; + + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + @javax.annotation.Nullable private String errorMessage; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IMAGE_ID = "imageId"; + + @SerializedName(SERIALIZED_NAME_IMAGE_ID) + @javax.annotation.Nullable private UUID imageId; + + public static final String SERIALIZED_NAME_KEYPAIR_NAME = "keypairName"; + + @SerializedName(SERIALIZED_NAME_KEYPAIR_NAME) + @javax.annotation.Nullable private String keypairName; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_LAUNCHED_AT = "launchedAt"; + + @SerializedName(SERIALIZED_NAME_LAUNCHED_AT) + @javax.annotation.Nullable private OffsetDateTime launchedAt; + + public static final String SERIALIZED_NAME_MACHINE_TYPE = "machineType"; + + @SerializedName(SERIALIZED_NAME_MACHINE_TYPE) + @javax.annotation.Nonnull + private String machineType; + + public static final String SERIALIZED_NAME_MAINTENANCE_WINDOW = "maintenanceWindow"; + + @SerializedName(SERIALIZED_NAME_MAINTENANCE_WINDOW) + @javax.annotation.Nullable private ServerMaintenance maintenanceWindow; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable private Object metadata; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_NETWORKING = "networking"; + + @SerializedName(SERIALIZED_NAME_NETWORKING) + @javax.annotation.Nullable private CreateServerPayloadNetworking networking; + + public static final String SERIALIZED_NAME_NICS = "nics"; + + @SerializedName(SERIALIZED_NAME_NICS) + @javax.annotation.Nullable private List nics; + + public static final String SERIALIZED_NAME_POWER_STATUS = "powerStatus"; + + @SerializedName(SERIALIZED_NAME_POWER_STATUS) + @javax.annotation.Nullable private String powerStatus; + + public static final String SERIALIZED_NAME_SECURITY_GROUPS = "securityGroups"; + + @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) + @javax.annotation.Nullable private List securityGroups; + + public static final String SERIALIZED_NAME_SERVICE_ACCOUNT_MAILS = "serviceAccountMails"; + + @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT_MAILS) + @javax.annotation.Nullable private List serviceAccountMails; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_USER_DATA = "userData"; + + @SerializedName(SERIALIZED_NAME_USER_DATA) + @javax.annotation.Nullable private byte[] userData; + + public static final String SERIALIZED_NAME_VOLUMES = "volumes"; + + @SerializedName(SERIALIZED_NAME_VOLUMES) + @javax.annotation.Nullable private List volumes; + + public Server() {} + + public Server( + OffsetDateTime createdAt, + String errorMessage, + UUID id, + OffsetDateTime launchedAt, + ServerMaintenance maintenanceWindow, + List nics, + String powerStatus, + String status, + OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.errorMessage = errorMessage; + this.id = id; + this.launchedAt = launchedAt; + this.maintenanceWindow = maintenanceWindow; + this.nics = nics; + this.powerStatus = powerStatus; + this.status = status; + this.updatedAt = updatedAt; + } + + public Server affinityGroup(@javax.annotation.Nullable UUID affinityGroup) { + this.affinityGroup = affinityGroup; + return this; + } + + /** + * The affinity group the server is assigned to. + * + * @return affinityGroup + */ + @javax.annotation.Nullable public UUID getAffinityGroup() { + return affinityGroup; + } + + public void setAffinityGroup(@javax.annotation.Nullable UUID affinityGroup) { + this.affinityGroup = affinityGroup; + } + + public Server availabilityZone(@javax.annotation.Nullable String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * This is the availability zone requested during server creation. If none is provided during + * the creation request and an existing volume will be used as boot volume it will be set to the + * same availability zone as the volume. For requests with no volumes involved it will be set to + * the metro availability zone. + * + * @return availabilityZone + */ + @javax.annotation.Nullable public String getAvailabilityZone() { + return availabilityZone; + } + + public void setAvailabilityZone(@javax.annotation.Nullable String availabilityZone) { + this.availabilityZone = availabilityZone; + } + + public Server bootVolume(@javax.annotation.Nullable BootVolume bootVolume) { + this.bootVolume = bootVolume; + return this; + } + + /** + * Get bootVolume + * + * @return bootVolume + */ + @javax.annotation.Nullable public BootVolume getBootVolume() { + return bootVolume; + } + + public void setBootVolume(@javax.annotation.Nullable BootVolume bootVolume) { + this.bootVolume = bootVolume; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * An error message. + * + * @return errorMessage + */ + @javax.annotation.Nullable public String getErrorMessage() { + return errorMessage; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public Server imageId(@javax.annotation.Nullable UUID imageId) { + this.imageId = imageId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return imageId + */ + @javax.annotation.Nullable public UUID getImageId() { + return imageId; + } + + public void setImageId(@javax.annotation.Nullable UUID imageId) { + this.imageId = imageId; + } + + public Server keypairName(@javax.annotation.Nullable String keypairName) { + this.keypairName = keypairName; + return this; + } + + /** + * The SSH keypair used during the server creation. + * + * @return keypairName + */ + @javax.annotation.Nullable public String getKeypairName() { + return keypairName; + } + + public void setKeypairName(@javax.annotation.Nullable String keypairName) { + this.keypairName = keypairName; + } + + public Server labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + /** + * Date-time when resource was launched. + * + * @return launchedAt + */ + @javax.annotation.Nullable public OffsetDateTime getLaunchedAt() { + return launchedAt; + } + + public Server machineType(@javax.annotation.Nonnull String machineType) { + this.machineType = machineType; + return this; + } + + /** + * Name of the machine type the server shall belong to. + * + * @return machineType + */ + @javax.annotation.Nonnull + public String getMachineType() { + return machineType; + } + + public void setMachineType(@javax.annotation.Nonnull String machineType) { + this.machineType = machineType; + } + + /** + * Get maintenanceWindow + * + * @return maintenanceWindow + */ + @javax.annotation.Nullable public ServerMaintenance getMaintenanceWindow() { + return maintenanceWindow; + } + + public Server metadata(@javax.annotation.Nullable Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. + * ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value + * for a key will remove that key. + * + * @return metadata + */ + @javax.annotation.Nullable public Object getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Object metadata) { + this.metadata = metadata; + } + + public Server name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name for a Server. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + public Server networking(@javax.annotation.Nullable CreateServerPayloadNetworking networking) { + this.networking = networking; + return this; + } + + /** + * Get networking + * + * @return networking + */ + @javax.annotation.Nullable public CreateServerPayloadNetworking getNetworking() { + return networking; + } + + public void setNetworking(@javax.annotation.Nullable CreateServerPayloadNetworking networking) { + this.networking = networking; + } + + /** + * The list of network interfaces (NICs) attached to the server. Only shown when detailed + * information is requested. + * + * @return nics + */ + @javax.annotation.Nullable public List getNics() { + return nics; + } + + /** + * The power status of a server. Possible values: `CRASHED`, `ERROR`, + * `RUNNING`, `STOPPED`. + * + * @return powerStatus + */ + @javax.annotation.Nullable public String getPowerStatus() { + return powerStatus; + } + + public Server securityGroups(@javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + public Server addSecurityGroupsItem(String securityGroupsItem) { + if (this.securityGroups == null) { + this.securityGroups = new ArrayList<>(); + } + this.securityGroups.add(securityGroupsItem); + return this; + } + + /** + * The initial security groups for the server creation. + * + * @return securityGroups + */ + @javax.annotation.Nullable public List getSecurityGroups() { + return securityGroups; + } + + public void setSecurityGroups(@javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + } + + public Server serviceAccountMails(@javax.annotation.Nullable List serviceAccountMails) { + this.serviceAccountMails = serviceAccountMails; + return this; + } + + public Server addServiceAccountMailsItem(String serviceAccountMailsItem) { + if (this.serviceAccountMails == null) { + this.serviceAccountMails = new ArrayList<>(); + } + this.serviceAccountMails.add(serviceAccountMailsItem); + return this; + } + + /** + * A list of service account mails. Only shown when detailed information is requested. + * + * @return serviceAccountMails + */ + @javax.annotation.Nullable public List getServiceAccountMails() { + return serviceAccountMails; + } + + public void setServiceAccountMails( + @javax.annotation.Nullable List serviceAccountMails) { + this.serviceAccountMails = serviceAccountMails; + } + + /** + * The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, + * `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, + * `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, + * `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, + * `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, + * `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, + * `UNRESCUING`, `UPDATING`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public Server userData(@javax.annotation.Nullable byte[] userData) { + this.userData = userData; + return this; + } + + /** + * User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init + * to the server. Only shown when detailed information is requested. + * + * @return userData + */ + @javax.annotation.Nullable public byte[] getUserData() { + return userData; + } + + public void setUserData(@javax.annotation.Nullable byte[] userData) { + this.userData = userData; + } + + public Server volumes(@javax.annotation.Nullable List volumes) { + this.volumes = volumes; + return this; + } + + public Server addVolumesItem(UUID volumesItem) { + if (this.volumes == null) { + this.volumes = new ArrayList<>(); + } + this.volumes.add(volumesItem); + return this; + } + + /** + * The list of volumes attached to the server. + * + * @return volumes + */ + @javax.annotation.Nullable public List getVolumes() { + return volumes; + } + + public void setVolumes(@javax.annotation.Nullable List volumes) { + this.volumes = volumes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Server server = (Server) o; + return Objects.equals(this.affinityGroup, server.affinityGroup) + && Objects.equals(this.availabilityZone, server.availabilityZone) + && Objects.equals(this.bootVolume, server.bootVolume) + && Objects.equals(this.createdAt, server.createdAt) + && Objects.equals(this.errorMessage, server.errorMessage) + && Objects.equals(this.id, server.id) + && Objects.equals(this.imageId, server.imageId) + && Objects.equals(this.keypairName, server.keypairName) + && Objects.equals(this.labels, server.labels) + && Objects.equals(this.launchedAt, server.launchedAt) + && Objects.equals(this.machineType, server.machineType) + && Objects.equals(this.maintenanceWindow, server.maintenanceWindow) + && Objects.equals(this.metadata, server.metadata) + && Objects.equals(this.name, server.name) + && Objects.equals(this.networking, server.networking) + && Objects.equals(this.nics, server.nics) + && Objects.equals(this.powerStatus, server.powerStatus) + && Objects.equals(this.securityGroups, server.securityGroups) + && Objects.equals(this.serviceAccountMails, server.serviceAccountMails) + && Objects.equals(this.status, server.status) + && Objects.equals(this.updatedAt, server.updatedAt) + && Arrays.equals(this.userData, server.userData) + && Objects.equals(this.volumes, server.volumes); + } + + @Override + public int hashCode() { + return Objects.hash( + affinityGroup, + availabilityZone, + bootVolume, + createdAt, + errorMessage, + id, + imageId, + keypairName, + labels, + launchedAt, + machineType, + maintenanceWindow, + metadata, + name, + networking, + nics, + powerStatus, + securityGroups, + serviceAccountMails, + status, + updatedAt, + Arrays.hashCode(userData), + volumes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Server {\n"); + sb.append(" affinityGroup: ").append(toIndentedString(affinityGroup)).append("\n"); + sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); + sb.append(" bootVolume: ").append(toIndentedString(bootVolume)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" imageId: ").append(toIndentedString(imageId)).append("\n"); + sb.append(" keypairName: ").append(toIndentedString(keypairName)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" launchedAt: ").append(toIndentedString(launchedAt)).append("\n"); + sb.append(" machineType: ").append(toIndentedString(machineType)).append("\n"); + sb.append(" maintenanceWindow: ") + .append(toIndentedString(maintenanceWindow)) + .append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" networking: ").append(toIndentedString(networking)).append("\n"); + sb.append(" nics: ").append(toIndentedString(nics)).append("\n"); + sb.append(" powerStatus: ").append(toIndentedString(powerStatus)).append("\n"); + sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); + sb.append(" serviceAccountMails: ") + .append(toIndentedString(serviceAccountMails)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + 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("}"); + 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( + "affinityGroup", + "availabilityZone", + "bootVolume", + "createdAt", + "errorMessage", + "id", + "imageId", + "keypairName", + "labels", + "launchedAt", + "machineType", + "maintenanceWindow", + "metadata", + "name", + "networking", + "nics", + "powerStatus", + "securityGroups", + "serviceAccountMails", + "status", + "updatedAt", + "userData", + "volumes")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("machineType", "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 Server + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Server.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("affinityGroup") != null && !jsonObj.get("affinityGroup").isJsonNull()) + && !jsonObj.get("affinityGroup").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `affinityGroup` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("affinityGroup").toString())); + } + if ((jsonObj.get("availabilityZone") != null + && !jsonObj.get("availabilityZone").isJsonNull()) + && !jsonObj.get("availabilityZone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `availabilityZone` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("availabilityZone").toString())); + } + // validate the optional field `bootVolume` + if (jsonObj.get("bootVolume") != null && !jsonObj.get("bootVolume").isJsonNull()) { + BootVolume.validateJsonElement(jsonObj.get("bootVolume")); + } + if ((jsonObj.get("errorMessage") != null && !jsonObj.get("errorMessage").isJsonNull()) + && !jsonObj.get("errorMessage").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errorMessage` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("errorMessage").toString())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("imageId") != null && !jsonObj.get("imageId").isJsonNull()) + && !jsonObj.get("imageId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `imageId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("imageId").toString())); + } + if ((jsonObj.get("keypairName") != null && !jsonObj.get("keypairName").isJsonNull()) + && !jsonObj.get("keypairName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `machineType` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("machineType").toString())); + } + // validate the optional field `maintenanceWindow` + if (jsonObj.get("maintenanceWindow") != null + && !jsonObj.get("maintenanceWindow").isJsonNull()) { + ServerMaintenance.validateJsonElement(jsonObj.get("maintenanceWindow")); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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")); + } + if (jsonObj.get("nics") != null && !jsonObj.get("nics").isJsonNull()) { + JsonArray jsonArraynics = jsonObj.getAsJsonArray("nics"); + if (jsonArraynics != null) { + // ensure the json data is an array + if (!jsonObj.get("nics").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `nics` to be an array in the JSON string but got `%s`", + jsonObj.get("nics").toString())); + } + + // validate the optional field `nics` (array) + for (int i = 0; i < jsonArraynics.size(); i++) { + ServerNetwork.validateJsonElement(jsonArraynics.get(i)); + } + ; + } + } + if ((jsonObj.get("powerStatus") != null && !jsonObj.get("powerStatus").isJsonNull()) + && !jsonObj.get("powerStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `powerStatus` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("powerStatus").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("securityGroups") != null + && !jsonObj.get("securityGroups").isJsonNull() + && !jsonObj.get("securityGroups").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", + jsonObj.get("securityGroups").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("serviceAccountMails") != null + && !jsonObj.get("serviceAccountMails").isJsonNull() + && !jsonObj.get("serviceAccountMails").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `serviceAccountMails` to be an array in the JSON string but got `%s`", + jsonObj.get("serviceAccountMails").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("status").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("volumes") != null + && !jsonObj.get("volumes").isJsonNull() + && !jsonObj.get("volumes").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `volumes` to be an array in the JSON string but got `%s`", + jsonObj.get("volumes").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Server.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Server' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Server.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Server value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Server read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Server given an JSON string + * + * @param jsonString JSON string + * @return An instance of Server + * @throws IOException if the JSON string is invalid with respect to Server + */ + public static Server fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Server.class); + } + + /** + * Convert an instance of Server 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/ServerConsoleUrl.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerConsoleUrl.java new file mode 100644 index 0000000..f1d67e9 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerConsoleUrl.java @@ -0,0 +1,207 @@ +/* + * 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; + +/** Object that represents a server console URL. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ServerConsoleUrl { + public static final String SERIALIZED_NAME_URL = "url"; + + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nonnull + private String url; + + public ServerConsoleUrl() {} + + public ServerConsoleUrl url(@javax.annotation.Nonnull String url) { + this.url = url; + return this; + } + + /** + * Get url + * + * @return url + */ + @javax.annotation.Nonnull + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServerConsoleUrl serverConsoleUrl = (ServerConsoleUrl) o; + return Objects.equals(this.url, serverConsoleUrl.url); + } + + @Override + public int hashCode() { + return Objects.hash(url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServerConsoleUrl {\n"); + sb.append(" url: ").append(toIndentedString(url)).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("url")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("url")); + } + + /** + * 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 ServerConsoleUrl + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ServerConsoleUrl.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `url` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ServerConsoleUrl.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServerConsoleUrl' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ServerConsoleUrl.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ServerConsoleUrl value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ServerConsoleUrl read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ServerConsoleUrl given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServerConsoleUrl + * @throws IOException if the JSON string is invalid with respect to ServerConsoleUrl + */ + public static ServerConsoleUrl fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServerConsoleUrl.class); + } + + /** + * Convert an instance of ServerConsoleUrl 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/ServerListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerListResponse.java new file mode 100644 index 0000000..99a46b0 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerListResponse.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Response object for server list request. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ServerListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public ServerListResponse() {} + + public ServerListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public ServerListResponse addItemsItem(Server itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of servers. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServerListResponse serverListResponse = (ServerListResponse) o; + return Objects.equals(this.items, serverListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServerListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 ServerListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ServerListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + Server.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ServerListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServerListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ServerListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ServerListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ServerListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ServerListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServerListResponse + * @throws IOException if the JSON string is invalid with respect to ServerListResponse + */ + public static ServerListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServerListResponse.class); + } + + /** + * Convert an instance of ServerListResponse 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/ServerMaintenance.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerMaintenance.java new file mode 100644 index 0000000..ef6150d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerMaintenance.java @@ -0,0 +1,295 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.0") +public class ServerMaintenance { + public static final String SERIALIZED_NAME_DETAILS = "details"; + + @SerializedName(SERIALIZED_NAME_DETAILS) + @javax.annotation.Nullable private String details; + + public static final String SERIALIZED_NAME_ENDS_AT = "endsAt"; + + @SerializedName(SERIALIZED_NAME_ENDS_AT) + @javax.annotation.Nonnull + private OffsetDateTime endsAt; + + public static final String SERIALIZED_NAME_STARTS_AT = "startsAt"; + + @SerializedName(SERIALIZED_NAME_STARTS_AT) + @javax.annotation.Nonnull + private OffsetDateTime startsAt; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private String status; + + public ServerMaintenance() {} + + public ServerMaintenance details(@javax.annotation.Nullable String details) { + this.details = details; + return this; + } + + /** + * Get details + * + * @return details + */ + @javax.annotation.Nullable public String getDetails() { + return details; + } + + public void setDetails(@javax.annotation.Nullable String details) { + this.details = details; + } + + public ServerMaintenance endsAt(@javax.annotation.Nonnull OffsetDateTime endsAt) { + this.endsAt = endsAt; + return this; + } + + /** + * End of the maintenance window. + * + * @return endsAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getEndsAt() { + return endsAt; + } + + public void setEndsAt(@javax.annotation.Nonnull OffsetDateTime endsAt) { + this.endsAt = endsAt; + } + + public ServerMaintenance startsAt(@javax.annotation.Nonnull OffsetDateTime startsAt) { + this.startsAt = startsAt; + return this; + } + + /** + * Start of the maintenance window. + * + * @return startsAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getStartsAt() { + return startsAt; + } + + public void setStartsAt(@javax.annotation.Nonnull OffsetDateTime startsAt) { + this.startsAt = startsAt; + } + + public ServerMaintenance status(@javax.annotation.Nonnull String status) { + this.status = status; + return this; + } + + /** + * Possible values: `PLANNED`, `ONGOING`. + * + * @return status + */ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServerMaintenance serverMaintenance = (ServerMaintenance) 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); + } + + @Override + public int hashCode() { + return Objects.hash(details, endsAt, startsAt, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServerMaintenance {\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + 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("}"); + 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("details", "endsAt", "startsAt", "status")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("endsAt", "startsAt", "status")); + } + + /** + * 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 ServerMaintenance + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ServerMaintenance.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) + && !jsonObj.get("details").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "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 (!ServerMaintenance.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServerMaintenance' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ServerMaintenance.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ServerMaintenance value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ServerMaintenance read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ServerMaintenance given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServerMaintenance + * @throws IOException if the JSON string is invalid with respect to ServerMaintenance + */ + public static ServerMaintenance fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServerMaintenance.class); + } + + /** + * Convert an instance of ServerMaintenance 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/ServerNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerNetwork.java new file mode 100644 index 0000000..b44394f --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServerNetwork.java @@ -0,0 +1,552 @@ +/* + * 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; +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.14.0") +public class ServerNetwork { + public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; + + @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) + @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IPV4 = "ipv4"; + + @SerializedName(SERIALIZED_NAME_IPV4) + @javax.annotation.Nullable private String ipv4; + + public static final String SERIALIZED_NAME_IPV6 = "ipv6"; + + @SerializedName(SERIALIZED_NAME_IPV6) + @javax.annotation.Nullable private String ipv6; + + public static final String SERIALIZED_NAME_MAC = "mac"; + + @SerializedName(SERIALIZED_NAME_MAC) + @javax.annotation.Nonnull + private String mac; + + 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_NETWORK_NAME = "networkName"; + + @SerializedName(SERIALIZED_NAME_NETWORK_NAME) + @javax.annotation.Nonnull + private String networkName; + + public static final String SERIALIZED_NAME_NIC_ID = "nicId"; + + @SerializedName(SERIALIZED_NAME_NIC_ID) + @javax.annotation.Nonnull + private UUID nicId; + + public static final String SERIALIZED_NAME_NIC_SECURITY = "nicSecurity"; + + @SerializedName(SERIALIZED_NAME_NIC_SECURITY) + @javax.annotation.Nonnull + private Boolean nicSecurity; + + 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_SECURITY_GROUPS = "securityGroups"; + + @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) + @javax.annotation.Nullable private List securityGroups = new ArrayList<>(); + + public ServerNetwork() {} + + public ServerNetwork allowedAddresses( + @javax.annotation.Nullable List allowedAddresses) { + this.allowedAddresses = allowedAddresses; + return this; + } + + public ServerNetwork addAllowedAddressesItem(AllowedAddressesInner allowedAddressesItem) { + if (this.allowedAddresses == null) { + this.allowedAddresses = new ArrayList<>(); + } + this.allowedAddresses.add(allowedAddressesItem); + return this; + } + + /** + * A list of IPs or CIDR notations. + * + * @return allowedAddresses + */ + @javax.annotation.Nullable public List getAllowedAddresses() { + return allowedAddresses; + } + + public void setAllowedAddresses( + @javax.annotation.Nullable List allowedAddresses) { + this.allowedAddresses = allowedAddresses; + } + + public ServerNetwork ipv4(@javax.annotation.Nullable String ipv4) { + this.ipv4 = ipv4; + return this; + } + + /** + * Object that represents an IP address. + * + * @return ipv4 + */ + @javax.annotation.Nullable public String getIpv4() { + return ipv4; + } + + public void setIpv4(@javax.annotation.Nullable String ipv4) { + this.ipv4 = ipv4; + } + + public ServerNetwork ipv6(@javax.annotation.Nullable String ipv6) { + this.ipv6 = ipv6; + return this; + } + + /** + * String that represents an IPv6 address. + * + * @return ipv6 + */ + @javax.annotation.Nullable public String getIpv6() { + return ipv6; + } + + public void setIpv6(@javax.annotation.Nullable String ipv6) { + this.ipv6 = ipv6; + } + + public ServerNetwork mac(@javax.annotation.Nonnull String mac) { + this.mac = mac; + return this; + } + + /** + * Object that represents an MAC address. + * + * @return mac + */ + @javax.annotation.Nonnull + public String getMac() { + return mac; + } + + public void setMac(@javax.annotation.Nonnull String mac) { + this.mac = mac; + } + + public ServerNetwork networkId(@javax.annotation.Nonnull UUID networkId) { + this.networkId = networkId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return networkId + */ + @javax.annotation.Nonnull + public UUID getNetworkId() { + return networkId; + } + + public void setNetworkId(@javax.annotation.Nonnull UUID networkId) { + this.networkId = networkId; + } + + public ServerNetwork networkName(@javax.annotation.Nonnull String networkName) { + this.networkName = networkName; + return this; + } + + /** + * The name for a General Object. Matches Names and also UUIDs. + * + * @return networkName + */ + @javax.annotation.Nonnull + public String getNetworkName() { + return networkName; + } + + public void setNetworkName(@javax.annotation.Nonnull String networkName) { + this.networkName = networkName; + } + + public ServerNetwork nicId(@javax.annotation.Nonnull UUID nicId) { + this.nicId = nicId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return nicId + */ + @javax.annotation.Nonnull + public UUID getNicId() { + return nicId; + } + + public void setNicId(@javax.annotation.Nonnull UUID nicId) { + this.nicId = nicId; + } + + public ServerNetwork nicSecurity(@javax.annotation.Nonnull Boolean nicSecurity) { + this.nicSecurity = nicSecurity; + return this; + } + + /** + * If this is set to false, then no security groups will apply to this server network interface. + * + * @return nicSecurity + */ + @javax.annotation.Nonnull + public Boolean getNicSecurity() { + return nicSecurity; + } + + public void setNicSecurity(@javax.annotation.Nonnull Boolean nicSecurity) { + this.nicSecurity = nicSecurity; + } + + public ServerNetwork publicIp(@javax.annotation.Nullable String publicIp) { + this.publicIp = publicIp; + return this; + } + + /** + * Object that represents an IP address. + * + * @return publicIp + */ + @javax.annotation.Nullable public String getPublicIp() { + return publicIp; + } + + public void setPublicIp(@javax.annotation.Nullable String publicIp) { + this.publicIp = publicIp; + } + + public ServerNetwork securityGroups(@javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + public ServerNetwork addSecurityGroupsItem(UUID securityGroupsItem) { + if (this.securityGroups == null) { + this.securityGroups = new ArrayList<>(); + } + this.securityGroups.add(securityGroupsItem); + return this; + } + + /** + * A list of UUIDs. + * + * @return securityGroups + */ + @javax.annotation.Nullable public List getSecurityGroups() { + return securityGroups; + } + + public void setSecurityGroups(@javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServerNetwork serverNetwork = (ServerNetwork) o; + return Objects.equals(this.allowedAddresses, serverNetwork.allowedAddresses) + && Objects.equals(this.ipv4, serverNetwork.ipv4) + && Objects.equals(this.ipv6, serverNetwork.ipv6) + && Objects.equals(this.mac, serverNetwork.mac) + && Objects.equals(this.networkId, serverNetwork.networkId) + && Objects.equals(this.networkName, serverNetwork.networkName) + && Objects.equals(this.nicId, serverNetwork.nicId) + && Objects.equals(this.nicSecurity, serverNetwork.nicSecurity) + && Objects.equals(this.publicIp, serverNetwork.publicIp) + && Objects.equals(this.securityGroups, serverNetwork.securityGroups); + } + + @Override + public int hashCode() { + return Objects.hash( + allowedAddresses, + ipv4, + ipv6, + mac, + networkId, + networkName, + nicId, + nicSecurity, + publicIp, + securityGroups); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServerNetwork {\n"); + sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); + sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); + sb.append(" mac: ").append(toIndentedString(mac)).append("\n"); + sb.append(" networkId: ").append(toIndentedString(networkId)).append("\n"); + sb.append(" networkName: ").append(toIndentedString(networkName)).append("\n"); + sb.append(" nicId: ").append(toIndentedString(nicId)).append("\n"); + 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("}"); + 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( + "allowedAddresses", + "ipv4", + "ipv6", + "mac", + "networkId", + "networkName", + "nicId", + "nicSecurity", + "publicIp", + "securityGroups")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = + new HashSet( + Arrays.asList("mac", "networkId", "networkName", "nicId", "nicSecurity")); + } + + /** + * 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 ServerNetwork + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ServerNetwork.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("allowedAddresses") != null + && !jsonObj.get("allowedAddresses").isJsonNull()) { + JsonArray jsonArrayallowedAddresses = jsonObj.getAsJsonArray("allowedAddresses"); + if (jsonArrayallowedAddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("allowedAddresses").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `allowedAddresses` to be an array in the JSON string but got `%s`", + jsonObj.get("allowedAddresses").toString())); + } + + // validate the optional field `allowedAddresses` (array) + for (int i = 0; i < jsonArrayallowedAddresses.size(); i++) { + AllowedAddressesInner.validateJsonElement(jsonArrayallowedAddresses.get(i)); + } + ; + } + } + if ((jsonObj.get("ipv4") != null && !jsonObj.get("ipv4").isJsonNull()) + && !jsonObj.get("ipv4").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ipv4` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ipv4").toString())); + } + if ((jsonObj.get("ipv6") != null && !jsonObj.get("ipv6").isJsonNull()) + && !jsonObj.get("ipv6").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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( + "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( + "Expected the field `nicId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("nicId").toString())); + } + if ((jsonObj.get("publicIp") != null && !jsonObj.get("publicIp").isJsonNull()) + && !jsonObj.get("publicIp").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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("securityGroups") != null + && !jsonObj.get("securityGroups").isJsonNull() + && !jsonObj.get("securityGroups").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", + jsonObj.get("securityGroups").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ServerNetwork.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServerNetwork' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ServerNetwork.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ServerNetwork value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ServerNetwork read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ServerNetwork given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServerNetwork + * @throws IOException if the JSON string is invalid with respect to ServerNetwork + */ + public static ServerNetwork fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServerNetwork.class); + } + + /** + * Convert an instance of ServerNetwork 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/ServiceAccountMailListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServiceAccountMailListResponse.java new file mode 100644 index 0000000..9c69729 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/ServiceAccountMailListResponse.java @@ -0,0 +1,227 @@ +/* + * 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; + +/** Service account mail list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class ServiceAccountMailListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public ServiceAccountMailListResponse() {} + + public ServiceAccountMailListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public ServiceAccountMailListResponse addItemsItem(String itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of service account mails. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceAccountMailListResponse serviceAccountMailListResponse = + (ServiceAccountMailListResponse) o; + return Objects.equals(this.items, serviceAccountMailListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAccountMailListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 + * ServiceAccountMailListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ServiceAccountMailListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("items") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ServiceAccountMailListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServiceAccountMailListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ServiceAccountMailListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ServiceAccountMailListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ServiceAccountMailListResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ServiceAccountMailListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServiceAccountMailListResponse + * @throws IOException if the JSON string is invalid with respect to + * ServiceAccountMailListResponse + */ + public static ServiceAccountMailListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServiceAccountMailListResponse.class); + } + + /** + * Convert an instance of ServiceAccountMailListResponse 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/SetImageSharePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SetImageSharePayload.java new file mode 100644 index 0000000..14cebca --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SetImageSharePayload.java @@ -0,0 +1,239 @@ +/* + * 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 java.util.UUID; + +/** + * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class SetImageSharePayload { + public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; + + @SerializedName(SERIALIZED_NAME_PARENT_ORGANIZATION) + @javax.annotation.Nullable private Boolean parentOrganization; + + public static final String SERIALIZED_NAME_PROJECTS = "projects"; + + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable private List projects = new ArrayList<>(); + + public SetImageSharePayload() {} + + public SetImageSharePayload parentOrganization( + @javax.annotation.Nullable Boolean parentOrganization) { + this.parentOrganization = parentOrganization; + return this; + } + + /** + * Image is shared with all projects inside the image owners organization. + * + * @return parentOrganization + */ + @javax.annotation.Nullable public Boolean getParentOrganization() { + return parentOrganization; + } + + public void setParentOrganization(@javax.annotation.Nullable Boolean parentOrganization) { + this.parentOrganization = parentOrganization; + } + + public SetImageSharePayload projects(@javax.annotation.Nullable List projects) { + this.projects = projects; + return this; + } + + public SetImageSharePayload addProjectsItem(UUID projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * List of all projects the Image is shared with. + * + * @return projects + */ + @javax.annotation.Nullable public List getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List projects) { + this.projects = projects; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetImageSharePayload setImageSharePayload = (SetImageSharePayload) o; + return Objects.equals(this.parentOrganization, setImageSharePayload.parentOrganization) + && Objects.equals(this.projects, setImageSharePayload.projects); + } + + @Override + public int hashCode() { + return Objects.hash(parentOrganization, projects); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetImageSharePayload {\n"); + sb.append(" parentOrganization: ") + .append(toIndentedString(parentOrganization)) + .append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).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("parentOrganization", "projects")); + + // 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 SetImageSharePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetImageSharePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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 + && !jsonObj.get("projects").isJsonNull() + && !jsonObj.get("projects").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `projects` to be an array in the JSON string but got `%s`", + jsonObj.get("projects").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetImageSharePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetImageSharePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SetImageSharePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SetImageSharePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetImageSharePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SetImageSharePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetImageSharePayload + * @throws IOException if the JSON string is invalid with respect to SetImageSharePayload + */ + public static SetImageSharePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetImageSharePayload.class); + } + + /** + * Convert an instance of SetImageSharePayload 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/Snapshot.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Snapshot.java new file mode 100644 index 0000000..f9754eb --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Snapshot.java @@ -0,0 +1,384 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.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_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.Nullable private String name; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable private Long size; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_VOLUME_ID = "volumeId"; + + @SerializedName(SERIALIZED_NAME_VOLUME_ID) + @javax.annotation.Nonnull + private UUID volumeId; + + public Snapshot() {} + + public Snapshot( + OffsetDateTime createdAt, UUID id, Long size, String status, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.id = id; + this.size = size; + this.status = status; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public Snapshot labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public Snapshot 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; + } + + /** + * Size in Gigabyte. + * + * @return size + */ + @javax.annotation.Nullable public Long getSize() { + return size; + } + + /** + * The status of a snapshot object. Possible values: `AVAILABLE`, + * `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, + * `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public Snapshot volumeId(@javax.annotation.Nonnull UUID volumeId) { + this.volumeId = volumeId; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return volumeId + */ + @javax.annotation.Nonnull + public UUID getVolumeId() { + return volumeId; + } + + public void setVolumeId(@javax.annotation.Nonnull UUID volumeId) { + this.volumeId = volumeId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Snapshot snapshot = (Snapshot) o; + return Objects.equals(this.createdAt, snapshot.createdAt) + && 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); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, id, labels, name, size, status, updatedAt, volumeId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Snapshot {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).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(" size: ").append(toIndentedString(size)).append("\n"); + 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("}"); + 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", + "id", + "labels", + "name", + "size", + "status", + "updatedAt", + "volumeId")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("volumeId")); + } + + /** + * 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 Snapshot + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Snapshot.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("volumeId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Snapshot.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Snapshot' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Snapshot.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Snapshot value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Snapshot read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Snapshot given an JSON string + * + * @param jsonString JSON string + * @return An instance of Snapshot + * @throws IOException if the JSON string is invalid with respect to Snapshot + */ + public static Snapshot fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Snapshot.class); + } + + /** + * Convert an instance of Snapshot 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/SnapshotListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SnapshotListResponse.java new file mode 100644 index 0000000..4b3c6ec --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/SnapshotListResponse.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Snapshot list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class SnapshotListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public SnapshotListResponse() {} + + public SnapshotListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public SnapshotListResponse addItemsItem(Snapshot itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list containing snapshot objects. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SnapshotListResponse snapshotListResponse = (SnapshotListResponse) o; + return Objects.equals(this.items, snapshotListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SnapshotListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 SnapshotListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SnapshotListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + Snapshot.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SnapshotListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SnapshotListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SnapshotListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SnapshotListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SnapshotListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SnapshotListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SnapshotListResponse + * @throws IOException if the JSON string is invalid with respect to SnapshotListResponse + */ + public static SnapshotListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SnapshotListResponse.class); + } + + /** + * Convert an instance of SnapshotListResponse 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/StaticAreaID.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/StaticAreaID.java new file mode 100644 index 0000000..484b8fc --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/StaticAreaID.java @@ -0,0 +1,73 @@ +/* + * 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 com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +/** The identifier (ID) of a static area. */ +@JsonAdapter(StaticAreaID.Adapter.class) +public enum StaticAreaID { + PUBLIC("PUBLIC"), + + SCHWARZ("SCHWARZ"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StaticAreaID(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StaticAreaID fromValue(String value) { + for (StaticAreaID b : StaticAreaID.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StaticAreaID enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StaticAreaID read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StaticAreaID.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StaticAreaID.fromValue(value); + } +} 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 new file mode 100644 index 0000000..b33085f --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAreaAddressFamily.java @@ -0,0 +1,194 @@ +/* + * 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.14.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 new file mode 100644 index 0000000..fac3cc5 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAreaIPv4.java @@ -0,0 +1,291 @@ +/* + * 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.14.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 new file mode 100644 index 0000000..361551d --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateAttachedVolumePayload.java @@ -0,0 +1,249 @@ +/* + * 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; +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.14.0") +public class UpdateAttachedVolumePayload { + public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; + + @SerializedName(SERIALIZED_NAME_DELETE_ON_TERMINATION) + @javax.annotation.Nullable private Boolean deleteOnTermination; + + public static final String SERIALIZED_NAME_SERVER_ID = "serverId"; + + @SerializedName(SERIALIZED_NAME_SERVER_ID) + @javax.annotation.Nullable private UUID serverId; + + public static final String SERIALIZED_NAME_VOLUME_ID = "volumeId"; + + @SerializedName(SERIALIZED_NAME_VOLUME_ID) + @javax.annotation.Nullable private UUID volumeId; + + public UpdateAttachedVolumePayload() {} + + public UpdateAttachedVolumePayload(UUID serverId, UUID volumeId) { + this(); + this.serverId = serverId; + this.volumeId = volumeId; + } + + public UpdateAttachedVolumePayload deleteOnTermination( + @javax.annotation.Nullable Boolean deleteOnTermination) { + this.deleteOnTermination = deleteOnTermination; + return this; + } + + /** + * Delete the volume during the termination of the server. Defaults to false. + * + * @return deleteOnTermination + */ + @javax.annotation.Nullable public Boolean getDeleteOnTermination() { + return deleteOnTermination; + } + + public void setDeleteOnTermination(@javax.annotation.Nullable Boolean deleteOnTermination) { + this.deleteOnTermination = deleteOnTermination; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return serverId + */ + @javax.annotation.Nullable public UUID getServerId() { + return serverId; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return volumeId + */ + @javax.annotation.Nullable public UUID getVolumeId() { + return volumeId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAttachedVolumePayload updateAttachedVolumePayload = (UpdateAttachedVolumePayload) o; + return Objects.equals( + this.deleteOnTermination, updateAttachedVolumePayload.deleteOnTermination) + && Objects.equals(this.serverId, updateAttachedVolumePayload.serverId) + && Objects.equals(this.volumeId, updateAttachedVolumePayload.volumeId); + } + + @Override + public int hashCode() { + return Objects.hash(deleteOnTermination, serverId, volumeId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAttachedVolumePayload {\n"); + sb.append(" deleteOnTermination: ") + .append(toIndentedString(deleteOnTermination)) + .append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" volumeId: ").append(toIndentedString(volumeId)).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("deleteOnTermination", "serverId", "volumeId")); + + // 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 + * UpdateAttachedVolumePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateAttachedVolumePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `serverId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("serverId").toString())); + } + if ((jsonObj.get("volumeId") != null && !jsonObj.get("volumeId").isJsonNull()) + && !jsonObj.get("volumeId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("volumeId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateAttachedVolumePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAttachedVolumePayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateAttachedVolumePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateAttachedVolumePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateAttachedVolumePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateAttachedVolumePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateAttachedVolumePayload + * @throws IOException if the JSON string is invalid with respect to UpdateAttachedVolumePayload + */ + public static UpdateAttachedVolumePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAttachedVolumePayload.class); + } + + /** + * Convert an instance of UpdateAttachedVolumePayload 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/UpdateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateBackupPayload.java new file mode 100644 index 0000000..2a23d00 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateBackupPayload.java @@ -0,0 +1,433 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +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.14.0") +public class UpdateBackupPayload { + public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; + + @SerializedName(SERIALIZED_NAME_AVAILABILITY_ZONE) + @javax.annotation.Nullable private String availabilityZone; + + 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_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.Nullable private String name; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable private Long size; + + public static final String SERIALIZED_NAME_SNAPSHOT_ID = "snapshotId"; + + @SerializedName(SERIALIZED_NAME_SNAPSHOT_ID) + @javax.annotation.Nullable private UUID snapshotId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public static final String SERIALIZED_NAME_VOLUME_ID = "volumeId"; + + @SerializedName(SERIALIZED_NAME_VOLUME_ID) + @javax.annotation.Nullable private UUID volumeId; + + public UpdateBackupPayload() {} + + public UpdateBackupPayload( + String availabilityZone, + OffsetDateTime createdAt, + UUID id, + Long size, + UUID snapshotId, + String status, + OffsetDateTime updatedAt, + UUID volumeId) { + this(); + this.availabilityZone = availabilityZone; + this.createdAt = createdAt; + this.id = id; + this.size = size; + this.snapshotId = snapshotId; + this.status = status; + this.updatedAt = updatedAt; + this.volumeId = volumeId; + } + + /** + * Object that represents an availability zone. + * + * @return availabilityZone + */ + @javax.annotation.Nullable public String getAvailabilityZone() { + return availabilityZone; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + public UpdateBackupPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public UpdateBackupPayload 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; + } + + /** + * Size in Gigabyte. + * + * @return size + */ + @javax.annotation.Nullable public Long getSize() { + return size; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return snapshotId + */ + @javax.annotation.Nullable public UUID getSnapshotId() { + return snapshotId; + } + + /** + * The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, + * `DELETED`, `DELETING`, `ERROR`, `RESTORING`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return volumeId + */ + @javax.annotation.Nullable public UUID getVolumeId() { + return volumeId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateBackupPayload updateBackupPayload = (UpdateBackupPayload) o; + return Objects.equals(this.availabilityZone, updateBackupPayload.availabilityZone) + && Objects.equals(this.createdAt, updateBackupPayload.createdAt) + && Objects.equals(this.id, updateBackupPayload.id) + && Objects.equals(this.labels, updateBackupPayload.labels) + && Objects.equals(this.name, updateBackupPayload.name) + && Objects.equals(this.size, updateBackupPayload.size) + && Objects.equals(this.snapshotId, updateBackupPayload.snapshotId) + && Objects.equals(this.status, updateBackupPayload.status) + && Objects.equals(this.updatedAt, updateBackupPayload.updatedAt) + && Objects.equals(this.volumeId, updateBackupPayload.volumeId); + } + + @Override + public int hashCode() { + return Objects.hash( + availabilityZone, + createdAt, + id, + labels, + name, + size, + snapshotId, + status, + updatedAt, + volumeId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateBackupPayload {\n"); + sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).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(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" snapshotId: ").append(toIndentedString(snapshotId)).append("\n"); + 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("}"); + 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( + "availabilityZone", + "createdAt", + "id", + "labels", + "name", + "size", + "snapshotId", + "status", + "updatedAt", + "volumeId")); + + // 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 UpdateBackupPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateBackupPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `availabilityZone` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("availabilityZone").toString())); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("snapshotId") != null && !jsonObj.get("snapshotId").isJsonNull()) + && !jsonObj.get("snapshotId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `snapshotId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("snapshotId").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("volumeId") != null && !jsonObj.get("volumeId").isJsonNull()) + && !jsonObj.get("volumeId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("volumeId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateBackupPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateBackupPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateBackupPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateBackupPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateBackupPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateBackupPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateBackupPayload + * @throws IOException if the JSON string is invalid with respect to UpdateBackupPayload + */ + public static UpdateBackupPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateBackupPayload.class); + } + + /** + * Convert an instance of UpdateBackupPayload 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/UpdateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImagePayload.java new file mode 100644 index 0000000..7e4b3a1 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImagePayload.java @@ -0,0 +1,401 @@ +/* + * 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; + +/** Object that represents an update request body of an Image. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class UpdateImagePayload { + public static final String SERIALIZED_NAME_AGENT = "agent"; + + @SerializedName(SERIALIZED_NAME_AGENT) + @javax.annotation.Nullable private ImageAgent agent; + + public static final String SERIALIZED_NAME_CONFIG = "config"; + + @SerializedName(SERIALIZED_NAME_CONFIG) + @javax.annotation.Nullable private ImageConfig config; + + public static final String SERIALIZED_NAME_DISK_FORMAT = "diskFormat"; + + @SerializedName(SERIALIZED_NAME_DISK_FORMAT) + @javax.annotation.Nullable private String diskFormat; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_MIN_DISK_SIZE = "minDiskSize"; + + @SerializedName(SERIALIZED_NAME_MIN_DISK_SIZE) + @javax.annotation.Nullable private Long minDiskSize; + + public static final String SERIALIZED_NAME_MIN_RAM = "minRam"; + + @SerializedName(SERIALIZED_NAME_MIN_RAM) + @javax.annotation.Nullable private Long minRam; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; + + public static final String SERIALIZED_NAME_PROTECTED = "protected"; + + @SerializedName(SERIALIZED_NAME_PROTECTED) + @javax.annotation.Nullable private Boolean _protected; + + public UpdateImagePayload() {} + + public UpdateImagePayload agent(@javax.annotation.Nullable ImageAgent agent) { + this.agent = agent; + return this; + } + + /** + * Get agent + * + * @return agent + */ + @javax.annotation.Nullable public ImageAgent getAgent() { + return agent; + } + + public void setAgent(@javax.annotation.Nullable ImageAgent agent) { + this.agent = agent; + } + + public UpdateImagePayload config(@javax.annotation.Nullable ImageConfig config) { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config + */ + @javax.annotation.Nullable public ImageConfig getConfig() { + return config; + } + + public void setConfig(@javax.annotation.Nullable ImageConfig config) { + this.config = config; + } + + public UpdateImagePayload diskFormat(@javax.annotation.Nullable String diskFormat) { + this.diskFormat = diskFormat; + return this; + } + + /** + * Object that represents a disk format. Possible values: `raw`, `qcow2`, + * `iso`. + * + * @return diskFormat + */ + @javax.annotation.Nullable public String getDiskFormat() { + return diskFormat; + } + + public void setDiskFormat(@javax.annotation.Nullable String diskFormat) { + this.diskFormat = diskFormat; + } + + public UpdateImagePayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public UpdateImagePayload minDiskSize(@javax.annotation.Nullable Long minDiskSize) { + this.minDiskSize = minDiskSize; + return this; + } + + /** + * Size in Gigabyte. + * + * @return minDiskSize + */ + @javax.annotation.Nullable public Long getMinDiskSize() { + return minDiskSize; + } + + public void setMinDiskSize(@javax.annotation.Nullable Long minDiskSize) { + this.minDiskSize = minDiskSize; + } + + public UpdateImagePayload minRam(@javax.annotation.Nullable Long minRam) { + this.minRam = minRam; + return this; + } + + /** + * Size in Megabyte. + * + * @return minRam + */ + @javax.annotation.Nullable public Long getMinRam() { + return minRam; + } + + public void setMinRam(@javax.annotation.Nullable Long minRam) { + this.minRam = minRam; + } + + public UpdateImagePayload 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 UpdateImagePayload _protected(@javax.annotation.Nullable Boolean _protected) { + this._protected = _protected; + return this; + } + + /** + * When true the 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateImagePayload updateImagePayload = (UpdateImagePayload) o; + return Objects.equals(this.agent, updateImagePayload.agent) + && Objects.equals(this.config, updateImagePayload.config) + && Objects.equals(this.diskFormat, updateImagePayload.diskFormat) + && Objects.equals(this.labels, updateImagePayload.labels) + && Objects.equals(this.minDiskSize, updateImagePayload.minDiskSize) + && Objects.equals(this.minRam, updateImagePayload.minRam) + && Objects.equals(this.name, updateImagePayload.name) + && Objects.equals(this._protected, updateImagePayload._protected); + } + + @Override + public int hashCode() { + return Objects.hash( + agent, config, diskFormat, labels, minDiskSize, minRam, name, _protected); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateImagePayload {\n"); + sb.append(" agent: ").append(toIndentedString(agent)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" diskFormat: ").append(toIndentedString(diskFormat)).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"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" _protected: ").append(toIndentedString(_protected)).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( + "agent", + "config", + "diskFormat", + "labels", + "minDiskSize", + "minRam", + "name", + "protected")); + + // 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 UpdateImagePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateImagePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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()) { + ImageAgent.validateJsonElement(jsonObj.get("agent")); + } + // validate the optional field `config` + if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { + ImageConfig.validateJsonElement(jsonObj.get("config")); + } + if ((jsonObj.get("diskFormat") != null && !jsonObj.get("diskFormat").isJsonNull()) + && !jsonObj.get("diskFormat").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `diskFormat` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("diskFormat").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!UpdateImagePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateImagePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateImagePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateImagePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateImagePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateImagePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateImagePayload + * @throws IOException if the JSON string is invalid with respect to UpdateImagePayload + */ + public static UpdateImagePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateImagePayload.class); + } + + /** + * Convert an instance of UpdateImagePayload 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/UpdateImageSharePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImageSharePayload.java new file mode 100644 index 0000000..1b5cc32 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateImageSharePayload.java @@ -0,0 +1,240 @@ +/* + * 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 java.util.UUID; + +/** + * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class UpdateImageSharePayload { + public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; + + @SerializedName(SERIALIZED_NAME_PARENT_ORGANIZATION) + @javax.annotation.Nullable private Boolean parentOrganization; + + public static final String SERIALIZED_NAME_PROJECTS = "projects"; + + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable private List projects = new ArrayList<>(); + + public UpdateImageSharePayload() {} + + public UpdateImageSharePayload parentOrganization( + @javax.annotation.Nullable Boolean parentOrganization) { + this.parentOrganization = parentOrganization; + return this; + } + + /** + * Image is shared with all projects inside the image owners organization. + * + * @return parentOrganization + */ + @javax.annotation.Nullable public Boolean getParentOrganization() { + return parentOrganization; + } + + public void setParentOrganization(@javax.annotation.Nullable Boolean parentOrganization) { + this.parentOrganization = parentOrganization; + } + + public UpdateImageSharePayload projects(@javax.annotation.Nullable List projects) { + this.projects = projects; + return this; + } + + public UpdateImageSharePayload addProjectsItem(UUID projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * List of all projects the Image is shared with. + * + * @return projects + */ + @javax.annotation.Nullable public List getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List projects) { + this.projects = projects; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateImageSharePayload updateImageSharePayload = (UpdateImageSharePayload) o; + return Objects.equals(this.parentOrganization, updateImageSharePayload.parentOrganization) + && Objects.equals(this.projects, updateImageSharePayload.projects); + } + + @Override + public int hashCode() { + return Objects.hash(parentOrganization, projects); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateImageSharePayload {\n"); + sb.append(" parentOrganization: ") + .append(toIndentedString(parentOrganization)) + .append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).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("parentOrganization", "projects")); + + // 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 UpdateImageSharePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateImageSharePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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 + && !jsonObj.get("projects").isJsonNull() + && !jsonObj.get("projects").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `projects` to be an array in the JSON string but got `%s`", + jsonObj.get("projects").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateImageSharePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateImageSharePayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateImageSharePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateImageSharePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateImageSharePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateImageSharePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateImageSharePayload + * @throws IOException if the JSON string is invalid with respect to UpdateImageSharePayload + */ + public static UpdateImageSharePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateImageSharePayload.class); + } + + /** + * Convert an instance of UpdateImageSharePayload 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/UpdateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateKeyPairPayload.java new file mode 100644 index 0000000..d6ffa98 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateKeyPairPayload.java @@ -0,0 +1,192 @@ +/* + * 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; + +/** 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.14.0") +public class UpdateKeyPairPayload { + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public UpdateKeyPairPayload() {} + + public UpdateKeyPairPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateKeyPairPayload updateKeyPairPayload = (UpdateKeyPairPayload) o; + return Objects.equals(this.labels, updateKeyPairPayload.labels); + } + + @Override + public int hashCode() { + return Objects.hash(labels); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateKeyPairPayload {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).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 UpdateKeyPairPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateKeyPairPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateKeyPairPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateKeyPairPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateKeyPairPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateKeyPairPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateKeyPairPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateKeyPairPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateKeyPairPayload + * @throws IOException if the JSON string is invalid with respect to UpdateKeyPairPayload + */ + public static UpdateKeyPairPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateKeyPairPayload.class); + } + + /** + * Convert an instance of UpdateKeyPairPayload 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/UpdateNetworkAddressFamily.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAddressFamily.java new file mode 100644 index 0000000..c565fc2 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAddressFamily.java @@ -0,0 +1,223 @@ +/* + * 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.14.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/UpdateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAreaRoutePayload.java new file mode 100644 index 0000000..54820c4 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkAreaRoutePayload.java @@ -0,0 +1,198 @@ +/* + * 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; + +/** Object that represents the request body for a route update. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class UpdateNetworkAreaRoutePayload { + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public UpdateNetworkAreaRoutePayload() {} + + public UpdateNetworkAreaRoutePayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateNetworkAreaRoutePayload updateNetworkAreaRoutePayload = + (UpdateNetworkAreaRoutePayload) o; + return Objects.equals(this.labels, updateNetworkAreaRoutePayload.labels); + } + + @Override + public int hashCode() { + return Objects.hash(labels); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateNetworkAreaRoutePayload {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).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 + * UpdateNetworkAreaRoutePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateNetworkAreaRoutePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateNetworkAreaRoutePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateNetworkAreaRoutePayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateNetworkAreaRoutePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateNetworkAreaRoutePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateNetworkAreaRoutePayload read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateNetworkAreaRoutePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateNetworkAreaRoutePayload + * @throws IOException if the JSON string is invalid with respect to + * UpdateNetworkAreaRoutePayload + */ + public static UpdateNetworkAreaRoutePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateNetworkAreaRoutePayload.class); + } + + /** + * Convert an instance of UpdateNetworkAreaRoutePayload 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/UpdateNetworkIPv4Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv4Body.java new file mode 100644 index 0000000..b80a2cb --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv4Body.java @@ -0,0 +1,258 @@ +/* + * 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 a IPv4 network update. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class UpdateNetworkIPv4Body { + 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 UpdateNetworkIPv4Body() {} + + public UpdateNetworkIPv4Body 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 UpdateNetworkIPv4Body nameservers(@javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + return this; + } + + public UpdateNetworkIPv4Body 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateNetworkIPv4Body updateNetworkIPv4Body = (UpdateNetworkIPv4Body) o; + return Objects.equals(this.gateway, updateNetworkIPv4Body.gateway) + && Objects.equals(this.nameservers, updateNetworkIPv4Body.nameservers); + } + + 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); + } + + 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 UpdateNetworkIPv4Body {\n"); + sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); + sb.append(" nameservers: ").append(toIndentedString(nameservers)).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")); + + // 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 UpdateNetworkIPv4Body + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateNetworkIPv4Body.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateNetworkIPv4Body.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateNetworkIPv4Body' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateNetworkIPv4Body.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateNetworkIPv4Body value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateNetworkIPv4Body read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateNetworkIPv4Body given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateNetworkIPv4Body + * @throws IOException if the JSON string is invalid with respect to UpdateNetworkIPv4Body + */ + public static UpdateNetworkIPv4Body fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateNetworkIPv4Body.class); + } + + /** + * Convert an instance of UpdateNetworkIPv4Body 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/UpdateNetworkIPv6Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv6Body.java new file mode 100644 index 0000000..ae2b957 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNetworkIPv6Body.java @@ -0,0 +1,258 @@ +/* + * 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 a IPv6 network update. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class UpdateNetworkIPv6Body { + 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 UpdateNetworkIPv6Body() {} + + public UpdateNetworkIPv6Body 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 UpdateNetworkIPv6Body nameservers(@javax.annotation.Nullable List nameservers) { + this.nameservers = nameservers; + return this; + } + + public UpdateNetworkIPv6Body 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateNetworkIPv6Body updateNetworkIPv6Body = (UpdateNetworkIPv6Body) o; + return Objects.equals(this.gateway, updateNetworkIPv6Body.gateway) + && Objects.equals(this.nameservers, updateNetworkIPv6Body.nameservers); + } + + 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); + } + + 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 UpdateNetworkIPv6Body {\n"); + sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); + sb.append(" nameservers: ").append(toIndentedString(nameservers)).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")); + + // 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 UpdateNetworkIPv6Body + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateNetworkIPv6Body.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateNetworkIPv6Body.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateNetworkIPv6Body' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateNetworkIPv6Body.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateNetworkIPv6Body value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateNetworkIPv6Body read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateNetworkIPv6Body given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateNetworkIPv6Body + * @throws IOException if the JSON string is invalid with respect to UpdateNetworkIPv6Body + */ + public static UpdateNetworkIPv6Body fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateNetworkIPv6Body.class); + } + + /** + * Convert an instance of UpdateNetworkIPv6Body 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/UpdateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNicPayload.java new file mode 100644 index 0000000..6297150 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateNicPayload.java @@ -0,0 +1,356 @@ +/* + * 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; +import java.util.UUID; + +/** Object that represents a network interface update. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class UpdateNicPayload { + public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; + + @SerializedName(SERIALIZED_NAME_ALLOWED_ADDRESSES) + @javax.annotation.Nullable private List allowedAddresses = new ArrayList<>(); + + 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_NIC_SECURITY = "nicSecurity"; + + @SerializedName(SERIALIZED_NAME_NIC_SECURITY) + @javax.annotation.Nullable private Boolean nicSecurity; + + public static final String SERIALIZED_NAME_SECURITY_GROUPS = "securityGroups"; + + @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) + @javax.annotation.Nullable private List securityGroups = new ArrayList<>(); + + public UpdateNicPayload() {} + + public UpdateNicPayload allowedAddresses( + @javax.annotation.Nullable List allowedAddresses) { + this.allowedAddresses = allowedAddresses; + return this; + } + + public UpdateNicPayload addAllowedAddressesItem(AllowedAddressesInner allowedAddressesItem) { + if (this.allowedAddresses == null) { + this.allowedAddresses = new ArrayList<>(); + } + this.allowedAddresses.add(allowedAddressesItem); + return this; + } + + /** + * A list of IPs or CIDR notations. + * + * @return allowedAddresses + */ + @javax.annotation.Nullable public List getAllowedAddresses() { + return allowedAddresses; + } + + public void setAllowedAddresses( + @javax.annotation.Nullable List allowedAddresses) { + this.allowedAddresses = allowedAddresses; + } + + public UpdateNicPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public UpdateNicPayload 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 UpdateNicPayload nicSecurity(@javax.annotation.Nullable Boolean nicSecurity) { + this.nicSecurity = nicSecurity; + return this; + } + + /** + * If this is set to false, then no security groups will apply to this network interface. + * + * @return nicSecurity + */ + @javax.annotation.Nullable public Boolean getNicSecurity() { + return nicSecurity; + } + + public void setNicSecurity(@javax.annotation.Nullable Boolean nicSecurity) { + this.nicSecurity = nicSecurity; + } + + public UpdateNicPayload securityGroups(@javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + public UpdateNicPayload addSecurityGroupsItem(UUID securityGroupsItem) { + if (this.securityGroups == null) { + this.securityGroups = new ArrayList<>(); + } + this.securityGroups.add(securityGroupsItem); + return this; + } + + /** + * A list of UUIDs. + * + * @return securityGroups + */ + @javax.annotation.Nullable public List getSecurityGroups() { + return securityGroups; + } + + public void setSecurityGroups(@javax.annotation.Nullable List securityGroups) { + this.securityGroups = securityGroups; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateNicPayload updateNicPayload = (UpdateNicPayload) o; + return Objects.equals(this.allowedAddresses, updateNicPayload.allowedAddresses) + && Objects.equals(this.labels, updateNicPayload.labels) + && Objects.equals(this.name, updateNicPayload.name) + && Objects.equals(this.nicSecurity, updateNicPayload.nicSecurity) + && Objects.equals(this.securityGroups, updateNicPayload.securityGroups); + } + + @Override + public int hashCode() { + return Objects.hash(allowedAddresses, labels, name, nicSecurity, securityGroups); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateNicPayload {\n"); + sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + 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("}"); + 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( + "allowedAddresses", + "labels", + "name", + "nicSecurity", + "securityGroups")); + + // 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 UpdateNicPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateNicPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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()) { + JsonArray jsonArrayallowedAddresses = jsonObj.getAsJsonArray("allowedAddresses"); + if (jsonArrayallowedAddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("allowedAddresses").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `allowedAddresses` to be an array in the JSON string but got `%s`", + jsonObj.get("allowedAddresses").toString())); + } + + // validate the optional field `allowedAddresses` (array) + for (int i = 0; i < jsonArrayallowedAddresses.size(); i++) { + AllowedAddressesInner.validateJsonElement(jsonArrayallowedAddresses.get(i)); + } + ; + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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("securityGroups") != null + && !jsonObj.get("securityGroups").isJsonNull() + && !jsonObj.get("securityGroups").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `securityGroups` to be an array in the JSON string but got `%s`", + jsonObj.get("securityGroups").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateNicPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateNicPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateNicPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateNicPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateNicPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateNicPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateNicPayload + * @throws IOException if the JSON string is invalid with respect to UpdateNicPayload + */ + public static UpdateNicPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateNicPayload.class); + } + + /** + * Convert an instance of UpdateNicPayload 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/UpdatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdatePublicIPPayload.java new file mode 100644 index 0000000..9bc2870 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdatePublicIPPayload.java @@ -0,0 +1,297 @@ +/* + * 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; +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.14.0") +public class UpdatePublicIPPayload { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IP = "ip"; + + @SerializedName(SERIALIZED_NAME_IP) + @javax.annotation.Nullable private String ip; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_NETWORK_INTERFACE = "networkInterface"; + + @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) + @javax.annotation.Nullable private UUID networkInterface; + + public UpdatePublicIPPayload() {} + + public UpdatePublicIPPayload(UUID id, String ip) { + this(); + this.id = id; + this.ip = ip; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + /** + * Object that represents an IP address. + * + * @return ip + */ + @javax.annotation.Nullable public String getIp() { + return ip; + } + + public UpdatePublicIPPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public UpdatePublicIPPayload networkInterface( + @javax.annotation.Nullable UUID networkInterface) { + this.networkInterface = networkInterface; + return this; + } + + /** + * Associate the public IP with a network interface (ID). + * + * @return networkInterface + */ + @javax.annotation.Nullable public UUID getNetworkInterface() { + return networkInterface; + } + + public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface) { + this.networkInterface = networkInterface; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePublicIPPayload updatePublicIPPayload = (UpdatePublicIPPayload) 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); + } + + 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(id, ip, labels, networkInterface); + } + + 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 UpdatePublicIPPayload {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + 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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = + new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + + // 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 UpdatePublicIPPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdatePublicIPPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("ip") != null && !jsonObj.get("ip").isJsonNull()) + && !jsonObj.get("ip").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ip` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("ip").toString())); + } + if ((jsonObj.get("networkInterface") != null + && !jsonObj.get("networkInterface").isJsonNull()) + && !jsonObj.get("networkInterface").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `networkInterface` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("networkInterface").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdatePublicIPPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdatePublicIPPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdatePublicIPPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdatePublicIPPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdatePublicIPPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdatePublicIPPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdatePublicIPPayload + * @throws IOException if the JSON string is invalid with respect to UpdatePublicIPPayload + */ + public static UpdatePublicIPPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdatePublicIPPayload.class); + } + + /** + * Convert an instance of UpdatePublicIPPayload 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 new file mode 100644 index 0000000..4dbdfd8 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSecurityGroupPayload.java @@ -0,0 +1,257 @@ +/* + * 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; + +/** Object that represents an update request body of a security group. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class UpdateSecurityGroupPayload { + 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) + @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 UpdateSecurityGroupPayload() {} + + public UpdateSecurityGroupPayload 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 UpdateSecurityGroupPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public UpdateSecurityGroupPayload 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSecurityGroupPayload updateSecurityGroupPayload = (UpdateSecurityGroupPayload) o; + return Objects.equals(this.description, updateSecurityGroupPayload.description) + && Objects.equals(this.labels, updateSecurityGroupPayload.labels) + && Objects.equals(this.name, updateSecurityGroupPayload.name); + } + + @Override + public int hashCode() { + return Objects.hash(description, labels, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSecurityGroupPayload {\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("}"); + 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", "labels", "name")); + + // 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 UpdateSecurityGroupPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSecurityGroupPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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 (!UpdateSecurityGroupPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSecurityGroupPayload' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateSecurityGroupPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSecurityGroupPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSecurityGroupPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSecurityGroupPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSecurityGroupPayload + * @throws IOException if the JSON string is invalid with respect to UpdateSecurityGroupPayload + */ + public static UpdateSecurityGroupPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSecurityGroupPayload.class); + } + + /** + * Convert an instance of UpdateSecurityGroupPayload 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/UpdateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateServerPayload.java new file mode 100644 index 0000000..76c1108 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateServerPayload.java @@ -0,0 +1,251 @@ +/* + * 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; + +/** Object that represents an update request body of a server. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class UpdateServerPayload { + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + @javax.annotation.Nullable private Object labels; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable private Object metadata; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable private String name; + + public UpdateServerPayload() {} + + public UpdateServerPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public UpdateServerPayload metadata(@javax.annotation.Nullable Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. + * ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value + * for a key will remove that key. + * + * @return metadata + */ + @javax.annotation.Nullable public Object getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Object metadata) { + this.metadata = metadata; + } + + public UpdateServerPayload name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name for a Server. + * + * @return name + */ + @javax.annotation.Nullable public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateServerPayload updateServerPayload = (UpdateServerPayload) o; + return Objects.equals(this.labels, updateServerPayload.labels) + && Objects.equals(this.metadata, updateServerPayload.metadata) + && Objects.equals(this.name, updateServerPayload.name); + } + + @Override + public int hashCode() { + return Objects.hash(labels, metadata, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateServerPayload {\n"); + 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("}"); + 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", "metadata", "name")); + + // 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 UpdateServerPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateServerPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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 (!UpdateServerPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateServerPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateServerPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateServerPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateServerPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateServerPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateServerPayload + * @throws IOException if the JSON string is invalid with respect to UpdateServerPayload + */ + public static UpdateServerPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateServerPayload.class); + } + + /** + * Convert an instance of UpdateServerPayload 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/UpdateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSnapshotPayload.java new file mode 100644 index 0000000..9751a4a --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateSnapshotPayload.java @@ -0,0 +1,224 @@ +/* + * 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; + +/** Object that represents an update request body of a snapshot. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class UpdateSnapshotPayload { + 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 UpdateSnapshotPayload() {} + + public UpdateSnapshotPayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public UpdateSnapshotPayload 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSnapshotPayload updateSnapshotPayload = (UpdateSnapshotPayload) o; + return Objects.equals(this.labels, updateSnapshotPayload.labels) + && Objects.equals(this.name, updateSnapshotPayload.name); + } + + @Override + public int hashCode() { + return Objects.hash(labels, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSnapshotPayload {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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", "name")); + + // 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 UpdateSnapshotPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSnapshotPayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!UpdateSnapshotPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSnapshotPayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateSnapshotPayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSnapshotPayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSnapshotPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSnapshotPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSnapshotPayload + * @throws IOException if the JSON string is invalid with respect to UpdateSnapshotPayload + */ + public static UpdateSnapshotPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSnapshotPayload.class); + } + + /** + * Convert an instance of UpdateSnapshotPayload 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/UpdateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateVolumePayload.java new file mode 100644 index 0000000..dfb3f95 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/UpdateVolumePayload.java @@ -0,0 +1,312 @@ +/* + * 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; + +/** Object that represents an update request body of a volume. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class UpdateVolumePayload { + public static final String SERIALIZED_NAME_BOOTABLE = "bootable"; + + @SerializedName(SERIALIZED_NAME_BOOTABLE) + @javax.annotation.Nullable private Boolean bootable; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + + public static final String SERIALIZED_NAME_IMAGE_CONFIG = "imageConfig"; + + @SerializedName(SERIALIZED_NAME_IMAGE_CONFIG) + @javax.annotation.Nullable private ImageConfig imageConfig; + + 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 UpdateVolumePayload() {} + + public UpdateVolumePayload bootable(@javax.annotation.Nullable Boolean bootable) { + this.bootable = bootable; + return this; + } + + /** + * Indicates if a volume is bootable. + * + * @return bootable + */ + @javax.annotation.Nullable public Boolean getBootable() { + return bootable; + } + + public void setBootable(@javax.annotation.Nullable Boolean bootable) { + this.bootable = bootable; + } + + public UpdateVolumePayload 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 UpdateVolumePayload imageConfig(@javax.annotation.Nullable ImageConfig imageConfig) { + this.imageConfig = imageConfig; + return this; + } + + /** + * Get imageConfig + * + * @return imageConfig + */ + @javax.annotation.Nullable public ImageConfig getImageConfig() { + return imageConfig; + } + + public void setImageConfig(@javax.annotation.Nullable ImageConfig imageConfig) { + this.imageConfig = imageConfig; + } + + public UpdateVolumePayload labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public UpdateVolumePayload 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateVolumePayload updateVolumePayload = (UpdateVolumePayload) o; + return Objects.equals(this.bootable, updateVolumePayload.bootable) + && Objects.equals(this.description, updateVolumePayload.description) + && Objects.equals(this.imageConfig, updateVolumePayload.imageConfig) + && Objects.equals(this.labels, updateVolumePayload.labels) + && Objects.equals(this.name, updateVolumePayload.name); + } + + @Override + public int hashCode() { + return Objects.hash(bootable, description, imageConfig, labels, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateVolumePayload {\n"); + sb.append(" bootable: ").append(toIndentedString(bootable)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + 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("}"); + 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("bootable", "description", "imageConfig", "labels", "name")); + + // 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 UpdateVolumePayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateVolumePayload.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } + // validate the optional field `imageConfig` + if (jsonObj.get("imageConfig") != null && !jsonObj.get("imageConfig").isJsonNull()) { + ImageConfig.validateJsonElement(jsonObj.get("imageConfig")); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!UpdateVolumePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateVolumePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateVolumePayload.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateVolumePayload value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateVolumePayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateVolumePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateVolumePayload + * @throws IOException if the JSON string is invalid with respect to UpdateVolumePayload + */ + public static UpdateVolumePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateVolumePayload.class); + } + + /** + * Convert an instance of UpdateVolumePayload 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/Volume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Volume.java new file mode 100644 index 0000000..b1a8373 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/Volume.java @@ -0,0 +1,643 @@ +/* + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; + +/** + * Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class Volume { + public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; + + @SerializedName(SERIALIZED_NAME_AVAILABILITY_ZONE) + @javax.annotation.Nonnull + private String availabilityZone; + + public static final String SERIALIZED_NAME_BOOTABLE = "bootable"; + + @SerializedName(SERIALIZED_NAME_BOOTABLE) + @javax.annotation.Nullable private Boolean bootable; + + 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_ENCRYPTED = "encrypted"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED) + @javax.annotation.Nullable private Boolean encrypted; + + public static final String SERIALIZED_NAME_ENCRYPTION_PARAMETERS = "encryptionParameters"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTION_PARAMETERS) + @javax.annotation.Nullable private VolumeEncryptionParameter encryptionParameters; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable private UUID id; + + public static final String SERIALIZED_NAME_IMAGE_CONFIG = "imageConfig"; + + @SerializedName(SERIALIZED_NAME_IMAGE_CONFIG) + @javax.annotation.Nullable private ImageConfig imageConfig; + + 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_PERFORMANCE_CLASS = "performanceClass"; + + @SerializedName(SERIALIZED_NAME_PERFORMANCE_CLASS) + @javax.annotation.Nullable private String performanceClass; + + public static final String SERIALIZED_NAME_SERVER_ID = "serverId"; + + @SerializedName(SERIALIZED_NAME_SERVER_ID) + @javax.annotation.Nullable private UUID serverId; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable private Long size; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable private VolumeSource source; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable private String status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + + public Volume() {} + + public Volume( + OffsetDateTime createdAt, + Boolean encrypted, + UUID id, + ImageConfig imageConfig, + UUID serverId, + String status, + OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.encrypted = encrypted; + this.id = id; + this.imageConfig = imageConfig; + this.serverId = serverId; + this.status = status; + this.updatedAt = updatedAt; + } + + public Volume availabilityZone(@javax.annotation.Nonnull String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Object that represents an availability zone. + * + * @return availabilityZone + */ + @javax.annotation.Nonnull + public String getAvailabilityZone() { + return availabilityZone; + } + + public void setAvailabilityZone(@javax.annotation.Nonnull String availabilityZone) { + this.availabilityZone = availabilityZone; + } + + public Volume bootable(@javax.annotation.Nullable Boolean bootable) { + this.bootable = bootable; + return this; + } + + /** + * Indicates if a volume is bootable. + * + * @return bootable + */ + @javax.annotation.Nullable public Boolean getBootable() { + return bootable; + } + + public void setBootable(@javax.annotation.Nullable Boolean bootable) { + this.bootable = bootable; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public Volume 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; + } + + public Volume encryptionParameters( + @javax.annotation.Nullable VolumeEncryptionParameter encryptionParameters) { + this.encryptionParameters = encryptionParameters; + return this; + } + + /** + * Get encryptionParameters + * + * @return encryptionParameters + */ + @javax.annotation.Nullable public VolumeEncryptionParameter getEncryptionParameters() { + return encryptionParameters; + } + + public void setEncryptionParameters( + @javax.annotation.Nullable VolumeEncryptionParameter encryptionParameters) { + this.encryptionParameters = encryptionParameters; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return id + */ + @javax.annotation.Nullable public UUID getId() { + return id; + } + + /** + * Get imageConfig + * + * @return imageConfig + */ + @javax.annotation.Nullable public ImageConfig getImageConfig() { + return imageConfig; + } + + public Volume labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public Volume 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 Volume performanceClass(@javax.annotation.Nullable String performanceClass) { + this.performanceClass = performanceClass; + return this; + } + + /** + * The name for a General Object. Matches Names and also UUIDs. + * + * @return performanceClass + */ + @javax.annotation.Nullable public String getPerformanceClass() { + return performanceClass; + } + + public void setPerformanceClass(@javax.annotation.Nullable String performanceClass) { + this.performanceClass = performanceClass; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return serverId + */ + @javax.annotation.Nullable public UUID getServerId() { + return serverId; + } + + public Volume size(@javax.annotation.Nullable Long size) { + this.size = size; + return this; + } + + /** + * Size in Gigabyte. + * + * @return size + */ + @javax.annotation.Nullable public Long getSize() { + return size; + } + + public void setSize(@javax.annotation.Nullable Long size) { + this.size = size; + } + + public Volume source(@javax.annotation.Nullable VolumeSource source) { + this.source = source; + return this; + } + + /** + * Get source + * + * @return source + */ + @javax.annotation.Nullable public VolumeSource getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable VolumeSource source) { + this.source = source; + } + + /** + * The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, + * `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, + * `CREATING`, `DELETED`, `DELETING`, `DETACHING`, + * `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, + * `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, + * `MAINTENANCE`, `RESERVED`, `RESIZING`, + * `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. + * + * @return status + */ + @javax.annotation.Nullable public String getStatus() { + return status; + } + + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Volume volume = (Volume) o; + return Objects.equals(this.availabilityZone, volume.availabilityZone) + && Objects.equals(this.bootable, volume.bootable) + && Objects.equals(this.createdAt, volume.createdAt) + && Objects.equals(this.description, volume.description) + && Objects.equals(this.encrypted, volume.encrypted) + && Objects.equals(this.encryptionParameters, volume.encryptionParameters) + && Objects.equals(this.id, volume.id) + && Objects.equals(this.imageConfig, volume.imageConfig) + && Objects.equals(this.labels, volume.labels) + && Objects.equals(this.name, volume.name) + && Objects.equals(this.performanceClass, volume.performanceClass) + && Objects.equals(this.serverId, volume.serverId) + && Objects.equals(this.size, volume.size) + && Objects.equals(this.source, volume.source) + && Objects.equals(this.status, volume.status) + && Objects.equals(this.updatedAt, volume.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + availabilityZone, + bootable, + createdAt, + description, + encrypted, + encryptionParameters, + id, + imageConfig, + labels, + name, + performanceClass, + serverId, + size, + source, + status, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Volume {\n"); + sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); + sb.append(" bootable: ").append(toIndentedString(bootable)).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(" encryptionParameters: ") + .append(toIndentedString(encryptionParameters)) + .append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + 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(" performanceClass: ").append(toIndentedString(performanceClass)).append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + 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("}"); + 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( + "availabilityZone", + "bootable", + "createdAt", + "description", + "encrypted", + "encryptionParameters", + "id", + "imageConfig", + "labels", + "name", + "performanceClass", + "serverId", + "size", + "source", + "status", + "updatedAt")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("availabilityZone")); + } + + /** + * 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 Volume + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Volume.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("availabilityZone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } + // validate the optional field `encryptionParameters` + if (jsonObj.get("encryptionParameters") != null + && !jsonObj.get("encryptionParameters").isJsonNull()) { + VolumeEncryptionParameter.validateJsonElement(jsonObj.get("encryptionParameters")); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("id").toString())); + } + // validate the optional field `imageConfig` + if (jsonObj.get("imageConfig") != null && !jsonObj.get("imageConfig").isJsonNull()) { + ImageConfig.validateJsonElement(jsonObj.get("imageConfig")); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("performanceClass") != null + && !jsonObj.get("performanceClass").isJsonNull()) + && !jsonObj.get("performanceClass").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `performanceClass` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("performanceClass").toString())); + } + if ((jsonObj.get("serverId") != null && !jsonObj.get("serverId").isJsonNull()) + && !jsonObj.get("serverId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `serverId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("serverId").toString())); + } + // validate the optional field `source` + if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { + VolumeSource.validateJsonElement(jsonObj.get("source")); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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 (!Volume.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Volume' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Volume.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Volume value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Volume read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Volume given an JSON string + * + * @param jsonString JSON string + * @return An instance of Volume + * @throws IOException if the JSON string is invalid with respect to Volume + */ + public static Volume fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Volume.class); + } + + /** + * Convert an instance of Volume 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/VolumeAttachment.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachment.java new file mode 100644 index 0000000..03f6a71 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachment.java @@ -0,0 +1,246 @@ +/* + * 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; +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.14.0") +public class VolumeAttachment { + public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; + + @SerializedName(SERIALIZED_NAME_DELETE_ON_TERMINATION) + @javax.annotation.Nullable private Boolean deleteOnTermination; + + public static final String SERIALIZED_NAME_SERVER_ID = "serverId"; + + @SerializedName(SERIALIZED_NAME_SERVER_ID) + @javax.annotation.Nullable private UUID serverId; + + public static final String SERIALIZED_NAME_VOLUME_ID = "volumeId"; + + @SerializedName(SERIALIZED_NAME_VOLUME_ID) + @javax.annotation.Nullable private UUID volumeId; + + public VolumeAttachment() {} + + public VolumeAttachment(UUID serverId, UUID volumeId) { + this(); + this.serverId = serverId; + this.volumeId = volumeId; + } + + public VolumeAttachment deleteOnTermination( + @javax.annotation.Nullable Boolean deleteOnTermination) { + this.deleteOnTermination = deleteOnTermination; + return this; + } + + /** + * Delete the volume during the termination of the server. Defaults to false. + * + * @return deleteOnTermination + */ + @javax.annotation.Nullable public Boolean getDeleteOnTermination() { + return deleteOnTermination; + } + + public void setDeleteOnTermination(@javax.annotation.Nullable Boolean deleteOnTermination) { + this.deleteOnTermination = deleteOnTermination; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return serverId + */ + @javax.annotation.Nullable public UUID getServerId() { + return serverId; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return volumeId + */ + @javax.annotation.Nullable public UUID getVolumeId() { + return volumeId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VolumeAttachment volumeAttachment = (VolumeAttachment) o; + return Objects.equals(this.deleteOnTermination, volumeAttachment.deleteOnTermination) + && Objects.equals(this.serverId, volumeAttachment.serverId) + && Objects.equals(this.volumeId, volumeAttachment.volumeId); + } + + @Override + public int hashCode() { + return Objects.hash(deleteOnTermination, serverId, volumeId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VolumeAttachment {\n"); + sb.append(" deleteOnTermination: ") + .append(toIndentedString(deleteOnTermination)) + .append("\n"); + sb.append(" serverId: ").append(toIndentedString(serverId)).append("\n"); + sb.append(" volumeId: ").append(toIndentedString(volumeId)).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("deleteOnTermination", "serverId", "volumeId")); + + // 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 VolumeAttachment + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VolumeAttachment.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `serverId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("serverId").toString())); + } + if ((jsonObj.get("volumeId") != null && !jsonObj.get("volumeId").isJsonNull()) + && !jsonObj.get("volumeId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `volumeId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("volumeId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VolumeAttachment.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VolumeAttachment' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(VolumeAttachment.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, VolumeAttachment value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VolumeAttachment read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of VolumeAttachment given an JSON string + * + * @param jsonString JSON string + * @return An instance of VolumeAttachment + * @throws IOException if the JSON string is invalid with respect to VolumeAttachment + */ + public static VolumeAttachment fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VolumeAttachment.class); + } + + /** + * Convert an instance of VolumeAttachment 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/VolumeAttachmentListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachmentListResponse.java new file mode 100644 index 0000000..55ca9e5 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeAttachmentListResponse.java @@ -0,0 +1,232 @@ +/* + * 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; + +/** Volume attachment list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class VolumeAttachmentListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public VolumeAttachmentListResponse() {} + + public VolumeAttachmentListResponse items( + @javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public VolumeAttachmentListResponse addItemsItem(VolumeAttachment itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list containing Volume attachments of a server. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VolumeAttachmentListResponse volumeAttachmentListResponse = + (VolumeAttachmentListResponse) o; + return Objects.equals(this.items, volumeAttachmentListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VolumeAttachmentListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 + * VolumeAttachmentListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VolumeAttachmentListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + VolumeAttachment.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VolumeAttachmentListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VolumeAttachmentListResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(VolumeAttachmentListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, VolumeAttachmentListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VolumeAttachmentListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of VolumeAttachmentListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of VolumeAttachmentListResponse + * @throws IOException if the JSON string is invalid with respect to + * VolumeAttachmentListResponse + */ + public static VolumeAttachmentListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VolumeAttachmentListResponse.class); + } + + /** + * Convert an instance of VolumeAttachmentListResponse 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/VolumeEncryptionParameter.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeEncryptionParameter.java new file mode 100644 index 0000000..56375e4 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeEncryptionParameter.java @@ -0,0 +1,386 @@ +/* + * 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; +import java.util.UUID; + +/** + * Parameter to connect to a key-encryption-key within the STACKIT-KMS to create encrypted volumes. + * If no key_payload is set, a random passphrase is generated, which will be encrypted against the + * STACKIT-KMS. These parameter never leave the backend again. So these parameters are not in the + * responses. + */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class VolumeEncryptionParameter { + public static final String SERIALIZED_NAME_KEK_KEY_ID = "kekKeyId"; + + @SerializedName(SERIALIZED_NAME_KEK_KEY_ID) + @javax.annotation.Nonnull + private UUID kekKeyId; + + public static final String SERIALIZED_NAME_KEK_KEY_VERSION = "kekKeyVersion"; + + @SerializedName(SERIALIZED_NAME_KEK_KEY_VERSION) + @javax.annotation.Nonnull + private Long kekKeyVersion; + + public static final String SERIALIZED_NAME_KEK_KEYRING_ID = "kekKeyringId"; + + @SerializedName(SERIALIZED_NAME_KEK_KEYRING_ID) + @javax.annotation.Nonnull + private UUID kekKeyringId; + + public static final String SERIALIZED_NAME_KEK_PROJECT_ID = "kekProjectId"; + + @SerializedName(SERIALIZED_NAME_KEK_PROJECT_ID) + @javax.annotation.Nullable private UUID kekProjectId; + + public static final String SERIALIZED_NAME_KEY_PAYLOAD = "keyPayload"; + + @SerializedName(SERIALIZED_NAME_KEY_PAYLOAD) + @javax.annotation.Nullable private byte[] keyPayload; + + public static final String SERIALIZED_NAME_SERVICE_ACCOUNT = "serviceAccount"; + + @SerializedName(SERIALIZED_NAME_SERVICE_ACCOUNT) + @javax.annotation.Nonnull + private String serviceAccount; + + public VolumeEncryptionParameter() {} + + public VolumeEncryptionParameter kekKeyId(@javax.annotation.Nonnull UUID kekKeyId) { + this.kekKeyId = kekKeyId; + return this; + } + + /** + * UUID of the Key within the STACKIT-KMS to use for the encryption. + * + * @return kekKeyId + */ + @javax.annotation.Nonnull + public UUID getKekKeyId() { + return kekKeyId; + } + + public void setKekKeyId(@javax.annotation.Nonnull UUID kekKeyId) { + this.kekKeyId = kekKeyId; + } + + public VolumeEncryptionParameter kekKeyVersion(@javax.annotation.Nonnull Long kekKeyVersion) { + this.kekKeyVersion = kekKeyVersion; + return this; + } + + /** + * Version of the key within the STACKIT-KMS to use for the encryption. + * + * @return kekKeyVersion + */ + @javax.annotation.Nonnull + public Long getKekKeyVersion() { + return kekKeyVersion; + } + + public void setKekKeyVersion(@javax.annotation.Nonnull Long kekKeyVersion) { + this.kekKeyVersion = kekKeyVersion; + } + + public VolumeEncryptionParameter kekKeyringId(@javax.annotation.Nonnull UUID kekKeyringId) { + this.kekKeyringId = kekKeyringId; + return this; + } + + /** + * UUID of the keyring where the key is located within the STACKTI-KMS. + * + * @return kekKeyringId + */ + @javax.annotation.Nonnull + public UUID getKekKeyringId() { + return kekKeyringId; + } + + public void setKekKeyringId(@javax.annotation.Nonnull UUID kekKeyringId) { + this.kekKeyringId = kekKeyringId; + } + + public VolumeEncryptionParameter kekProjectId(@javax.annotation.Nullable UUID kekProjectId) { + this.kekProjectId = kekProjectId; + return this; + } + + /** + * Id of the project, where the key in the STACKIT-KMS belongs to, in case the key is located in + * a different project. By default the same project ID is used, like for the volume itself. + * Defining a key in a different project is only allowed for privileged internal projects. + * + * @return kekProjectId + */ + @javax.annotation.Nullable public UUID getKekProjectId() { + return kekProjectId; + } + + public void setKekProjectId(@javax.annotation.Nullable UUID kekProjectId) { + this.kekProjectId = kekProjectId; + } + + public VolumeEncryptionParameter keyPayload(@javax.annotation.Nullable byte[] keyPayload) { + this.keyPayload = keyPayload; + return this; + } + + /** + * Optional predefined secret, which will be encrypted against the key-encryption-key within the + * STACKIT-KMS. If not defined, a random secret will be generated by the API and encrypted + * against the STACKIT-KMS. If a key-payload is provided here, it must be base64 encoded. + * + * @return keyPayload + */ + @javax.annotation.Nullable public byte[] getKeyPayload() { + return keyPayload; + } + + public void setKeyPayload(@javax.annotation.Nullable byte[] keyPayload) { + this.keyPayload = keyPayload; + } + + public VolumeEncryptionParameter serviceAccount( + @javax.annotation.Nonnull String serviceAccount) { + this.serviceAccount = serviceAccount; + return this; + } + + /** + * Service-Account linked to the Key within the STACKIT-KMS. + * + * @return serviceAccount + */ + @javax.annotation.Nonnull + public String getServiceAccount() { + return serviceAccount; + } + + public void setServiceAccount(@javax.annotation.Nonnull String serviceAccount) { + this.serviceAccount = serviceAccount; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VolumeEncryptionParameter volumeEncryptionParameter = (VolumeEncryptionParameter) o; + return Objects.equals(this.kekKeyId, volumeEncryptionParameter.kekKeyId) + && Objects.equals(this.kekKeyVersion, volumeEncryptionParameter.kekKeyVersion) + && Objects.equals(this.kekKeyringId, volumeEncryptionParameter.kekKeyringId) + && Objects.equals(this.kekProjectId, volumeEncryptionParameter.kekProjectId) + && Arrays.equals(this.keyPayload, volumeEncryptionParameter.keyPayload) + && Objects.equals(this.serviceAccount, volumeEncryptionParameter.serviceAccount); + } + + @Override + public int hashCode() { + return Objects.hash( + kekKeyId, + kekKeyVersion, + kekKeyringId, + kekProjectId, + Arrays.hashCode(keyPayload), + serviceAccount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VolumeEncryptionParameter {\n"); + sb.append(" kekKeyId: ").append(toIndentedString(kekKeyId)).append("\n"); + sb.append(" kekKeyVersion: ").append(toIndentedString(kekKeyVersion)).append("\n"); + sb.append(" kekKeyringId: ").append(toIndentedString(kekKeyringId)).append("\n"); + 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("}"); + 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( + "kekKeyId", + "kekKeyVersion", + "kekKeyringId", + "kekProjectId", + "keyPayload", + "serviceAccount")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = + new HashSet( + Arrays.asList( + "kekKeyId", "kekKeyVersion", "kekKeyringId", "serviceAccount")); + } + + /** + * 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 VolumeEncryptionParameter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VolumeEncryptionParameter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("kekKeyId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `kekKeyringId` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("kekKeyringId").toString())); + } + if ((jsonObj.get("kekProjectId") != null && !jsonObj.get("kekProjectId").isJsonNull()) + && !jsonObj.get("kekProjectId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "Expected the field `serviceAccount` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("serviceAccount").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VolumeEncryptionParameter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VolumeEncryptionParameter' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(VolumeEncryptionParameter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, VolumeEncryptionParameter value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VolumeEncryptionParameter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of VolumeEncryptionParameter given an JSON string + * + * @param jsonString JSON string + * @return An instance of VolumeEncryptionParameter + * @throws IOException if the JSON string is invalid with respect to VolumeEncryptionParameter + */ + public static VolumeEncryptionParameter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VolumeEncryptionParameter.class); + } + + /** + * Convert an instance of VolumeEncryptionParameter 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/VolumeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeListResponse.java new file mode 100644 index 0000000..d11b7b1 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeListResponse.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Volume list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class VolumeListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public VolumeListResponse() {} + + public VolumeListResponse items(@javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public VolumeListResponse addItemsItem(Volume itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list containing volume objects. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VolumeListResponse volumeListResponse = (VolumeListResponse) o; + return Objects.equals(this.items, volumeListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VolumeListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 VolumeListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VolumeListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + Volume.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VolumeListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VolumeListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(VolumeListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, VolumeListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VolumeListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of VolumeListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of VolumeListResponse + * @throws IOException if the JSON string is invalid with respect to VolumeListResponse + */ + public static VolumeListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VolumeListResponse.class); + } + + /** + * Convert an instance of VolumeListResponse 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/VolumePerformanceClass.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClass.java new file mode 100644 index 0000000..1f87c05 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClass.java @@ -0,0 +1,319 @@ +/* + * 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; + +/** Object that represents a Volume performance class. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class VolumePerformanceClass { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + + public static final String SERIALIZED_NAME_IOPS = "iops"; + + @SerializedName(SERIALIZED_NAME_IOPS) + @javax.annotation.Nullable private Long iops; + + 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_THROUGHPUT = "throughput"; + + @SerializedName(SERIALIZED_NAME_THROUGHPUT) + @javax.annotation.Nullable private Long throughput; + + public VolumePerformanceClass() {} + + public VolumePerformanceClass 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 VolumePerformanceClass iops(@javax.annotation.Nullable Long iops) { + this.iops = iops; + return this; + } + + /** + * Input/Output Operations per second. + * + * @return iops + */ + @javax.annotation.Nullable public Long getIops() { + return iops; + } + + public void setIops(@javax.annotation.Nullable Long iops) { + this.iops = iops; + } + + public VolumePerformanceClass labels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + return this; + } + + /** + * Object that represents the labels of an object. Regex for keys: + * `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: + * `^(-|_|[a-z0-9]){0,63}$`. Providing a `null` value for a key will remove + * that key. + * + * @return labels + */ + @javax.annotation.Nullable public Object getLabels() { + return labels; + } + + public void setLabels(@javax.annotation.Nullable Object labels) { + this.labels = labels; + } + + public VolumePerformanceClass 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 VolumePerformanceClass throughput(@javax.annotation.Nullable Long throughput) { + this.throughput = throughput; + return this; + } + + /** + * Throughput in Megabyte per second. + * + * @return throughput + */ + @javax.annotation.Nullable public Long getThroughput() { + return throughput; + } + + public void setThroughput(@javax.annotation.Nullable Long throughput) { + this.throughput = throughput; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VolumePerformanceClass volumePerformanceClass = (VolumePerformanceClass) o; + return Objects.equals(this.description, volumePerformanceClass.description) + && Objects.equals(this.iops, volumePerformanceClass.iops) + && Objects.equals(this.labels, volumePerformanceClass.labels) + && Objects.equals(this.name, volumePerformanceClass.name) + && Objects.equals(this.throughput, volumePerformanceClass.throughput); + } + + @Override + public int hashCode() { + return Objects.hash(description, iops, labels, name, throughput); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VolumePerformanceClass {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" iops: ").append(toIndentedString(iops)).append("\n"); + 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("}"); + 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", "iops", "labels", "name", "throughput")); + + // 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 VolumePerformanceClass + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VolumePerformanceClass.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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( + "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 (!VolumePerformanceClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VolumePerformanceClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(VolumePerformanceClass.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, VolumePerformanceClass value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VolumePerformanceClass read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of VolumePerformanceClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of VolumePerformanceClass + * @throws IOException if the JSON string is invalid with respect to VolumePerformanceClass + */ + public static VolumePerformanceClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VolumePerformanceClass.class); + } + + /** + * Convert an instance of VolumePerformanceClass 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/VolumePerformanceClassListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClassListResponse.java new file mode 100644 index 0000000..517093c --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumePerformanceClassListResponse.java @@ -0,0 +1,235 @@ +/* + * 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; + +/** Volume performance class list response. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class VolumePerformanceClassListResponse { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + @javax.annotation.Nonnull + private List items = new ArrayList<>(); + + public VolumePerformanceClassListResponse() {} + + public VolumePerformanceClassListResponse items( + @javax.annotation.Nonnull List items) { + this.items = items; + return this; + } + + public VolumePerformanceClassListResponse addItemsItem(VolumePerformanceClass itemsItem) { + if (this.items == null) { + this.items = new ArrayList<>(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list containing Volume performance classes. + * + * @return items + */ + @javax.annotation.Nonnull + public List getItems() { + return items; + } + + public void setItems(@javax.annotation.Nonnull List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VolumePerformanceClassListResponse volumePerformanceClassListResponse = + (VolumePerformanceClassListResponse) o; + return Objects.equals(this.items, volumePerformanceClassListResponse.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VolumePerformanceClassListResponse {\n"); + sb.append(" items: ").append(toIndentedString(items)).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 + * VolumePerformanceClassListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VolumePerformanceClassListResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "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( + "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++) { + VolumePerformanceClass.validateJsonElement(jsonArrayitems.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VolumePerformanceClassListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VolumePerformanceClassListResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(VolumePerformanceClassListResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, VolumePerformanceClassListResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VolumePerformanceClassListResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of VolumePerformanceClassListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of VolumePerformanceClassListResponse + * @throws IOException if the JSON string is invalid with respect to + * VolumePerformanceClassListResponse + */ + public static VolumePerformanceClassListResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, VolumePerformanceClassListResponse.class); + } + + /** + * Convert an instance of VolumePerformanceClassListResponse 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/VolumeSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeSource.java new file mode 100644 index 0000000..4039c24 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/VolumeSource.java @@ -0,0 +1,241 @@ +/* + * 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; +import java.util.UUID; + +/** The source object of a volume. */ +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.14.0") +public class VolumeSource { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private UUID id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public VolumeSource() {} + + public VolumeSource 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 VolumeSource type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The source types of a volume. Possible values: `image`, `volume`, + * `snapshot`, `backup`. + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VolumeSource volumeSource = (VolumeSource) o; + return Objects.equals(this.id, volumeSource.id) + && Objects.equals(this.type, volumeSource.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VolumeSource {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "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 VolumeSource + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VolumeSource.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "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( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "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( + "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 (!VolumeSource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VolumeSource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(VolumeSource.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, VolumeSource value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VolumeSource read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of VolumeSource given an JSON string + * + * @param jsonString JSON string + * @return An instance of VolumeSource + * @throws IOException if the JSON string is invalid with respect to VolumeSource + */ + public static VolumeSource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VolumeSource.class); + } + + /** + * Convert an instance of VolumeSource to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/services/resourcemanager/build.gradle b/services/resourcemanager/build.gradle index ec484aa..10cd648 100644 --- a/services/resourcemanager/build.gradle +++ b/services/resourcemanager/build.gradle @@ -4,7 +4,6 @@ ext { } dependencies { - implementation project (':core') implementation "com.google.code.findbugs:jsr305:3.0.2" implementation 'com.squareup.okhttp3:okhttp:4.12.0' implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/api/DefaultApi.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/api/DefaultApi.java index 19e9bda..6ca7519 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/api/DefaultApi.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/api/DefaultApi.java @@ -41,7 +41,8 @@ import java.util.List; import java.util.Map; -public class DefaultApi { +// Package-private access to enforce service-specific API usage (DefaultApi => Api) +class DefaultApi { private ApiClient localVarApiClient; private int localHostIndex; private String localCustomBaseUrl; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/api/ResourceManagerApi.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/api/ResourceManagerApi.java new file mode 100644 index 0000000..c48b804 --- /dev/null +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/api/ResourceManagerApi.java @@ -0,0 +1,14 @@ +package cloud.stackit.sdk.resourcemanager.api; + +import cloud.stackit.sdk.core.config.CoreConfiguration; +import java.io.IOException; + +public class ResourceManagerApi extends DefaultApi { + public ResourceManagerApi() throws IOException { + super(); + } + + public ResourceManagerApi(CoreConfiguration configuration) throws IOException { + super(configuration); + } +} From 721f0fdecfe02045e320675fa29d38a1517f8057 Mon Sep 17 00:00:00 2001 From: Ruben Hoenle Date: Mon, 25 Aug 2025 18:01:40 +0200 Subject: [PATCH 2/4] chore(sdk): bump openapi generator version --- .../examples/AuthenticationExample.java | 4 +-- .../examples/ResourcemanagerExample.java | 4 +-- .../java/cloud/stackit/sdk/iaas/Pair.java | 34 ++++--------------- .../stackit/sdk/iaas/ServerConfiguration.java | 2 +- .../stackit/sdk/iaas/ServerVariable.java | 2 +- .../cloud/stackit/sdk/iaas/StringUtil.java | 2 +- .../sdk/iaas/model/AbstractOpenApiSchema.java | 2 +- .../iaas/model/AddVolumeToServerPayload.java | 2 +- .../stackit/sdk/iaas/model/AffinityGroup.java | 2 +- .../iaas/model/AffinityGroupListResponse.java | 2 +- .../sdk/iaas/model/AllowedAddressesInner.java | 2 +- .../cloud/stackit/sdk/iaas/model/Area.java | 2 +- .../stackit/sdk/iaas/model/AreaConfig.java | 2 +- .../cloud/stackit/sdk/iaas/model/AreaId.java | 2 +- .../sdk/iaas/model/AreaPrefixConfigIPv4.java | 2 +- .../model/AvailabilityZoneListResponse.java | 2 +- .../cloud/stackit/sdk/iaas/model/Backup.java | 2 +- .../sdk/iaas/model/BackupListResponse.java | 2 +- .../stackit/sdk/iaas/model/BackupSource.java | 2 +- .../sdk/iaas/model/BaseSecurityGroupRule.java | 2 +- .../stackit/sdk/iaas/model/BootVolume.java | 2 +- .../sdk/iaas/model/BootVolumeSource.java | 2 +- .../model/CreateAffinityGroupPayload.java | 2 +- .../iaas/model/CreateAreaAddressFamily.java | 2 +- .../sdk/iaas/model/CreateAreaIPv4.java | 2 +- .../sdk/iaas/model/CreateBackupPayload.java | 2 +- .../sdk/iaas/model/CreateImagePayload.java | 2 +- .../sdk/iaas/model/CreateKeyPairPayload.java | 2 +- .../model/CreateNetworkAddressFamily.java | 2 +- .../iaas/model/CreateNetworkAreaPayload.java | 2 +- .../model/CreateNetworkAreaRangePayload.java | 2 +- .../model/CreateNetworkAreaRoutePayload.java | 2 +- .../sdk/iaas/model/CreateNetworkIPv4Body.java | 2 +- .../sdk/iaas/model/CreateNetworkIPv6Body.java | 2 +- .../sdk/iaas/model/CreateNetworkPayload.java | 2 +- .../sdk/iaas/model/CreateNicPayload.java | 2 +- .../sdk/iaas/model/CreateProtocol.java | 2 +- .../sdk/iaas/model/CreatePublicIPPayload.java | 2 +- .../model/CreateSecurityGroupPayload.java | 2 +- .../model/CreateSecurityGroupRulePayload.java | 2 +- .../CreateSecurityGroupRuleProtocol.java | 2 +- .../iaas/model/CreateServerNetworking.java | 2 +- .../model/CreateServerNetworkingWithNics.java | 2 +- .../sdk/iaas/model/CreateServerPayload.java | 2 +- .../model/CreateServerPayloadNetworking.java | 2 +- .../sdk/iaas/model/CreateSnapshotPayload.java | 2 +- .../sdk/iaas/model/CreateVolumePayload.java | 2 +- .../cloud/stackit/sdk/iaas/model/Error.java | 2 +- .../iaas/model/GetServerLog200Response.java | 2 +- .../sdk/iaas/model/ICMPParameters.java | 2 +- .../cloud/stackit/sdk/iaas/model/Image.java | 2 +- .../stackit/sdk/iaas/model/ImageAgent.java | 2 +- .../stackit/sdk/iaas/model/ImageChecksum.java | 2 +- .../stackit/sdk/iaas/model/ImageConfig.java | 2 +- .../sdk/iaas/model/ImageCreateResponse.java | 2 +- .../sdk/iaas/model/ImageListResponse.java | 2 +- .../stackit/sdk/iaas/model/ImageShare.java | 2 +- .../sdk/iaas/model/ImageShareConsumer.java | 2 +- .../sdk/iaas/model/KeyPairListResponse.java | 2 +- .../cloud/stackit/sdk/iaas/model/Keypair.java | 2 +- .../stackit/sdk/iaas/model/MachineType.java | 2 +- .../iaas/model/MachineTypeListResponse.java | 2 +- .../cloud/stackit/sdk/iaas/model/NIC.java | 2 +- .../sdk/iaas/model/NICListResponse.java | 2 +- .../cloud/stackit/sdk/iaas/model/Network.java | 2 +- .../stackit/sdk/iaas/model/NetworkArea.java | 2 +- .../sdk/iaas/model/NetworkAreaIPv4.java | 2 +- .../iaas/model/NetworkAreaListResponse.java | 2 +- .../sdk/iaas/model/NetworkListResponse.java | 2 +- .../stackit/sdk/iaas/model/NetworkRange.java | 2 +- .../iaas/model/NetworkRangeListResponse.java | 2 +- .../PartialUpdateNetworkAreaPayload.java | 2 +- .../model/PartialUpdateNetworkPayload.java | 2 +- .../stackit/sdk/iaas/model/PortRange.java | 2 +- .../cloud/stackit/sdk/iaas/model/Project.java | 2 +- .../sdk/iaas/model/ProjectListResponse.java | 2 +- .../stackit/sdk/iaas/model/Protocol.java | 2 +- .../stackit/sdk/iaas/model/PublicIp.java | 2 +- .../sdk/iaas/model/PublicIpListResponse.java | 2 +- .../stackit/sdk/iaas/model/PublicNetwork.java | 2 +- .../iaas/model/PublicNetworkListResponse.java | 2 +- .../cloud/stackit/sdk/iaas/model/Quota.java | 2 +- .../stackit/sdk/iaas/model/QuotaList.java | 2 +- .../sdk/iaas/model/QuotaListResponse.java | 2 +- .../cloud/stackit/sdk/iaas/model/Request.java | 2 +- .../sdk/iaas/model/RequestResource.java | 2 +- .../sdk/iaas/model/RescueServerPayload.java | 2 +- .../sdk/iaas/model/ResizeServerPayload.java | 2 +- .../sdk/iaas/model/ResizeVolumePayload.java | 2 +- .../cloud/stackit/sdk/iaas/model/Route.java | 2 +- .../sdk/iaas/model/RouteListResponse.java | 2 +- .../stackit/sdk/iaas/model/SecurityGroup.java | 2 +- .../iaas/model/SecurityGroupListResponse.java | 2 +- .../sdk/iaas/model/SecurityGroupRule.java | 2 +- .../model/SecurityGroupRuleListResponse.java | 2 +- .../iaas/model/SecurityGroupRuleProtocol.java | 2 +- .../cloud/stackit/sdk/iaas/model/Server.java | 2 +- .../sdk/iaas/model/ServerConsoleUrl.java | 2 +- .../sdk/iaas/model/ServerListResponse.java | 2 +- .../sdk/iaas/model/ServerMaintenance.java | 2 +- .../stackit/sdk/iaas/model/ServerNetwork.java | 2 +- .../model/ServiceAccountMailListResponse.java | 2 +- .../sdk/iaas/model/SetImageSharePayload.java | 2 +- .../stackit/sdk/iaas/model/Snapshot.java | 2 +- .../sdk/iaas/model/SnapshotListResponse.java | 2 +- .../iaas/model/UpdateAreaAddressFamily.java | 2 +- .../sdk/iaas/model/UpdateAreaIPv4.java | 2 +- .../model/UpdateAttachedVolumePayload.java | 2 +- .../sdk/iaas/model/UpdateBackupPayload.java | 2 +- .../sdk/iaas/model/UpdateImagePayload.java | 2 +- .../iaas/model/UpdateImageSharePayload.java | 2 +- .../sdk/iaas/model/UpdateKeyPairPayload.java | 2 +- .../model/UpdateNetworkAddressFamily.java | 2 +- .../model/UpdateNetworkAreaRoutePayload.java | 2 +- .../sdk/iaas/model/UpdateNetworkIPv4Body.java | 2 +- .../sdk/iaas/model/UpdateNetworkIPv6Body.java | 2 +- .../sdk/iaas/model/UpdateNicPayload.java | 2 +- .../sdk/iaas/model/UpdatePublicIPPayload.java | 2 +- .../model/UpdateSecurityGroupPayload.java | 2 +- .../sdk/iaas/model/UpdateServerPayload.java | 2 +- .../sdk/iaas/model/UpdateSnapshotPayload.java | 2 +- .../sdk/iaas/model/UpdateVolumePayload.java | 2 +- .../cloud/stackit/sdk/iaas/model/Volume.java | 2 +- .../sdk/iaas/model/VolumeAttachment.java | 2 +- .../model/VolumeAttachmentListResponse.java | 2 +- .../iaas/model/VolumeEncryptionParameter.java | 2 +- .../sdk/iaas/model/VolumeListResponse.java | 2 +- .../iaas/model/VolumePerformanceClass.java | 2 +- .../VolumePerformanceClassListResponse.java | 2 +- .../stackit/sdk/iaas/model/VolumeSource.java | 2 +- .../stackit/sdk/resourcemanager/Pair.java | 34 ++++--------------- .../resourcemanager/ServerConfiguration.java | 2 +- .../sdk/resourcemanager/ServerVariable.java | 2 +- .../sdk/resourcemanager/StringUtil.java | 2 +- .../model/AbstractOpenApiSchema.java | 2 +- .../model/CreateFolderPayload.java | 2 +- .../model/CreateProjectPayload.java | 2 +- .../resourcemanager/model/ErrorResponse.java | 2 +- .../resourcemanager/model/FolderResponse.java | 2 +- .../model/GetFolderDetailsResponse.java | 2 +- .../model/GetProjectResponse.java | 2 +- .../model/ListFoldersResponse.java | 2 +- .../model/ListFoldersResponseItemsInner.java | 2 +- .../model/ListOrganizationsResponse.java | 2 +- .../ListOrganizationsResponseItemsInner.java | 2 +- .../model/ListProjectsResponse.java | 2 +- .../sdk/resourcemanager/model/Member.java | 2 +- .../model/OrganizationResponse.java | 2 +- .../sdk/resourcemanager/model/Parent.java | 2 +- .../model/ParentListInner.java | 2 +- .../model/PartialUpdateFolderPayload.java | 2 +- .../PartialUpdateOrganizationPayload.java | 2 +- .../model/PartialUpdateProjectPayload.java | 2 +- .../sdk/resourcemanager/model/Project.java | 2 +- 154 files changed, 168 insertions(+), 208 deletions(-) diff --git a/examples/authentication/src/main/java/cloud/stackit/sdk/authentication/examples/AuthenticationExample.java b/examples/authentication/src/main/java/cloud/stackit/sdk/authentication/examples/AuthenticationExample.java index 95bcd8e..89d6f54 100644 --- a/examples/authentication/src/main/java/cloud/stackit/sdk/authentication/examples/AuthenticationExample.java +++ b/examples/authentication/src/main/java/cloud/stackit/sdk/authentication/examples/AuthenticationExample.java @@ -1,7 +1,7 @@ package cloud.stackit.sdk.authentication.examples; import cloud.stackit.sdk.core.config.CoreConfiguration; -import cloud.stackit.sdk.resourcemanager.api.DefaultApi; +import cloud.stackit.sdk.resourcemanager.api.ResourceManagerApi; import cloud.stackit.sdk.resourcemanager.model.ListOrganizationsResponse; class AuthenticationExample { @@ -13,7 +13,7 @@ public static void main(String[] args) { new CoreConfiguration().serviceAccountKeyPath(SERVICE_ACCOUNT_KEY_PATH); try { - DefaultApi api = new DefaultApi(config); + ResourceManagerApi api = new ResourceManagerApi(config); /* list all organizations */ ListOrganizationsResponse response = diff --git a/examples/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/examples/ResourcemanagerExample.java b/examples/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/examples/ResourcemanagerExample.java index 7979ba7..d6d669f 100644 --- a/examples/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/examples/ResourcemanagerExample.java +++ b/examples/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/examples/ResourcemanagerExample.java @@ -1,7 +1,7 @@ package cloud.stackit.sdk.resourcemanager.examples; import cloud.stackit.sdk.core.exception.ApiException; -import cloud.stackit.sdk.resourcemanager.api.DefaultApi; +import cloud.stackit.sdk.resourcemanager.api.ResourceManagerApi; import cloud.stackit.sdk.resourcemanager.model.CreateFolderPayload; import cloud.stackit.sdk.resourcemanager.model.CreateProjectPayload; import cloud.stackit.sdk.resourcemanager.model.FolderResponse; @@ -14,7 +14,7 @@ class ResourcemanagerExample { public static void main(String[] args) throws IOException { // Credentials are read from the credentialsFile in `~/.stackit/credentials.json` or the env // STACKIT_SERVICE_ACCOUNT_KEY_PATH / STACKIT_SERVICE_ACCOUNT_KEY - DefaultApi resourceManagerApi = new DefaultApi(); + ResourceManagerApi resourceManagerApi = new ResourceManagerApi(); // replace this with something useful for real use UUID containerParentId = UUID.randomUUID(); 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 e37edc8..25a73fd 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 @@ -14,30 +14,14 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Pair { - private String name = ""; - private String value = ""; + private final String name; + private final String value; public Pair(String name, String value) { - setName(name); - setValue(value); - } - - private void setName(String name) { - if (!isValidString(name)) { - return; - } - - this.name = name; - } - - private void setValue(String value) { - if (!isValidString(value)) { - return; - } - - this.value = value; + this.name = isValidString(name) ? name : ""; + this.value = isValidString(value) ? value : ""; } public String getName() { @@ -48,11 +32,7 @@ public String getValue() { return this.value; } - private boolean isValidString(String arg) { - if (arg == null) { - return false; - } - - return true; + private static boolean isValidString(String arg) { + return arg != null; } } 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 fc513df..37083c1 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 @@ -17,7 +17,7 @@ /** Representing a Server configuration. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.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 1e36e5c..b3e35f0 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 @@ -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.14.0") + comments = "Generator version: 7.15.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 e2234e5..8509051 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 @@ -17,7 +17,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.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/model/AbstractOpenApiSchema.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AbstractOpenApiSchema.java index 0b12cb3..f24c23e 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 @@ -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.14.0") + comments = "Generator version: 7.15.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/AddVolumeToServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/model/AddVolumeToServerPayload.java index 3b87dd3..e070bec 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 @@ -33,7 +33,7 @@ /** Object that represents a Volume attachment to a server. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class AddVolumeToServerPayload { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; 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 4e85a86..8dfea6a 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 @@ -35,7 +35,7 @@ /** Definition of an affinity group. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class AffinityGroup { public static final String SERIALIZED_NAME_ID = "id"; 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 9564365..874bb38 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 @@ -35,7 +35,7 @@ /** Response object for affinity group list request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class AffinityGroupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 34590b1..6f11142 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 @@ -30,7 +30,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class AllowedAddressesInner extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(AllowedAddressesInner.class.getName()); 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 index debd215..27ab1a7 100644 --- 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 @@ -35,7 +35,7 @@ /** The basic properties of a network area. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Area { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; 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 index 448a2ce..e6fc116 100644 --- 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 @@ -35,7 +35,7 @@ /** The basic network area object. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class AreaConfig { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; 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 7af8eb0..51dd31d 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 @@ -30,7 +30,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class AreaId extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(AreaId.class.getName()); 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 index ff50a2a..c8228ee 100644 --- 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 @@ -32,7 +32,7 @@ /** The IPv4 prefix config for a network area. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class AreaPrefixConfigIPv4 { public static final String SERIALIZED_NAME_DEFAULT_PREFIX_LEN = "defaultPrefixLen"; 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 98a0bb8..0d5586f 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 @@ -34,7 +34,7 @@ /** Availability Zone list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class AvailabilityZoneListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 89b82c8..7e43613 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 @@ -34,7 +34,7 @@ /** Object that represents a backup. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Backup { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; 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 58f7cb6..4ec0e37 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 @@ -35,7 +35,7 @@ /** Backup list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class BackupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 fc4dec6..05a5d9c 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 @@ -33,7 +33,7 @@ /** The source object of a backup. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class BackupSource { public static final String SERIALIZED_NAME_ID = "id"; 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 d2378f5..af9fd7b 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 @@ -33,7 +33,7 @@ /** The base schema for a security group rule. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class BaseSecurityGroupRule { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; 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 d18612d..6da5095 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 @@ -33,7 +33,7 @@ /** The boot device for the server. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class BootVolume { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; 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 8ebf66a..ddd332d 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 @@ -33,7 +33,7 @@ /** The source object of a boot volume. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class BootVolumeSource { public static final String SERIALIZED_NAME_ID = "id"; 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 4c2e27e..8c5d254 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 @@ -35,7 +35,7 @@ /** Definition of an affinity group. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateAffinityGroupPayload { public static final String SERIALIZED_NAME_ID = "id"; 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 index fbdaaf0..8098ad6 100644 --- 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 @@ -32,7 +32,7 @@ /** The addressFamily object for a area create request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateAreaAddressFamily { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; 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/CreateAreaIPv4.java index 5c0866f..e5813f7 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/CreateAreaIPv4.java @@ -35,7 +35,7 @@ /** The config object for a IPv4 network area. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateAreaIPv4 { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; 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 96b80b3..14de2d1 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 @@ -32,7 +32,7 @@ /** Object that represents a backup create request body. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateBackupPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; 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 9346faf..be293f5 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 @@ -36,7 +36,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateImagePayload { public static final String SERIALIZED_NAME_AGENT = "agent"; 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 cd28864..d31476a 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 @@ -33,7 +33,7 @@ /** 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.14.0") + comments = "Generator version: 7.15.0") public class CreateKeyPairPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; 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 index b37204e..4f7ec7a 100644 --- 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 @@ -32,7 +32,7 @@ /** The addressFamily object for a network create request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateNetworkAddressFamily { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; 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 906828f..cf2f31a 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 @@ -32,7 +32,7 @@ /** CreateNetworkAreaPayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateNetworkAreaPayload { public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "addressFamily"; 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 12b1e1e..fb7bd2a 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 @@ -35,7 +35,7 @@ /** CreateNetworkAreaRangePayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateNetworkAreaRangePayload { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; 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 a7f2ae0..c51fa38 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 @@ -35,7 +35,7 @@ /** CreateNetworkAreaRoutePayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateNetworkAreaRoutePayload { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; 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 index 4d291ce..c311833 100644 --- 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 @@ -35,7 +35,7 @@ /** The config object for an IPv4 network. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateNetworkIPv4Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; 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 index 610c4ab..ee66045 100644 --- 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 @@ -35,7 +35,7 @@ /** The config object for an IPv6 network. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateNetworkIPv6Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; 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 654dc1b..59123ff 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 @@ -32,7 +32,7 @@ /** Object that represents the request body for a network create. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateNetworkPayload { public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "addressFamily"; 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 4a9bd7f..4b41a84 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 @@ -36,7 +36,7 @@ /** Object that represents a network interface. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateNicPayload { public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; 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 1263344..7af293e 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 @@ -30,7 +30,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateProtocol extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateProtocol.class.getName()); 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 bdea159..e61574b 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 @@ -34,7 +34,7 @@ /** Object that represents a public IP. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreatePublicIPPayload { public static final String SERIALIZED_NAME_ID = "id"; 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 98782c7..be9904e 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 @@ -36,7 +36,7 @@ /** Object that represents a security group. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateSecurityGroupPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; 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 7e93ef3..13bfe00 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 @@ -33,7 +33,7 @@ /** Object that represents a request body for security group rule creation. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateSecurityGroupRulePayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; 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 56bed82..73ae90b 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 @@ -32,7 +32,7 @@ /** The internet protocol which the rule should match. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateSecurityGroupRuleProtocol { public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; 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 22c3712..e1b3ef0 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 @@ -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.14.0") + comments = "Generator version: 7.15.0") public class CreateServerNetworking { public static final String SERIALIZED_NAME_NETWORK_ID = "networkId"; 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 d55f6b2..61df2e3 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 @@ -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.14.0") + comments = "Generator version: 7.15.0") public class CreateServerNetworkingWithNics { public static final String SERIALIZED_NAME_NIC_IDS = "nicIds"; 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 c19ec89..3a4740f 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 @@ -37,7 +37,7 @@ /** Representation of a single server object. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateServerPayload { public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; 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/CreateServerPayloadNetworking.java index 48f1bc1..cb560e2 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/CreateServerPayloadNetworking.java @@ -29,7 +29,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateServerPayloadNetworking extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateServerPayloadNetworking.class.getName()); 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 638a736..4cef0a0 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 @@ -34,7 +34,7 @@ /** Object that represents a snapshot. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateSnapshotPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; 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 eabd2aa..1d2f993 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 @@ -36,7 +36,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateVolumePayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; 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 7681de4..58ca9d0 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 @@ -32,7 +32,7 @@ /** Error with HTTP error code and an error message. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Error { public static final String SERIALIZED_NAME_CODE = "code"; 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 50fe307..1937680 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 @@ -32,7 +32,7 @@ /** GetServerLog200Response */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class GetServerLog200Response { public static final String SERIALIZED_NAME_OUTPUT = "output"; 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 408dfb3..60b8169 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 @@ -32,7 +32,7 @@ /** Object that represents ICMP parameters. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ICMPParameters { public static final String SERIALIZED_NAME_CODE = "code"; 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 9d66df7..3c794dd 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 @@ -36,7 +36,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Image { public static final String SERIALIZED_NAME_AGENT = "agent"; 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 283c6f8..3ae646a 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 @@ -32,7 +32,7 @@ /** Support status and default provioning setting for the STACKIT server agent. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ImageAgent { public static final String SERIALIZED_NAME_PROVISION_BY_DEFAULT = "provisionByDefault"; 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 57c520c..3205f1f 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 @@ -32,7 +32,7 @@ /** Representation of an image checksum. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ImageChecksum { public static final String SERIALIZED_NAME_ALGORITHM = "algorithm"; 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 4924911..eac3891 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 @@ -33,7 +33,7 @@ /** Properties to set hardware and scheduling settings for an Image. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ImageConfig { public static final String SERIALIZED_NAME_ARCHITECTURE = "architecture"; 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 b032637..ae688d0 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 @@ -34,7 +34,7 @@ /** Image creation response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ImageCreateResponse { public static final String SERIALIZED_NAME_ID = "id"; 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 2a3f0ea..4301a06 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 @@ -35,7 +35,7 @@ /** Image list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ImageListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 e0f288a..09dfac1 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 @@ -37,7 +37,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ImageShare { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; 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 0941a29..ce60399 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 @@ -34,7 +34,7 @@ /** The details of an Image share consumer. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ImageShareConsumer { public static final String SERIALIZED_NAME_CONSUMER_PROJECT_ID = "consumerProjectId"; 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 cac5b49..887372f 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 @@ -35,7 +35,7 @@ /** SSH keypair list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class KeyPairListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 1b8ee74..f8da10e 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 @@ -33,7 +33,7 @@ /** 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.14.0") + comments = "Generator version: 7.15.0") public class Keypair { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; 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 79ba2fb..e0a0a8a 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 @@ -35,7 +35,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class MachineType { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; 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 022ebb6..59d7aa4 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 @@ -35,7 +35,7 @@ /** Machine type list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class MachineTypeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 a72f4a6..d5871f3 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 @@ -36,7 +36,7 @@ /** Object that represents a network interface. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class NIC { public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; 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 fe3a685..3210f01 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 @@ -35,7 +35,7 @@ /** NIC list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class NICListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 d0de4ad..921c01e 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 @@ -37,7 +37,7 @@ /** Object that represents a network. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Network { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; 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 d84001e..4535d73 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 @@ -34,7 +34,7 @@ /** Object that represents a network area. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class NetworkArea { public static final String SERIALIZED_NAME_AREA_ID = "areaId"; 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 index 7dcaf50..8392455 100644 --- 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 @@ -35,7 +35,7 @@ /** The IPv4 properties of a network area. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class NetworkAreaIPv4 { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; 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 4df5cf3..1916cef 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 @@ -35,7 +35,7 @@ /** Network area list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class NetworkAreaListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 56be4d7..839d776 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 @@ -35,7 +35,7 @@ /** Network list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class NetworkListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 e8f4f47..9b98e50 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 @@ -34,7 +34,7 @@ /** Object that represents a network range. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class NetworkRange { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; 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 4da8392..f9db55e 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 @@ -35,7 +35,7 @@ /** Network Range list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class NetworkRangeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 0c5daf1..5e0ccb3 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 @@ -32,7 +32,7 @@ /** PartialUpdateNetworkAreaPayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class PartialUpdateNetworkAreaPayload { public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "addressFamily"; 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 b9060a6..1d20674 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 @@ -32,7 +32,7 @@ /** Object that represents the request body for a network update. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class PartialUpdateNetworkPayload { public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "addressFamily"; 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 7421129..0d79b7f 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 @@ -32,7 +32,7 @@ /** Object that represents a range of ports. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class PortRange { public static final String SERIALIZED_NAME_MAX = "max"; 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 7b08f0f..a563a97 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 @@ -34,7 +34,7 @@ /** Object that represents a STACKIT project. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Project { public static final String SERIALIZED_NAME_AREA_ID = "areaId"; 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 00f691d..2d64ef3 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 @@ -35,7 +35,7 @@ /** Project list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ProjectListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 7100d3e..8b5f0c0 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 @@ -32,7 +32,7 @@ /** The schema for a protocol of a security group rule. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Protocol { public static final String SERIALIZED_NAME_NAME = "name"; 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 74e27ad..02b6599 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 @@ -34,7 +34,7 @@ /** Object that represents a public IP. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class PublicIp { public static final String SERIALIZED_NAME_ID = "id"; 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 32fb07a..e891064 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 @@ -35,7 +35,7 @@ /** Public IP list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class PublicIpListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 7f6beaa..2e7de21 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 @@ -32,7 +32,7 @@ /** Public network. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class PublicNetwork { public static final String SERIALIZED_NAME_CIDR = "cidr"; 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 e3aafcb..a2614c0 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 @@ -35,7 +35,7 @@ /** Public network list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class PublicNetworkListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 3c36408..839d74a 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 @@ -32,7 +32,7 @@ /** Object that represents a single resource quota. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Quota { public static final String SERIALIZED_NAME_LIMIT = "limit"; 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 6f471dd..2a3875f 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 @@ -32,7 +32,7 @@ /** Object that represents the quotas for a project. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class QuotaList { public static final String SERIALIZED_NAME_BACKUP_GIGABYTES = "backupGigabytes"; 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 2c68b2a..6407b61 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 @@ -32,7 +32,7 @@ /** Quotas list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class QuotaListResponse { public static final String SERIALIZED_NAME_QUOTAS = "quotas"; 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 da7590d..c726c88 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 @@ -35,7 +35,7 @@ /** Object that represents a request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Request { public static final String SERIALIZED_NAME_DETAILS = "details"; 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 0e39005..b8cc583 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 @@ -33,7 +33,7 @@ /** Object that represents a resource as part of a request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class RequestResource { public static final String SERIALIZED_NAME_ID = "id"; 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 0cfa1ed..a6ad9bd 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 @@ -33,7 +33,7 @@ /** RescueServerPayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class RescueServerPayload { public static final String SERIALIZED_NAME_IMAGE = "image"; 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 587ea9f..fa734bc 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 @@ -32,7 +32,7 @@ /** ResizeServerPayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ResizeServerPayload { public static final String SERIALIZED_NAME_MACHINE_TYPE = "machineType"; 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 8c4261c..a580373 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 @@ -32,7 +32,7 @@ /** ResizeVolumePayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ResizeVolumePayload { public static final String SERIALIZED_NAME_SIZE = "size"; 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 63c8a8d..b3a6aa1 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 @@ -34,7 +34,7 @@ /** Object represents a network route. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Route { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; 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 12e36bf..f0264ad 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 @@ -35,7 +35,7 @@ /** Route list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class RouteListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 93e01de..2afb081 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 @@ -36,7 +36,7 @@ /** Object that represents a security group. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class SecurityGroup { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; 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 a47e4ce..1092c53 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 @@ -35,7 +35,7 @@ /** Security group list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class SecurityGroupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 57b639d..63900cc 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 @@ -33,7 +33,7 @@ /** Object that represents a security group rule. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class SecurityGroupRule { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; 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 0416247..301149f 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 @@ -35,7 +35,7 @@ /** Security group rule list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class SecurityGroupRuleListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 74f470b..78a3d5b 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 @@ -32,7 +32,7 @@ /** The internet protocol which the rule matches. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class SecurityGroupRuleProtocol { public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; 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 df9183d..851df3e 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 @@ -37,7 +37,7 @@ /** Representation of a single server object. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Server { public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; 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 f1d67e9..fcbc473 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 @@ -32,7 +32,7 @@ /** Object that represents a server console URL. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ServerConsoleUrl { public static final String SERIALIZED_NAME_URL = "url"; 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 99a46b0..3c59aaa 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 @@ -35,7 +35,7 @@ /** Response object for server list request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ServerListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 ef6150d..c1136e6 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 @@ -33,7 +33,7 @@ /** 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.14.0") + comments = "Generator version: 7.15.0") public class ServerMaintenance { public static final String SERIALIZED_NAME_DETAILS = "details"; 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 b44394f..0a869ee 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 @@ -36,7 +36,7 @@ /** Describes the object that matches servers to its networks. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ServerNetwork { public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; 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 9c69729..c5387b7 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 @@ -34,7 +34,7 @@ /** Service account mail list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ServiceAccountMailListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 14cebca..3664a33 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 @@ -37,7 +37,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class SetImageSharePayload { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; 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 f9754eb..76df689 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 @@ -34,7 +34,7 @@ /** Object that represents a snapshot. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Snapshot { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; 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 4b3c6ec..de4ca5e 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 @@ -35,7 +35,7 @@ /** Snapshot list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class SnapshotListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 index b33085f..4dfc6d0 100644 --- 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 @@ -32,7 +32,7 @@ /** The addressFamily object for a area update request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateAreaAddressFamily { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; 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 index fac3cc5..a08b4fe 100644 --- 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 @@ -34,7 +34,7 @@ /** The update object for a IPv4 network area. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateAreaIPv4 { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; 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 361551d..a78612f 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 @@ -33,7 +33,7 @@ /** Object that represents a Volume attachment to a server. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateAttachedVolumePayload { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; 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 2a23d00..ffef387 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 @@ -34,7 +34,7 @@ /** Object that represents a backup. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateBackupPayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; 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 7e4b3a1..58c6d83 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 @@ -32,7 +32,7 @@ /** Object that represents an update request body of an Image. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateImagePayload { public static final String SERIALIZED_NAME_AGENT = "agent"; 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 1b5cc32..54f1c34 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 @@ -37,7 +37,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateImageSharePayload { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; 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 d6ffa98..fbab69c 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 @@ -32,7 +32,7 @@ /** 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.14.0") + comments = "Generator version: 7.15.0") public class UpdateKeyPairPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; 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 index c565fc2..6192339 100644 --- 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 @@ -32,7 +32,7 @@ /** The addressFamily object for a network update request. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateNetworkAddressFamily { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; 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 54820c4..4cdd430 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 @@ -32,7 +32,7 @@ /** Object that represents the request body for a route update. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateNetworkAreaRoutePayload { public static final String SERIALIZED_NAME_LABELS = "labels"; 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 b80a2cb..440f958 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 @@ -35,7 +35,7 @@ /** The config object for a IPv4 network update. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateNetworkIPv4Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; 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 ae2b957..69d2785 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 @@ -35,7 +35,7 @@ /** The config object for a IPv6 network update. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateNetworkIPv6Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; 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 6297150..a97b192 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 @@ -36,7 +36,7 @@ /** Object that represents a network interface update. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateNicPayload { public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; 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 9bc2870..09a4d02 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 @@ -34,7 +34,7 @@ /** Object that represents a public IP. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdatePublicIPPayload { public static final String SERIALIZED_NAME_ID = "id"; 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 4dbdfd8..44225c1 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 @@ -32,7 +32,7 @@ /** Object that represents an update request body of a security group. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateSecurityGroupPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; 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 76c1108..a6eeeb7 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 @@ -32,7 +32,7 @@ /** Object that represents an update request body of a server. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateServerPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; 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 9751a4a..bcf993c 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 @@ -32,7 +32,7 @@ /** Object that represents an update request body of a snapshot. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateSnapshotPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; 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 dfb3f95..55a937f 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 @@ -32,7 +32,7 @@ /** Object that represents an update request body of a volume. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class UpdateVolumePayload { public static final String SERIALIZED_NAME_BOOTABLE = "bootable"; 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 b1a8373..019bda9 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 @@ -36,7 +36,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Volume { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; 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 03f6a71..7e36ed7 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 @@ -33,7 +33,7 @@ /** Object that represents a Volume attachment to a server. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class VolumeAttachment { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; 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 55ca9e5..5c0a836 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 @@ -35,7 +35,7 @@ /** Volume attachment list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class VolumeAttachmentListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 56375e4..55e3854 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 @@ -38,7 +38,7 @@ */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class VolumeEncryptionParameter { public static final String SERIALIZED_NAME_KEK_KEY_ID = "kekKeyId"; 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 d11b7b1..8325f0b 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 @@ -35,7 +35,7 @@ /** Volume list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class VolumeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 1f87c05..4ca998b 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 @@ -32,7 +32,7 @@ /** Object that represents a Volume performance class. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class VolumePerformanceClass { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; 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 517093c..7edf8c3 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 @@ -35,7 +35,7 @@ /** Volume performance class list response. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class VolumePerformanceClassListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; 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 4039c24..2193609 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 @@ -33,7 +33,7 @@ /** The source object of a volume. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class VolumeSource { public static final String SERIALIZED_NAME_ID = "id"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/Pair.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/Pair.java index 725a1e5..c5a42b4 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/Pair.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/Pair.java @@ -14,30 +14,14 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Pair { - private String name = ""; - private String value = ""; + private final String name; + private final String value; public Pair(String name, String value) { - setName(name); - setValue(value); - } - - private void setName(String name) { - if (!isValidString(name)) { - return; - } - - this.name = name; - } - - private void setValue(String value) { - if (!isValidString(value)) { - return; - } - - this.value = value; + this.name = isValidString(name) ? name : ""; + this.value = isValidString(value) ? value : ""; } public String getName() { @@ -48,11 +32,7 @@ public String getValue() { return this.value; } - private boolean isValidString(String arg) { - if (arg == null) { - return false; - } - - return true; + private static boolean isValidString(String arg) { + return arg != null; } } diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/ServerConfiguration.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/ServerConfiguration.java index 1d83146..45c89fc 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/ServerConfiguration.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/ServerConfiguration.java @@ -17,7 +17,7 @@ /** Representing a Server configuration. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ServerConfiguration { public String URL; public String description; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/ServerVariable.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/ServerVariable.java index a00e4fa..09d812f 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/ServerVariable.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/ServerVariable.java @@ -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.14.0") + comments = "Generator version: 7.15.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/StringUtil.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/StringUtil.java index 09ca8fb..82afb61 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/StringUtil.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/StringUtil.java @@ -17,7 +17,7 @@ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/AbstractOpenApiSchema.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/AbstractOpenApiSchema.java index 7a476f1..15967cd 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/AbstractOpenApiSchema.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/AbstractOpenApiSchema.java @@ -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.14.0") + comments = "Generator version: 7.15.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/CreateFolderPayload.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/CreateFolderPayload.java index c38a783..8e54dc1 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/CreateFolderPayload.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/CreateFolderPayload.java @@ -35,7 +35,7 @@ /** CreateFolderPayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateFolderPayload { public static final String SERIALIZED_NAME_CONTAINER_PARENT_ID = "containerParentId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/CreateProjectPayload.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/CreateProjectPayload.java index d34998b..38ea22d 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/CreateProjectPayload.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/CreateProjectPayload.java @@ -35,7 +35,7 @@ /** CreateProjectPayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class CreateProjectPayload { public static final String SERIALIZED_NAME_CONTAINER_PARENT_ID = "containerParentId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ErrorResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ErrorResponse.java index e034712..c4a866f 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ErrorResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ErrorResponse.java @@ -34,7 +34,7 @@ /** ErrorResponse */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ErrorResponse { public static final String SERIALIZED_NAME_ERROR = "error"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/FolderResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/FolderResponse.java index 3cf09f2..713442b 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/FolderResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/FolderResponse.java @@ -35,7 +35,7 @@ /** FolderResponse */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class FolderResponse { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/GetFolderDetailsResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/GetFolderDetailsResponse.java index 02ae3fd..63aed80 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/GetFolderDetailsResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/GetFolderDetailsResponse.java @@ -38,7 +38,7 @@ /** GetFolderDetailsResponse */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class GetFolderDetailsResponse { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/GetProjectResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/GetProjectResponse.java index 2ea6927..cecb598 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/GetProjectResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/GetProjectResponse.java @@ -38,7 +38,7 @@ /** GetProjectResponse */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class GetProjectResponse { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListFoldersResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListFoldersResponse.java index 705e6a1..ae22de9 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListFoldersResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListFoldersResponse.java @@ -36,7 +36,7 @@ /** ListFoldersResponse */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ListFoldersResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListFoldersResponseItemsInner.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListFoldersResponseItemsInner.java index a979d4a..2e034b6 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListFoldersResponseItemsInner.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListFoldersResponseItemsInner.java @@ -35,7 +35,7 @@ /** ListFoldersResponseItemsInner */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ListFoldersResponseItemsInner { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListOrganizationsResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListOrganizationsResponse.java index 411e93c..8f2ab2e 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListOrganizationsResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListOrganizationsResponse.java @@ -36,7 +36,7 @@ /** ListOrganizationsResponse */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ListOrganizationsResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListOrganizationsResponseItemsInner.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListOrganizationsResponseItemsInner.java index 643d564..1712bad 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListOrganizationsResponseItemsInner.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListOrganizationsResponseItemsInner.java @@ -35,7 +35,7 @@ /** ListOrganizationsResponseItemsInner */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ListOrganizationsResponseItemsInner { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListProjectsResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListProjectsResponse.java index a2dbce9..5837bec 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListProjectsResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ListProjectsResponse.java @@ -36,7 +36,7 @@ /** ListProjectsResponse */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ListProjectsResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Member.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Member.java index 82ef16b..2f46102 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Member.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Member.java @@ -32,7 +32,7 @@ /** Member */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Member { public static final String SERIALIZED_NAME_ROLE = "role"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/OrganizationResponse.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/OrganizationResponse.java index 911683a..1dd5e85 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/OrganizationResponse.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/OrganizationResponse.java @@ -35,7 +35,7 @@ /** OrganizationResponse */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class OrganizationResponse { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Parent.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Parent.java index 6e2ceb6..f58f14c 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Parent.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Parent.java @@ -34,7 +34,7 @@ /** Parent container. */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Parent { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ParentListInner.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ParentListInner.java index 698cac2..df5d9cc 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ParentListInner.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/ParentListInner.java @@ -34,7 +34,7 @@ /** ParentListInner */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class ParentListInner { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateFolderPayload.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateFolderPayload.java index 01fac7e..5bf5cd0 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateFolderPayload.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateFolderPayload.java @@ -33,7 +33,7 @@ /** PartialUpdateFolderPayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class PartialUpdateFolderPayload { public static final String SERIALIZED_NAME_CONTAINER_PARENT_ID = "containerParentId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateOrganizationPayload.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateOrganizationPayload.java index 7f410f4..b7f46df 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateOrganizationPayload.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateOrganizationPayload.java @@ -33,7 +33,7 @@ /** PartialUpdateOrganizationPayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class PartialUpdateOrganizationPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateProjectPayload.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateProjectPayload.java index 4329d49..f1f0d74 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateProjectPayload.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/PartialUpdateProjectPayload.java @@ -33,7 +33,7 @@ /** PartialUpdateProjectPayload */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class PartialUpdateProjectPayload { public static final String SERIALIZED_NAME_CONTAINER_PARENT_ID = "containerParentId"; diff --git a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Project.java b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Project.java index 734175c..3d13978 100644 --- a/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Project.java +++ b/services/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/model/Project.java @@ -35,7 +35,7 @@ /** Project */ @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.14.0") + comments = "Generator version: 7.15.0") public class Project { public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; From 723f50bc6e0884072e51cfe771894d1fc0e23e7d Mon Sep 17 00:00:00 2001 From: Ruben Hoenle Date: Tue, 26 Aug 2025 13:22:40 +0200 Subject: [PATCH 3/4] chore(sdk): enforce java 8 compatibility --- build.gradle | 6 +++++- .../stackit/sdk/iaas/examples/IaaSExample.java | 16 ++++++++-------- .../examples/ResourcemanagerExample.java | 6 +++--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 76e3bcb..bef7e1c 100644 --- a/build.gradle +++ b/build.gradle @@ -24,10 +24,15 @@ allprojects { java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 + + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } } tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' + options.release = 8 // enforce java 8 compatibility } spotless { @@ -69,7 +74,6 @@ subprojects { afterEvaluate { project -> // only apply to service sub-projects and core if (project.path.startsWith(':services:') || project.name == "core" ) { - // override the version of each service with the ones obtained from the VERSION files def versionFile = project.file("VERSION") if (versionFile.exists()) { 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 52d8b83..d3e1600 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 @@ -4,7 +4,7 @@ import cloud.stackit.sdk.iaas.api.IaasApi; import cloud.stackit.sdk.iaas.model.*; import java.io.IOException; -import java.util.Map; +import java.util.Collections; import java.util.Objects; import java.util.UUID; import java.util.concurrent.TimeUnit; @@ -36,7 +36,7 @@ public static void main(String[] args) throws IOException { .name("java-sdk-example-network-01") .dhcp(true) .routed(false) - .labels(Map.ofEntries(Map.entry("foo", "bar"))) + .labels(Collections.singletonMap("foo", "bar")) .addressFamily( new CreateNetworkAddressFamily() .ipv4( @@ -50,7 +50,7 @@ public static void main(String[] args) throws IOException { newNetwork.getNetworkId(), new PartialUpdateNetworkPayload() .dhcp(false) - .labels(Map.ofEntries(Map.entry("foo", "bar-updated")))); + .labels(Collections.singletonMap("foo", "bar-updated"))); /* fetch the network we just created */ Network fetchedNetwork = iaasApi.getNetwork(projectId, newNetwork.getNetworkId()); @@ -83,7 +83,7 @@ public static void main(String[] args) throws IOException { /* get an image */ UUID imageId = images.getItems() - .getFirst() + .get(0) .getId(); // we just use a random image id in our example assert imageId != null; Image fetchedImage = iaasApi.getImage(projectId, imageId); @@ -119,7 +119,7 @@ public static void main(String[] args) throws IOException { assert newKeypair.getName() != null; iaasApi.updateKeyPair( newKeypair.getName(), - new UpdateKeyPairPayload().labels(Map.ofEntries(Map.entry("foo", "bar")))); + new UpdateKeyPairPayload().labels(Collections.singletonMap("foo", "bar"))); /* fetch the keypair we just created / updated */ Keypair fetchedKeypair = iaasApi.getKeyPair(newKeypair.getName()); @@ -144,7 +144,7 @@ public static void main(String[] args) throws IOException { /* fetch details about a machine type */ MachineType fetchedMachineType = - iaasApi.getMachineType(projectId, machineTypes.getItems().getFirst().getName()); + iaasApi.getMachineType(projectId, machineTypes.getItems().get(0).getName()); System.out.println("\nFetched machine type: "); System.out.println("* Name: " + fetchedMachineType.getName()); System.out.println("* Description: " + fetchedMachineType.getDescription()); @@ -163,7 +163,7 @@ public static void main(String[] args) throws IOException { .name("java-sdk-example-server-01") .machineType("t2i.1") .imageId(imageId) - .labels(Map.ofEntries(Map.entry("foo", "bar"))) + .labels(Collections.singletonMap("foo", "bar")) // add the keypair we created above .keypairName(newKeypair.getName()) // add the server to the network we created above @@ -188,7 +188,7 @@ public static void main(String[] args) throws IOException { projectId, newServer.getId(), new UpdateServerPayload() - .labels(Map.ofEntries(Map.entry("foo", "bar-updated")))); + .labels(Collections.singletonMap("foo", "bar-updated"))); /* list all servers */ ServerListResponse servers = iaasApi.listServers(projectId, false, null); diff --git a/examples/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/examples/ResourcemanagerExample.java b/examples/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/examples/ResourcemanagerExample.java index d6d669f..4893f53 100644 --- a/examples/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/examples/ResourcemanagerExample.java +++ b/examples/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/examples/ResourcemanagerExample.java @@ -7,7 +7,7 @@ import cloud.stackit.sdk.resourcemanager.model.FolderResponse; import cloud.stackit.sdk.resourcemanager.model.Project; import java.io.IOException; -import java.util.Map; +import java.util.Collections; import java.util.UUID; class ResourcemanagerExample { @@ -25,14 +25,14 @@ public static void main(String[] args) throws IOException { resourceManagerApi.createProject( new CreateProjectPayload() .containerParentId(containerParentId.toString()) - .labels(Map.ofEntries(Map.entry("foo", "bar")))); + .labels(Collections.singletonMap("foo", "bar"))); /* create a folder */ FolderResponse folder = resourceManagerApi.createFolder( new CreateFolderPayload() .containerParentId(containerParentId.toString()) - .labels(Map.ofEntries(Map.entry("foo", "bar")))); + .labels(Collections.singletonMap("foo", "bar"))); } catch (ApiException e) { throw new RuntimeException(e); } From 1a0e811105967d0b222cc49c94176882454dbe46 Mon Sep 17 00:00:00 2001 From: Ruben Hoenle Date: Tue, 26 Aug 2025 18:19:25 +0200 Subject: [PATCH 4/4] update service readmes --- services/iaas/README.md | 32 +----------------------------- services/resourcemanager/README.md | 31 +---------------------------- 2 files changed, 2 insertions(+), 61 deletions(-) diff --git a/services/iaas/README.md b/services/iaas/README.md index b7450a6..d6c61a3 100644 --- a/services/iaas/README.md +++ b/services/iaas/README.md @@ -76,38 +76,8 @@ Then manually install the following JARs: ## Getting Started -Please follow the [installation](#installation) instruction and execute the following Java code: - -```java - -import cloud.stackit.sdk.iaas.*; -import cloud.stackit.sdk.iaas.auth.*; -import cloud.stackit.sdk.iaas.model.*; -import cloud.stackit.sdk.iaas.api.DefaultApi; - -public class DefaultApiExample { - - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://iaas.api.eu01.stackit.cloud"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); - UUID projectId = UUID.randomUUID(); // UUID | The identifier (ID) of a STACKIT Project. - UUID serverId = UUID.randomUUID(); // UUID | The identifier (ID) of a STACKIT Server. - UUID networkId = UUID.randomUUID(); // UUID | The identifier (ID) of a STACKIT Network. - try { - apiInstance.addNetworkToServer(projectId, serverId, networkId); - } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#addNetworkToServer"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} +See the [iaas examples](https://github.com/stackitcloud/stackit-sdk-java/tree/main/examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples). -``` ## Recommendation diff --git a/services/resourcemanager/README.md b/services/resourcemanager/README.md index a63905d..2d7ffdb 100644 --- a/services/resourcemanager/README.md +++ b/services/resourcemanager/README.md @@ -96,37 +96,8 @@ Then manually install the following JARs: ## Getting Started -Please follow the [installation](#installation) instruction and execute the following Java code: - -```java - -import cloud.stackit.sdk.resourcemanager.*; -import cloud.stackit.sdk.resourcemanager.auth.*; -import cloud.stackit.sdk.resourcemanager.model.*; -import cloud.stackit.sdk.resourcemanager.api.DefaultApi; - -public class DefaultApiExample { - - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://resource-manager.api.stackit.cloud"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); - CreateFolderPayload createFolderPayload = new CreateFolderPayload(); // CreateFolderPayload | - try { - FolderResponse result = apiInstance.createFolder(createFolderPayload); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#createFolder"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} +See the [resourcemanager examples](https://github.com/stackitcloud/stackit-sdk-java/tree/main/examples/resourcemanager/src/main/java/cloud/stackit/sdk/resourcemanager/examples). -``` ## Recommendation