From 6c86633657946bac0bc0998622da895f3308fd4a Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 29 Oct 2026 09:47:31 +0000 Subject: [PATCH] Generate iaas --- services/iaas/build.gradle | 2 +- services/iaas/oas_commit | 2 +- .../stackit/sdk/iaas/v1api/ApiClient.java | 51 +++ .../cloud/stackit/sdk/iaas/v1api/JSON.java | 56 +++ .../cloud/stackit/sdk/iaas/v1api/Pair.java | 2 +- .../sdk/iaas/v1api/ServerConfiguration.java | 2 +- .../sdk/iaas/v1api/ServerVariable.java | 2 +- .../stackit/sdk/iaas/v1api/StringUtil.java | 2 +- .../v1api/model/AbstractOpenApiSchema.java | 7 +- .../v1api/model/AddVolumeToServerPayload.java | 12 +- .../sdk/iaas/v1api/model/AffinityGroup.java | 12 +- .../model/AffinityGroupListResponse.java | 39 +- .../v1api/model/AllowedAddressesInner.java | 3 +- .../stackit/sdk/iaas/v1api/model/Area.java | 12 +- .../sdk/iaas/v1api/model/AreaConfig.java | 39 +- .../stackit/sdk/iaas/v1api/model/AreaId.java | 4 +- .../v1api/model/AreaPrefixConfigIPv4.java | 12 +- .../model/AvailabilityZoneListResponse.java | 12 +- .../stackit/sdk/iaas/v1api/model/Backup.java | 32 +- .../iaas/v1api/model/BackupListResponse.java | 39 +- .../sdk/iaas/v1api/model/BackupSource.java | 12 +- .../v1api/model/BaseSecurityGroupRule.java | 12 +- .../sdk/iaas/v1api/model/BootVolume.java | 12 +- .../iaas/v1api/model/BootVolumeSource.java | 12 +- .../model/CreateAffinityGroupPayload.java | 12 +- .../v1api/model/CreateAreaAddressFamily.java | 12 +- .../sdk/iaas/v1api/model/CreateAreaIPv4.java | 39 +- .../iaas/v1api/model/CreateBackupPayload.java | 32 +- .../iaas/v1api/model/CreateImagePayload.java | 32 +- .../v1api/model/CreateKeyPairPayload.java | 32 +- .../model/CreateNetworkAddressFamily.java | 12 +- .../v1api/model/CreateNetworkAreaPayload.java | 32 +- .../model/CreateNetworkAreaRangePayload.java | 12 +- .../model/CreateNetworkAreaRoutePayload.java | 12 +- .../v1api/model/CreateNetworkIPv4Body.java | 12 +- .../v1api/model/CreateNetworkIPv6Body.java | 12 +- .../v1api/model/CreateNetworkPayload.java | 76 +++- .../iaas/v1api/model/CreateNicPayload.java | 82 +++- .../sdk/iaas/v1api/model/CreateProtocol.java | 4 +- .../v1api/model/CreatePublicIPPayload.java | 84 +++- .../model/CreateSecurityGroupPayload.java | 32 +- .../model/CreateSecurityGroupRulePayload.java | 12 +- .../CreateSecurityGroupRuleProtocol.java | 12 +- .../v1api/model/CreateServerNetworking.java | 7 +- .../model/CreateServerNetworkingWithNics.java | 7 +- .../iaas/v1api/model/CreateServerPayload.java | 32 +- .../model/CreateServerPayloadNetworking.java | 4 +- .../v1api/model/CreateSnapshotPayload.java | 32 +- .../iaas/v1api/model/CreateVolumePayload.java | 32 +- .../stackit/sdk/iaas/v1api/model/Error.java | 12 +- .../v1api/model/GetServerLog200Response.java | 12 +- .../sdk/iaas/v1api/model/ICMPParameters.java | 12 +- .../stackit/sdk/iaas/v1api/model/Image.java | 32 +- .../sdk/iaas/v1api/model/ImageAgent.java | 12 +- .../sdk/iaas/v1api/model/ImageChecksum.java | 12 +- .../sdk/iaas/v1api/model/ImageConfig.java | 12 +- .../iaas/v1api/model/ImageCreateResponse.java | 12 +- .../iaas/v1api/model/ImageListResponse.java | 39 +- .../sdk/iaas/v1api/model/ImageShare.java | 12 +- .../iaas/v1api/model/ImageShareConsumer.java | 12 +- .../iaas/v1api/model/KeyPairListResponse.java | 39 +- .../stackit/sdk/iaas/v1api/model/Keypair.java | 32 +- .../sdk/iaas/v1api/model/MachineType.java | 12 +- .../v1api/model/MachineTypeListResponse.java | 39 +- .../stackit/sdk/iaas/v1api/model/NIC.java | 83 +++- .../sdk/iaas/v1api/model/NICListResponse.java | 39 +- .../stackit/sdk/iaas/v1api/model/Network.java | 67 ++- .../sdk/iaas/v1api/model/NetworkArea.java | 32 +- .../sdk/iaas/v1api/model/NetworkAreaIPv4.java | 12 +- .../v1api/model/NetworkAreaListResponse.java | 39 +- .../iaas/v1api/model/NetworkListResponse.java | 39 +- .../sdk/iaas/v1api/model/NetworkRange.java | 12 +- .../v1api/model/NetworkRangeListResponse.java | 39 +- .../PartialUpdateNetworkAreaPayload.java | 32 +- .../model/PartialUpdateNetworkPayload.java | 76 +++- .../sdk/iaas/v1api/model/PortRange.java | 12 +- .../stackit/sdk/iaas/v1api/model/Project.java | 12 +- .../iaas/v1api/model/ProjectListResponse.java | 12 +- .../sdk/iaas/v1api/model/Protocol.java | 12 +- .../sdk/iaas/v1api/model/PublicIp.java | 83 +++- .../v1api/model/PublicIpListResponse.java | 39 +- .../sdk/iaas/v1api/model/PublicNetwork.java | 12 +- .../model/PublicNetworkListResponse.java | 39 +- .../stackit/sdk/iaas/v1api/model/Quota.java | 12 +- .../sdk/iaas/v1api/model/QuotaList.java | 12 +- .../iaas/v1api/model/QuotaListResponse.java | 12 +- .../stackit/sdk/iaas/v1api/model/Request.java | 39 +- .../sdk/iaas/v1api/model/RequestResource.java | 12 +- .../iaas/v1api/model/RescueServerPayload.java | 12 +- .../iaas/v1api/model/ResizeServerPayload.java | 12 +- .../iaas/v1api/model/ResizeVolumePayload.java | 12 +- .../stackit/sdk/iaas/v1api/model/Route.java | 32 +- .../iaas/v1api/model/RouteListResponse.java | 39 +- .../sdk/iaas/v1api/model/SecurityGroup.java | 32 +- .../model/SecurityGroupListResponse.java | 39 +- .../iaas/v1api/model/SecurityGroupRule.java | 12 +- .../model/SecurityGroupRuleListResponse.java | 39 +- .../model/SecurityGroupRuleProtocol.java | 12 +- .../stackit/sdk/iaas/v1api/model/Server.java | 32 +- .../sdk/iaas/v1api/model/ServerAgent.java | 12 +- .../iaas/v1api/model/ServerConsoleUrl.java | 12 +- .../iaas/v1api/model/ServerListResponse.java | 39 +- .../iaas/v1api/model/ServerMaintenance.java | 12 +- .../sdk/iaas/v1api/model/ServerNetwork.java | 57 ++- .../iaas/v1api/model/ServerNetworking.java | 4 +- .../model/ServiceAccountMailListResponse.java | 12 +- .../v1api/model/SetImageSharePayload.java | 12 +- .../sdk/iaas/v1api/model/Snapshot.java | 32 +- .../v1api/model/SnapshotListResponse.java | 39 +- .../v1api/model/UpdateAreaAddressFamily.java | 12 +- .../sdk/iaas/v1api/model/UpdateAreaIPv4.java | 12 +- .../model/UpdateAttachedVolumePayload.java | 12 +- .../iaas/v1api/model/UpdateBackupPayload.java | 32 +- .../iaas/v1api/model/UpdateImagePayload.java | 32 +- .../v1api/model/UpdateImageSharePayload.java | 12 +- .../v1api/model/UpdateKeyPairPayload.java | 32 +- .../model/UpdateNetworkAddressFamily.java | 12 +- .../model/UpdateNetworkAreaRoutePayload.java | 32 +- .../v1api/model/UpdateNetworkIPv4Body.java | 12 +- .../v1api/model/UpdateNetworkIPv6Body.java | 12 +- .../iaas/v1api/model/UpdateNicPayload.java | 32 +- .../v1api/model/UpdatePublicIPPayload.java | 84 +++- .../model/UpdateSecurityGroupPayload.java | 32 +- .../iaas/v1api/model/UpdateServerPayload.java | 32 +- .../v1api/model/UpdateSnapshotPayload.java | 32 +- .../iaas/v1api/model/UpdateVolumePayload.java | 32 +- .../stackit/sdk/iaas/v1api/model/Volume.java | 32 +- .../iaas/v1api/model/VolumeAttachment.java | 12 +- .../model/VolumeAttachmentListResponse.java | 39 +- .../model/VolumeEncryptionParameter.java | 12 +- .../iaas/v1api/model/VolumeListResponse.java | 39 +- .../v1api/model/VolumePerformanceClass.java | 32 +- .../VolumePerformanceClassListResponse.java | 39 +- .../sdk/iaas/v1api/model/VolumeSource.java | 12 +- .../stackit/sdk/iaas/v2api/ApiClient.java | 51 +++ .../cloud/stackit/sdk/iaas/v2api/JSON.java | 63 +++ .../cloud/stackit/sdk/iaas/v2api/Pair.java | 2 +- .../sdk/iaas/v2api/ServerConfiguration.java | 2 +- .../sdk/iaas/v2api/ServerVariable.java | 2 +- .../stackit/sdk/iaas/v2api/StringUtil.java | 2 +- .../v2api/model/AbstractOpenApiSchema.java | 7 +- .../model/AddRoutesToRoutingTablePayload.java | 39 +- .../model/AddRoutingTableToAreaPayload.java | 12 +- .../v2api/model/AddVolumeToServerPayload.java | 12 +- .../sdk/iaas/v2api/model/AffinityGroup.java | 12 +- .../model/AffinityGroupListResponse.java | 39 +- .../v2api/model/AllowedAddressesInner.java | 3 +- .../stackit/sdk/iaas/v2api/model/AreaId.java | 4 +- .../model/AvailabilityZoneListResponse.java | 12 +- .../stackit/sdk/iaas/v2api/model/Backup.java | 12 +- .../iaas/v2api/model/BackupListResponse.java | 39 +- .../sdk/iaas/v2api/model/BackupSource.java | 12 +- .../v2api/model/BaseSecurityGroupRule.java | 12 +- .../sdk/iaas/v2api/model/BootVolume.java | 12 +- .../iaas/v2api/model/BootVolumeSource.java | 12 +- .../model/CreateAffinityGroupPayload.java | 12 +- .../iaas/v2api/model/CreateBackupPayload.java | 12 +- .../iaas/v2api/model/CreateImagePayload.java | 12 +- .../model/CreateIsolatedNetworkPayload.java | 12 +- .../v2api/model/CreateKeyPairPayload.java | 12 +- .../v2api/model/CreateNetworkAreaPayload.java | 12 +- .../model/CreateNetworkAreaRangePayload.java | 12 +- .../model/CreateNetworkAreaRegionPayload.java | 12 +- .../model/CreateNetworkAreaRoutePayload.java | 39 +- .../iaas/v2api/model/CreateNetworkIPv4.java | 4 +- .../model/CreateNetworkIPv4WithPrefix.java | 12 +- .../CreateNetworkIPv4WithPrefixLength.java | 12 +- .../iaas/v2api/model/CreateNetworkIPv6.java | 4 +- .../model/CreateNetworkIPv6WithPrefix.java | 12 +- .../CreateNetworkIPv6WithPrefixLength.java | 12 +- .../v2api/model/CreateNetworkPayload.java | 12 +- .../iaas/v2api/model/CreateNicPayload.java | 62 ++- .../sdk/iaas/v2api/model/CreateProtocol.java | 4 +- .../v2api/model/CreatePublicIPPayload.java | 64 ++- .../model/CreateSecurityGroupPayload.java | 12 +- .../model/CreateSecurityGroupRulePayload.java | 12 +- .../CreateSecurityGroupRuleProtocol.java | 12 +- .../v2api/model/CreateServerNetworking.java | 7 +- .../model/CreateServerNetworkingWithNics.java | 7 +- .../iaas/v2api/model/CreateServerPayload.java | 12 +- .../CreateServerPayloadAllOfNetworking.java | 4 +- .../v2api/model/CreateSnapshotPayload.java | 32 +- .../iaas/v2api/model/CreateVolumePayload.java | 12 +- .../iaas/v2api/model/DestinationCIDRv4.java | 12 +- .../iaas/v2api/model/DestinationCIDRv6.java | 12 +- .../v2api/model/DestinationPrefixList.java | 395 ++++++++++++++++++ .../stackit/sdk/iaas/v2api/model/Error.java | 12 +- .../v2api/model/GetServerLog200Response.java | 12 +- .../sdk/iaas/v2api/model/ICMPParameters.java | 12 +- .../stackit/sdk/iaas/v2api/model/Image.java | 12 +- .../sdk/iaas/v2api/model/ImageAgent.java | 12 +- .../sdk/iaas/v2api/model/ImageChecksum.java | 12 +- .../sdk/iaas/v2api/model/ImageConfig.java | 12 +- .../iaas/v2api/model/ImageCreateResponse.java | 12 +- .../v2api/model/ImageFromVolumePayload.java | 14 +- .../iaas/v2api/model/ImageListResponse.java | 39 +- .../sdk/iaas/v2api/model/ImageShare.java | 12 +- .../iaas/v2api/model/ImageShareConsumer.java | 12 +- .../iaas/v2api/model/KeyPairListResponse.java | 39 +- .../stackit/sdk/iaas/v2api/model/Keypair.java | 12 +- .../sdk/iaas/v2api/model/MachineType.java | 12 +- .../v2api/model/MachineTypeListResponse.java | 39 +- .../stackit/sdk/iaas/v2api/model/NIC.java | 63 ++- .../sdk/iaas/v2api/model/NICListResponse.java | 39 +- .../stackit/sdk/iaas/v2api/model/Network.java | 12 +- .../sdk/iaas/v2api/model/NetworkArea.java | 12 +- .../v2api/model/NetworkAreaListResponse.java | 39 +- .../sdk/iaas/v2api/model/NetworkIPv4.java | 12 +- .../sdk/iaas/v2api/model/NetworkIPv6.java | 12 +- .../iaas/v2api/model/NetworkListResponse.java | 39 +- .../sdk/iaas/v2api/model/NetworkRange.java | 12 +- .../v2api/model/NetworkRangeListResponse.java | 39 +- .../iaas/v2api/model/NexthopBlackhole.java | 12 +- .../sdk/iaas/v2api/model/NexthopIPv4.java | 12 +- .../sdk/iaas/v2api/model/NexthopIPv6.java | 12 +- .../sdk/iaas/v2api/model/NexthopInternet.java | 12 +- .../PartialUpdateNetworkAreaPayload.java | 12 +- .../model/PartialUpdateNetworkPayload.java | 12 +- .../sdk/iaas/v2api/model/PortRange.java | 12 +- .../stackit/sdk/iaas/v2api/model/Project.java | 12 +- .../iaas/v2api/model/ProjectListResponse.java | 12 +- .../sdk/iaas/v2api/model/Protocol.java | 12 +- .../sdk/iaas/v2api/model/PublicIp.java | 63 ++- .../v2api/model/PublicIpListResponse.java | 39 +- .../sdk/iaas/v2api/model/PublicNetwork.java | 12 +- .../model/PublicNetworkListResponse.java | 39 +- .../stackit/sdk/iaas/v2api/model/Quota.java | 12 +- .../sdk/iaas/v2api/model/QuotaList.java | 12 +- .../iaas/v2api/model/QuotaListResponse.java | 12 +- .../sdk/iaas/v2api/model/RegionalArea.java | 12 +- .../iaas/v2api/model/RegionalAreaIPv4.java | 39 +- .../v2api/model/RegionalAreaListResponse.java | 12 +- .../stackit/sdk/iaas/v2api/model/Request.java | 39 +- .../sdk/iaas/v2api/model/RequestResource.java | 12 +- .../iaas/v2api/model/RescueServerPayload.java | 12 +- .../iaas/v2api/model/ResizeServerPayload.java | 12 +- .../iaas/v2api/model/ResizeVolumePayload.java | 12 +- .../stackit/sdk/iaas/v2api/model/Route.java | 12 +- .../iaas/v2api/model/RouteDestination.java | 78 +++- .../iaas/v2api/model/RouteListResponse.java | 39 +- .../sdk/iaas/v2api/model/RouteNexthop.java | 6 +- .../sdk/iaas/v2api/model/RoutingTable.java | 12 +- .../v2api/model/RoutingTableListResponse.java | 39 +- .../sdk/iaas/v2api/model/SecurityGroup.java | 12 +- .../model/SecurityGroupListResponse.java | 39 +- .../iaas/v2api/model/SecurityGroupRule.java | 12 +- .../model/SecurityGroupRuleListResponse.java | 39 +- .../model/SecurityGroupRuleProtocol.java | 12 +- .../stackit/sdk/iaas/v2api/model/Server.java | 12 +- .../sdk/iaas/v2api/model/ServerAgent.java | 12 +- .../iaas/v2api/model/ServerConsoleUrl.java | 12 +- .../iaas/v2api/model/ServerListResponse.java | 39 +- .../iaas/v2api/model/ServerMaintenance.java | 12 +- .../sdk/iaas/v2api/model/ServerNetwork.java | 57 ++- .../iaas/v2api/model/ServerNetworking.java | 4 +- .../model/ServiceAccountMailListResponse.java | 12 +- .../v2api/model/SetImageSharePayload.java | 12 +- .../sdk/iaas/v2api/model/Snapshot.java | 32 +- .../v2api/model/SnapshotListResponse.java | 39 +- .../model/UpdateAttachedVolumePayload.java | 12 +- .../iaas/v2api/model/UpdateBackupPayload.java | 12 +- .../iaas/v2api/model/UpdateImagePayload.java | 12 +- .../v2api/model/UpdateImageSharePayload.java | 12 +- .../v2api/model/UpdateKeyPairPayload.java | 12 +- .../model/UpdateNetworkAreaRegionPayload.java | 12 +- .../model/UpdateNetworkAreaRoutePayload.java | 12 +- .../v2api/model/UpdateNetworkIPv4Body.java | 12 +- .../v2api/model/UpdateNetworkIPv6Body.java | 12 +- .../iaas/v2api/model/UpdateNicPayload.java | 12 +- .../v2api/model/UpdatePublicIPPayload.java | 64 ++- .../v2api/model/UpdateRegionalAreaIPv4.java | 12 +- .../UpdateRouteOfRoutingTablePayload.java | 12 +- .../UpdateRoutingTableOfAreaPayload.java | 12 +- .../model/UpdateSecurityGroupPayload.java | 12 +- .../iaas/v2api/model/UpdateServerPayload.java | 12 +- .../v2api/model/UpdateSnapshotPayload.java | 12 +- .../iaas/v2api/model/UpdateVolumePayload.java | 12 +- .../stackit/sdk/iaas/v2api/model/Volume.java | 12 +- .../iaas/v2api/model/VolumeAttachment.java | 12 +- .../model/VolumeAttachmentListResponse.java | 39 +- .../model/VolumeEncryptionParameter.java | 12 +- .../iaas/v2api/model/VolumeListResponse.java | 39 +- .../v2api/model/VolumePerformanceClass.java | 12 +- .../VolumePerformanceClassListResponse.java | 39 +- .../sdk/iaas/v2api/model/VolumeSource.java | 12 +- .../sdk/iaas/v2beta1api/ApiClient.java | 51 +++ .../stackit/sdk/iaas/v2beta1api/JSON.java | 63 +++ .../stackit/sdk/iaas/v2beta1api/Pair.java | 2 +- .../iaas/v2beta1api/ServerConfiguration.java | 2 +- .../sdk/iaas/v2beta1api/ServerVariable.java | 2 +- .../sdk/iaas/v2beta1api/StringUtil.java | 2 +- .../model/AbstractOpenApiSchema.java | 7 +- .../model/AddRoutesToRoutingTablePayload.java | 39 +- .../model/AddRoutingTableToAreaPayload.java | 12 +- .../model/AddVolumeToServerPayload.java | 12 +- .../iaas/v2beta1api/model/AffinityGroup.java | 12 +- .../model/AffinityGroupListResponse.java | 39 +- .../model/AllowedAddressesInner.java | 3 +- .../sdk/iaas/v2beta1api/model/AreaId.java | 4 +- .../model/AvailabilityZoneListResponse.java | 12 +- .../sdk/iaas/v2beta1api/model/Backup.java | 12 +- .../v2beta1api/model/BackupListResponse.java | 39 +- .../iaas/v2beta1api/model/BackupSource.java | 12 +- .../model/BaseSecurityGroupRule.java | 12 +- .../sdk/iaas/v2beta1api/model/BootVolume.java | 12 +- .../v2beta1api/model/BootVolumeSource.java | 12 +- .../model/CreateAffinityGroupPayload.java | 12 +- .../v2beta1api/model/CreateBackupPayload.java | 12 +- .../v2beta1api/model/CreateImagePayload.java | 12 +- .../model/CreateIsolatedNetworkPayload.java | 12 +- .../model/CreateKeyPairPayload.java | 12 +- .../model/CreateNetworkAreaPayload.java | 12 +- .../model/CreateNetworkAreaRangePayload.java | 12 +- .../model/CreateNetworkAreaRoutePayload.java | 39 +- .../v2beta1api/model/CreateNetworkIPv4.java | 4 +- .../model/CreateNetworkIPv4WithPrefix.java | 12 +- .../CreateNetworkIPv4WithPrefixLength.java | 12 +- .../v2beta1api/model/CreateNetworkIPv6.java | 4 +- .../model/CreateNetworkIPv6WithPrefix.java | 12 +- .../CreateNetworkIPv6WithPrefixLength.java | 12 +- .../model/CreateNetworkPayload.java | 12 +- .../v2beta1api/model/CreateNicPayload.java | 62 ++- .../iaas/v2beta1api/model/CreateProtocol.java | 4 +- .../model/CreatePublicIPPayload.java | 64 ++- .../model/CreateSecurityGroupPayload.java | 12 +- .../model/CreateSecurityGroupRulePayload.java | 12 +- .../CreateSecurityGroupRuleProtocol.java | 12 +- .../model/CreateServerNetworking.java | 7 +- .../model/CreateServerNetworkingWithNics.java | 7 +- .../v2beta1api/model/CreateServerPayload.java | 12 +- .../CreateServerPayloadAllOfNetworking.java | 4 +- .../v2beta1api/model/CreateVolumePayload.java | 12 +- .../v2beta1api/model/DestinationCIDRv4.java | 12 +- .../v2beta1api/model/DestinationCIDRv6.java | 12 +- .../model/DestinationPrefixList.java | 395 ++++++++++++++++++ .../sdk/iaas/v2beta1api/model/Error.java | 12 +- .../model/GetServerLog200Response.java | 12 +- .../iaas/v2beta1api/model/ICMPParameters.java | 12 +- .../sdk/iaas/v2beta1api/model/Image.java | 12 +- .../sdk/iaas/v2beta1api/model/ImageAgent.java | 12 +- .../iaas/v2beta1api/model/ImageChecksum.java | 12 +- .../iaas/v2beta1api/model/ImageConfig.java | 12 +- .../v2beta1api/model/ImageCreateResponse.java | 12 +- .../v2beta1api/model/ImageListResponse.java | 39 +- .../sdk/iaas/v2beta1api/model/ImageShare.java | 12 +- .../v2beta1api/model/ImageShareConsumer.java | 12 +- .../v2beta1api/model/KeyPairListResponse.java | 39 +- .../sdk/iaas/v2beta1api/model/Keypair.java | 12 +- .../iaas/v2beta1api/model/MachineType.java | 12 +- .../model/MachineTypeListResponse.java | 39 +- .../sdk/iaas/v2beta1api/model/NIC.java | 63 ++- .../v2beta1api/model/NICListResponse.java | 39 +- .../sdk/iaas/v2beta1api/model/Network.java | 12 +- .../iaas/v2beta1api/model/NetworkArea.java | 12 +- .../model/NetworkAreaListResponse.java | 39 +- .../iaas/v2beta1api/model/NetworkIPv4.java | 12 +- .../iaas/v2beta1api/model/NetworkIPv6.java | 12 +- .../v2beta1api/model/NetworkListResponse.java | 39 +- .../iaas/v2beta1api/model/NetworkRange.java | 12 +- .../model/NetworkRangeListResponse.java | 39 +- .../v2beta1api/model/NexthopBlackhole.java | 12 +- .../iaas/v2beta1api/model/NexthopIPv4.java | 12 +- .../iaas/v2beta1api/model/NexthopIPv6.java | 12 +- .../v2beta1api/model/NexthopInternet.java | 12 +- .../PartialUpdateNetworkAreaPayload.java | 12 +- .../model/PartialUpdateNetworkPayload.java | 12 +- .../sdk/iaas/v2beta1api/model/PortRange.java | 12 +- .../sdk/iaas/v2beta1api/model/Project.java | 12 +- .../v2beta1api/model/ProjectListResponse.java | 12 +- .../sdk/iaas/v2beta1api/model/Protocol.java | 12 +- .../sdk/iaas/v2beta1api/model/PublicIp.java | 63 ++- .../model/PublicIpListResponse.java | 39 +- .../iaas/v2beta1api/model/PublicNetwork.java | 12 +- .../model/PublicNetworkListResponse.java | 39 +- .../sdk/iaas/v2beta1api/model/Quota.java | 12 +- .../sdk/iaas/v2beta1api/model/QuotaList.java | 12 +- .../v2beta1api/model/QuotaListResponse.java | 12 +- .../iaas/v2beta1api/model/RegionalArea.java | 12 +- .../v2beta1api/model/RegionalAreaIPv4.java | 39 +- .../model/RegionalAreaListResponse.java | 12 +- .../sdk/iaas/v2beta1api/model/Request.java | 39 +- .../v2beta1api/model/RequestResource.java | 12 +- .../v2beta1api/model/RescueServerPayload.java | 12 +- .../v2beta1api/model/ResizeServerPayload.java | 12 +- .../v2beta1api/model/ResizeVolumePayload.java | 12 +- .../sdk/iaas/v2beta1api/model/Route.java | 12 +- .../v2beta1api/model/RouteDestination.java | 78 +++- .../v2beta1api/model/RouteListResponse.java | 39 +- .../iaas/v2beta1api/model/RouteNexthop.java | 6 +- .../iaas/v2beta1api/model/RoutingTable.java | 12 +- .../model/RoutingTableListResponse.java | 39 +- .../iaas/v2beta1api/model/SecurityGroup.java | 12 +- .../model/SecurityGroupListResponse.java | 39 +- .../v2beta1api/model/SecurityGroupRule.java | 12 +- .../model/SecurityGroupRuleListResponse.java | 39 +- .../model/SecurityGroupRuleProtocol.java | 12 +- .../sdk/iaas/v2beta1api/model/Server.java | 12 +- .../iaas/v2beta1api/model/ServerAgent.java | 12 +- .../v2beta1api/model/ServerConsoleUrl.java | 12 +- .../v2beta1api/model/ServerListResponse.java | 39 +- .../v2beta1api/model/ServerMaintenance.java | 12 +- .../iaas/v2beta1api/model/ServerNetwork.java | 57 ++- .../v2beta1api/model/ServerNetworking.java | 4 +- .../model/ServiceAccountMailListResponse.java | 12 +- .../model/SetImageSharePayload.java | 12 +- .../sdk/iaas/v2beta1api/model/Snapshot.java | 32 +- .../model/SnapshotListResponse.java | 39 +- .../model/UpdateAttachedVolumePayload.java | 12 +- .../v2beta1api/model/UpdateImagePayload.java | 12 +- .../model/UpdateImageSharePayload.java | 12 +- .../model/UpdateKeyPairPayload.java | 12 +- .../model/UpdateNetworkIPv4Body.java | 12 +- .../model/UpdateNetworkIPv6Body.java | 12 +- .../v2beta1api/model/UpdateNicPayload.java | 12 +- .../model/UpdatePublicIPPayload.java | 64 ++- .../model/UpdateRegionalAreaIPv4.java | 12 +- .../UpdateRouteOfRoutingTablePayload.java | 12 +- .../UpdateRoutingTableOfAreaPayload.java | 12 +- .../v2beta1api/model/UpdateServerPayload.java | 12 +- .../v2beta1api/model/UpdateVolumePayload.java | 12 +- ...V2beta1CreateNetworkAreaRegionPayload.java | 12 +- .../model/V2beta1CreateSnapshotPayload.java | 32 +- .../model/V2beta1UpdateBackupPayload.java | 12 +- ...V2beta1UpdateNetworkAreaRegionPayload.java | 12 +- .../V2beta1UpdateNetworkAreaRoutePayload.java | 12 +- .../V2beta1UpdateSecurityGroupPayload.java | 12 +- .../model/V2beta1UpdateSnapshotPayload.java | 12 +- .../sdk/iaas/v2beta1api/model/Volume.java | 12 +- .../v2beta1api/model/VolumeAttachment.java | 12 +- .../model/VolumeAttachmentListResponse.java | 39 +- .../model/VolumeEncryptionParameter.java | 12 +- .../v2beta1api/model/VolumeListResponse.java | 39 +- .../model/VolumePerformanceClass.java | 12 +- .../VolumePerformanceClassListResponse.java | 39 +- .../iaas/v2beta1api/model/VolumeSource.java | 12 +- 435 files changed, 6151 insertions(+), 3596 deletions(-) create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationPrefixList.java create mode 100644 services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationPrefixList.java diff --git a/services/iaas/build.gradle b/services/iaas/build.gradle index 314067c8..aafa5f0b 100644 --- a/services/iaas/build.gradle +++ b/services/iaas/build.gradle @@ -10,7 +10,7 @@ dependencies { implementation 'com.google.code.gson:gson:2.9.1' implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' - implementation 'org.openapitools:jackson-databind-nullable:0.2.8' + implementation 'org.openapitools:jackson-databind-nullable:0.2.12' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' diff --git a/services/iaas/oas_commit b/services/iaas/oas_commit index c0a0c9b8..2522c5a4 100644 --- a/services/iaas/oas_commit +++ b/services/iaas/oas_commit @@ -1 +1 @@ -43a874547d9e5b23655d0f351c47b32b46d4a19e +1cb7803383991935e2278722c995a222c96aa43a diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ApiClient.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ApiClient.java index 1c5fcbfb..99873d71 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ApiClient.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ApiClient.java @@ -398,6 +398,17 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + /** + * Set LocalDateTimeFormat. + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link cloud.stackit.sdk.iaas.v1api.ApiClient} object + */ + public ApiClient setLocalDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateTimeFormat(dateFormat); + return this; + } + /** * Set LenientOnJson. * @@ -598,6 +609,46 @@ public String parameterToString(Object param) { } } + /** + * Format the given parameter object as an ASCII-safe JSON string. + * + * @param param Parameter + * @return JSON representation of the parameter + */ + public String parameterToJsonString(Object param) { + if (param == null) { + return ""; + } + String json = JSON.serialize(param); + int firstUnsafe = -1; + for (int i = 0; i < json.length(); i++) { + if (json.charAt(i) >= 0x7f) { + firstUnsafe = i; + break; + } + } + if (firstUnsafe == -1) { + return json; + } + + StringBuilder escaped = new StringBuilder(json.length()); + escaped.append(json, 0, firstUnsafe); + for (int i = firstUnsafe; i < json.length(); i++) { + char c = json.charAt(i); + if (c >= 0x7f) { + escaped.append("\\u"); + escaped.append(Character.forDigit((c >> 12) & 0xf, 16)); + escaped.append(Character.forDigit((c >> 8) & 0xf, 16)); + escaped.append(Character.forDigit((c >> 4) & 0xf, 16)); + escaped.append(Character.forDigit(c & 0xf, 16)); + } else { + escaped.append(c); + } + } + + return escaped.toString(); + } + /** * Formats the specified query parameter to a list containing a single {@code Pair} object. * diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/JSON.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/JSON.java index 17b81fd9..66a5dc0e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/JSON.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/JSON.java @@ -31,8 +31,10 @@ import java.text.ParseException; import java.text.ParsePosition; import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.util.Date; import java.util.Map; import okio.ByteString; @@ -51,6 +53,8 @@ public class JSON { private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static LocalDateTimeTypeAdapter localDateTimeTypeAdapter = + new LocalDateTimeTypeAdapter(); private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") @@ -94,6 +98,7 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDateTime.class, localDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v1api.model.AddVolumeToServerPayload @@ -619,6 +624,53 @@ public LocalDate read(JsonReader in) throws IOException { } } + /** Gson TypeAdapter for JSR310 LocalDateTime type */ + public static class LocalDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE_TIME); + } + + public LocalDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + return LocalDateTime.parse(date, formatter); + } catch (DateTimeParseException e) { + if (date.length() > 10 && date.charAt(10) == ' ') { + date = date.substring(0, 10) + 'T' + date.substring(11); + return LocalDateTime.parse(date, formatter); + } + throw e; + } + } + } + } + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); } @@ -627,6 +679,10 @@ public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); } + public static void setLocalDateTimeFormat(DateTimeFormatter dateFormat) { + localDateTimeTypeAdapter.setFormat(dateFormat); + } + /** * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" * format will be used (more efficient than SimpleDateFormat). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/Pair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/Pair.java index 3b1fc7aa..f137231d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/Pair.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/Pair.java @@ -12,7 +12,7 @@ package cloud.stackit.sdk.iaas.v1api; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Pair { private final String name; private final String value; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ServerConfiguration.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ServerConfiguration.java index b236ab67..5c588282 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ServerConfiguration.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ServerConfiguration.java @@ -15,7 +15,7 @@ import java.util.Map; /** Representing a Server configuration. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerConfiguration { public String URL; public String description; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ServerVariable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ServerVariable.java index 681df9c4..b8fa8954 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ServerVariable.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/ServerVariable.java @@ -15,7 +15,7 @@ import java.util.HashSet; /** Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/StringUtil.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/StringUtil.java index cdf8c635..666c6f28 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/StringUtil.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/StringUtil.java @@ -15,7 +15,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AbstractOpenApiSchema.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AbstractOpenApiSchema.java index 75c13c29..9cc2758e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AbstractOpenApiSchema.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AbstractOpenApiSchema.java @@ -16,7 +16,7 @@ import java.util.Objects; /** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -104,10 +104,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public boolean equals(Object o) { diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AddVolumeToServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AddVolumeToServerPayload.java index 63fa3ee6..ffe58179 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AddVolumeToServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AddVolumeToServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a Volume attachment to a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AddVolumeToServerPayload { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -181,10 +182,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -269,7 +267,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AffinityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AffinityGroup.java index 3fa30f8f..b1b7e79e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AffinityGroup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AffinityGroup.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Definition of an affinity group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AffinityGroup { public static final String SERIALIZED_NAME_ID = "id"; @@ -212,10 +213,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -325,7 +323,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AffinityGroupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AffinityGroupListResponse.java index 2be598f2..c3bca91d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AffinityGroupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AffinityGroupListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Response object for affinity group list request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AffinityGroupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - AffinityGroup.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + AffinityGroup.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AllowedAddressesInner.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AllowedAddressesInner.java index 8527914f..c84483d0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AllowedAddressesInner.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AllowedAddressesInner.java @@ -28,7 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AllowedAddressesInner extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(AllowedAddressesInner.class.getName()); @@ -174,6 +174,7 @@ public Object getActualInstance() { * @return The actual instance of `String` * @throws ClassCastException if the instance is not `String` */ + @SuppressWarnings("unchecked") public String getString() throws ClassCastException { return (String) super.getActualInstance(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Area.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Area.java index 349d919a..0b639e38 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Area.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Area.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** The basic properties of a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Area { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; @@ -241,10 +242,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -372,7 +370,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaConfig.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaConfig.java index cf8697ff..57c886b0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaConfig.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaConfig.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** The basic network area object. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AreaConfig { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; @@ -246,10 +247,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -310,21 +308,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "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( - java.util.Locale.ROOT, - "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("networkRanges") != null) { + if (!jsonObj.get("networkRanges").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `networkRanges` to be an array in the JSON string but got `%s`", + jsonObj.get("networkRanges").toString())); + } + 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) { @@ -385,7 +382,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaId.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaId.java index 321d5efc..51e73816 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaId.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaId.java @@ -28,7 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AreaId extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(AreaId.class.getName()); @@ -197,6 +197,7 @@ public Object getActualInstance() { * @return The actual instance of `UUID` * @throws ClassCastException if the instance is not `UUID` */ + @SuppressWarnings("unchecked") public UUID getUUID() throws ClassCastException { return (UUID) super.getActualInstance(); } @@ -208,6 +209,7 @@ public UUID getUUID() throws ClassCastException { * @return The actual instance of `StaticAreaID` * @throws ClassCastException if the instance is not `StaticAreaID` */ + @SuppressWarnings("unchecked") public StaticAreaID getStaticAreaID() throws ClassCastException { return (StaticAreaID) super.getActualInstance(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaPrefixConfigIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaPrefixConfigIPv4.java index b4ac2f14..0d1289f9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaPrefixConfigIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AreaPrefixConfigIPv4.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The IPv4 prefix config for a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AreaPrefixConfigIPv4 { public static final String SERIALIZED_NAME_DEFAULT_PREFIX_LEN = "defaultPrefixLen"; @@ -189,10 +190,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -261,7 +259,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AvailabilityZoneListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AvailabilityZoneListResponse.java index c0a3b9ad..9369e37b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AvailabilityZoneListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/AvailabilityZoneListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Availability Zone list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AvailabilityZoneListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -151,10 +152,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Backup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Backup.java index 41619f84..1fa7371f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Backup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Backup.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a backup. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Backup { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -179,11 +180,21 @@ public Backup labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -373,10 +384,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -513,7 +521,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BackupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BackupListResponse.java index f3bf93d4..c19ea6e5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BackupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BackupListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Backup list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BackupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Backup.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Backup.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BackupSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BackupSource.java index 42cc873a..a2c04ba3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BackupSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BackupSource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The source object of a backup. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BackupSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -262,7 +260,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BaseSecurityGroupRule.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BaseSecurityGroupRule.java index a8005e3a..a62e77f2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BaseSecurityGroupRule.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BaseSecurityGroupRule.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** The base schema for a security group rule. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BaseSecurityGroupRule { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -384,10 +385,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -543,7 +541,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BootVolume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BootVolume.java index 22abd1b2..ec7e483c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BootVolume.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BootVolume.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The boot device for the server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BootVolume { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -237,10 +238,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -330,7 +328,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BootVolumeSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BootVolumeSource.java index a7cdf170..09380736 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BootVolumeSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/BootVolumeSource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The source object of a boot volume. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BootVolumeSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -263,7 +261,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAffinityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAffinityGroupPayload.java index 269b228f..bf645ce6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAffinityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAffinityGroupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Definition of an affinity group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateAffinityGroupPayload { public static final String SERIALIZED_NAME_ID = "id"; @@ -213,10 +214,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -328,7 +326,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAreaAddressFamily.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAreaAddressFamily.java index 550a61d1..42445be1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAreaAddressFamily.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAreaAddressFamily.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The addressFamily object for a area create request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateAreaAddressFamily { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -138,10 +139,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -213,7 +211,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAreaIPv4.java index fbf7b72c..b12626d4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAreaIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateAreaIPv4.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** The config object for a IPv4 network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateAreaIPv4 { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; @@ -329,10 +330,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -396,21 +394,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "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( - java.util.Locale.ROOT, - "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("networkRanges") != null) { + if (!jsonObj.get("networkRanges").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `networkRanges` to be an array in the JSON string but got `%s`", + jsonObj.get("networkRanges").toString())); + } + 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) { @@ -471,7 +468,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateBackupPayload.java index 6d3e541b..5688e439 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateBackupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a backup create request body. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateBackupPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -80,11 +81,21 @@ public CreateBackupPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -219,10 +230,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -320,7 +328,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateImagePayload.java index 94a5ec4f..6de9cfd0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateImagePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents an Image and its parameters. Used for Creating and returning (get/list). */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateImagePayload { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -246,11 +247,21 @@ public CreateImagePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -512,10 +523,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -671,7 +679,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateKeyPairPayload.java index 8060519a..1b9f41ee 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateKeyPairPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents the public key of an SSH keypair and its name. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateKeyPairPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -99,11 +100,21 @@ public CreateKeyPairPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -253,10 +264,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -366,7 +374,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAddressFamily.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAddressFamily.java index 15381dc5..104b8186 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAddressFamily.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAddressFamily.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The addressFamily object for a network create request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkAddressFamily { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -163,10 +164,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -242,7 +240,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaPayload.java index 12242de7..0516e872 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** CreateNetworkAreaPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkAreaPayload { public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "addressFamily"; @@ -78,11 +79,21 @@ public CreateNetworkAreaPayload labels(@javax.annotation.Nullable Object labels) } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -197,10 +208,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -289,7 +297,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaRangePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaRangePayload.java index 6b498c42..ee284b0d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaRangePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaRangePayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** CreateNetworkAreaRangePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkAreaRangePayload { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -242,7 +240,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaRoutePayload.java index bfc3d792..2ac78857 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkAreaRoutePayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** CreateNetworkAreaRoutePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkAreaRoutePayload { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -242,7 +240,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkIPv4Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkIPv4Body.java index 639afaa9..cf73f80e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkIPv4Body.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkIPv4Body.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The config object for an IPv4 network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv4Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -240,10 +241,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -338,7 +336,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkIPv6Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkIPv6Body.java index 102669f9..c0d3cbc6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkIPv6Body.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkIPv6Body.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The config object for an IPv6 network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv6Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -240,10 +241,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -338,7 +336,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkPayload.java index 7db3e4a5..5b87f703 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNetworkPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,13 +32,18 @@ import java.util.Objects; /** Object that represents the request body for a network create. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -81,6 +87,24 @@ public void setAddressFamily( this.addressFamily = addressFamily; } + public CreateNetworkPayload description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public CreateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -105,11 +129,21 @@ public CreateNetworkPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -212,6 +246,7 @@ public boolean equals(Object o) { } CreateNetworkPayload createNetworkPayload = (CreateNetworkPayload) o; return Objects.equals(this.addressFamily, createNetworkPayload.addressFamily) + && Objects.equals(this.description, createNetworkPayload.description) && Objects.equals(this.dhcp, createNetworkPayload.dhcp) && Objects.equals(this.labels, createNetworkPayload.labels) && Objects.equals(this.name, createNetworkPayload.name) @@ -222,7 +257,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(addressFamily, dhcp, labels, name, routed, additionalProperties); + return Objects.hash( + addressFamily, description, dhcp, labels, name, routed, additionalProperties); } @Override @@ -230,6 +266,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNetworkPayload {\n"); sb.append(" addressFamily: ").append(toIndentedString(addressFamily)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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"); @@ -246,10 +283,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -259,7 +293,13 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet( - Arrays.asList("addressFamily", "dhcp", "labels", "name", "routed")); + Arrays.asList( + "addressFamily", + "description", + "dhcp", + "labels", + "name", + "routed")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(Arrays.asList("name")); @@ -299,6 +339,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("addressFamily") != null && !jsonObj.get("addressFamily").isJsonNull()) { CreateNetworkAddressFamily.validateJsonElement(jsonObj.get("addressFamily")); } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -341,7 +389,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNicPayload.java index abfde85f..f668df37 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateNicPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -24,6 +25,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -34,13 +36,18 @@ import java.util.UUID; /** Object that represents a network interface. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_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) @@ -106,17 +113,31 @@ public class CreateNicPayload { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreateNicPayload() {} public CreateNicPayload( - UUID device, UUID id, String mac, UUID networkId, String status, String type) { + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public CreateNicPayload allowedAddresses( @@ -147,6 +168,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public CreateNicPayload description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -225,11 +255,21 @@ public CreateNicPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -340,6 +380,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -394,6 +443,7 @@ public boolean equals(Object o) { } CreateNicPayload createNicPayload = (CreateNicPayload) o; return Objects.equals(this.allowedAddresses, createNicPayload.allowedAddresses) + && Objects.equals(this.createdAt, createNicPayload.createdAt) && Objects.equals(this.description, createNicPayload.description) && Objects.equals(this.device, createNicPayload.device) && Objects.equals(this.id, createNicPayload.id) @@ -407,6 +457,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, createNicPayload.securityGroups) && Objects.equals(this.status, createNicPayload.status) && Objects.equals(this.type, createNicPayload.type) + && Objects.equals(this.updatedAt, createNicPayload.updatedAt) && Objects.equals(this.additionalProperties, createNicPayload.additionalProperties); } @@ -414,6 +465,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -427,6 +479,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -435,6 +488,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNicPayload {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -448,6 +502,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -460,10 +515,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -475,6 +527,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -487,7 +540,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -656,7 +710,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateProtocol.java index f0219b88..ae1940e6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateProtocol.java @@ -28,7 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateProtocol extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateProtocol.class.getName()); @@ -212,6 +212,7 @@ public Object getActualInstance() { * @return The actual instance of `Long` * @throws ClassCastException if the instance is not `Long` */ + @SuppressWarnings("unchecked") public Long getLong() throws ClassCastException { return (Long) super.getActualInstance(); } @@ -223,6 +224,7 @@ public Long getLong() throws ClassCastException { * @return The actual instance of `String` * @throws ClassCastException if the instance is not `String` */ + @SuppressWarnings("unchecked") public String getString() throws ClassCastException { return (String) super.getActualInstance(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreatePublicIPPayload.java index 697fa223..f834e4d8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreatePublicIPPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -23,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -33,8 +35,13 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreatePublicIPPayload { + 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) @@ -55,12 +62,29 @@ public class CreatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreatePublicIPPayload() {} - public CreatePublicIPPayload(UUID id, String ip) { + public CreatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -87,11 +111,21 @@ public CreatePublicIPPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -122,6 +156,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -175,10 +218,12 @@ public boolean equals(Object o) { return false; } CreatePublicIPPayload createPublicIPPayload = (CreatePublicIPPayload) o; - return Objects.equals(this.id, createPublicIPPayload.id) + return Objects.equals(this.createdAt, createPublicIPPayload.createdAt) + && Objects.equals(this.id, createPublicIPPayload.id) && Objects.equals(this.ip, createPublicIPPayload.ip) && Objects.equals(this.labels, createPublicIPPayload.labels) && Objects.equals(this.networkInterface, createPublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, createPublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, createPublicIPPayload.additionalProperties); } @@ -194,7 +239,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -208,10 +254,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\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(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -224,10 +272,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -236,7 +281,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -320,7 +372,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupPayload.java index 662c4778..67bd3a17 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** Object that represents a security group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSecurityGroupPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -133,11 +134,21 @@ public CreateSecurityGroupPayload labels(@javax.annotation.Nullable Object label } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -308,10 +319,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -443,7 +451,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupRulePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupRulePayload.java index 72706ade..2cd6f039 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupRulePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupRulePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a request body for security group rule creation. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSecurityGroupRulePayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -418,10 +419,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -585,7 +583,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupRuleProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupRuleProtocol.java index 4904640a..33936156 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupRuleProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSecurityGroupRuleProtocol.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The internet protocol which the rule should match. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSecurityGroupRuleProtocol { public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; @@ -141,10 +142,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -218,7 +216,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerNetworking.java index 188d7af9..c81fb3aa 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerNetworking.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerNetworking.java @@ -31,7 +31,7 @@ import java.util.UUID; /** The initial networking setup for the server creation with a network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerNetworking { public static final String SERIALIZED_NAME_NETWORK_ID = "networkId"; @@ -89,10 +89,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerNetworkingWithNics.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerNetworkingWithNics.java index 998658ec..fefee921 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerNetworkingWithNics.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerNetworkingWithNics.java @@ -33,7 +33,7 @@ import java.util.UUID; /** The initial networking setup for the server creation with a network interface. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerNetworkingWithNics { public static final String SERIALIZED_NAME_NIC_IDS = "nicIds"; @@ -100,10 +100,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayload.java index f1248325..cce53459 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ import java.util.UUID; /** Representation of a single server object. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerPayload { public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; @@ -351,11 +352,21 @@ public CreateServerPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -764,10 +775,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -1018,7 +1026,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayloadNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayloadNetworking.java index 3bc90ddc..96c19829 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayloadNetworking.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateServerPayloadNetworking.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerPayloadNetworking extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateServerPayloadNetworking.class.getName()); @@ -216,6 +216,7 @@ public Object getActualInstance() { * @return The actual instance of `CreateServerNetworking` * @throws ClassCastException if the instance is not `CreateServerNetworking` */ + @SuppressWarnings("unchecked") public CreateServerNetworking getCreateServerNetworking() throws ClassCastException { return (CreateServerNetworking) super.getActualInstance(); } @@ -227,6 +228,7 @@ public CreateServerNetworking getCreateServerNetworking() throws ClassCastExcept * @return The actual instance of `CreateServerNetworkingWithNics` * @throws ClassCastException if the instance is not `CreateServerNetworkingWithNics` */ + @SuppressWarnings("unchecked") public CreateServerNetworkingWithNics getCreateServerNetworkingWithNics() throws ClassCastException { return (CreateServerNetworkingWithNics) super.getActualInstance(); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSnapshotPayload.java index ab75445a..4359eb68 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateSnapshotPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a snapshot. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSnapshotPayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -155,11 +156,21 @@ public CreateSnapshotPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -346,10 +357,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -488,7 +496,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateVolumePayload.java index 6fac28e5..0c320c24 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/CreateVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateVolumePayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -255,11 +256,21 @@ public CreateVolumePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -508,10 +519,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -677,7 +685,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Error.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Error.java index b492dfa6..52df712c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Error.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Error.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Error with HTTP error code and an error message. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Error { public static final String SERIALIZED_NAME_CODE = "code"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -254,7 +252,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/GetServerLog200Response.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/GetServerLog200Response.java index df995212..157efe26 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/GetServerLog200Response.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/GetServerLog200Response.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** GetServerLog200Response */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetServerLog200Response { public static final String SERIALIZED_NAME_OUTPUT = "output"; @@ -138,10 +139,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -217,7 +215,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ICMPParameters.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ICMPParameters.java index a7b2b426..969324ed 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ICMPParameters.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ICMPParameters.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents ICMP parameters. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ICMPParameters { public static final String SERIALIZED_NAME_CODE = "code"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Image.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Image.java index 604ac770..1d8f7cde 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Image.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Image.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents an Image and its parameters. Used for Creating and returning (get/list). */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Image { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -246,11 +247,21 @@ public Image labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -511,10 +522,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -669,7 +677,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageAgent.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageAgent.java index 70b1dde4..9b3a6f6f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageAgent.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageAgent.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Support status and default provioning setting for the STACKIT server agent. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageAgent { public static final String SERIALIZED_NAME_PROVISION_BY_DEFAULT = "provisionByDefault"; @@ -165,10 +166,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -234,7 +232,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageChecksum.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageChecksum.java index 934d2e42..b10c265b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageChecksum.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageChecksum.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Representation of an image checksum. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageChecksum { public static final String SERIALIZED_NAME_ALGORITHM = "algorithm"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -262,7 +260,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageConfig.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageConfig.java index d25d183a..3d94d6ac 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageConfig.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageConfig.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Properties to set hardware and scheduling settings for an Image. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageConfig { public static final String SERIALIZED_NAME_ARCHITECTURE = "architecture"; @@ -510,10 +511,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -677,7 +675,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageCreateResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageCreateResponse.java index bd38d1c6..56922f79 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageCreateResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageCreateResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Image creation response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageCreateResponse { public static final String SERIALIZED_NAME_ID = "id"; @@ -169,10 +170,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -265,7 +263,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageListResponse.java index d21a87aa..08244cb1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Image list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Image.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Image.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageShare.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageShare.java index 983c8f5b..513fe4a0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageShare.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageShare.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageShare { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -176,10 +177,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -255,7 +253,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageShareConsumer.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageShareConsumer.java index ce0e0230..2cbab238 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageShareConsumer.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ImageShareConsumer.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** The details of an Image share consumer. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageShareConsumer { public static final String SERIALIZED_NAME_CONSUMER_PROJECT_ID = "consumerProjectId"; @@ -193,10 +194,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -282,7 +280,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/KeyPairListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/KeyPairListResponse.java index 3c225755..620d7514 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/KeyPairListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/KeyPairListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** SSH keypair list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class KeyPairListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Keypair.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Keypair.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Keypair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Keypair.java index 045f6eba..4486f255 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Keypair.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Keypair.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents the public key of an SSH keypair and its name. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Keypair { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -98,11 +99,21 @@ public Keypair labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -251,10 +262,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -363,7 +371,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/MachineType.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/MachineType.java index 2026459e..9b2aaf35 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/MachineType.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/MachineType.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ * Machine Type. Filterable Fields: `disk`, `extraSpecs`, `name`, * `ram`, `vcpus`. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class MachineType { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -273,10 +274,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -371,7 +369,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/MachineTypeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/MachineTypeListResponse.java index 0b23481b..b3c061db 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/MachineTypeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/MachineTypeListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Machine type list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class MachineTypeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - MachineType.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + MachineType.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NIC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NIC.java index 23833cc8..41d15c2c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NIC.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NIC.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -24,6 +25,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -34,13 +36,18 @@ import java.util.UUID; /** Object that represents a network interface. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_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) @@ -106,16 +113,31 @@ public class NIC { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public NIC() {} - public NIC(UUID device, UUID id, String mac, UUID networkId, String status, String type) { + public NIC( + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public NIC allowedAddresses( @@ -146,6 +168,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public NIC description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -224,11 +255,21 @@ public NIC labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -339,6 +380,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -393,6 +443,7 @@ public boolean equals(Object o) { } NIC NIC = (NIC) o; return Objects.equals(this.allowedAddresses, NIC.allowedAddresses) + && Objects.equals(this.createdAt, NIC.createdAt) && Objects.equals(this.description, NIC.description) && Objects.equals(this.device, NIC.device) && Objects.equals(this.id, NIC.id) @@ -406,6 +457,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, NIC.securityGroups) && Objects.equals(this.status, NIC.status) && Objects.equals(this.type, NIC.type) + && Objects.equals(this.updatedAt, NIC.updatedAt) && Objects.equals(this.additionalProperties, NIC.additionalProperties); } @@ -413,6 +465,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -426,6 +479,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -434,6 +488,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NIC {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -447,6 +502,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -459,10 +515,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -474,6 +527,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -486,7 +540,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -654,7 +709,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NICListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NICListResponse.java index 90d8f50f..60d0877a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NICListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NICListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** NIC list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NICListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -149,10 +150,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -196,21 +194,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - NIC.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + NIC.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -246,7 +243,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Network.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Network.java index 6c3a3192..f990bb0c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Network.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Network.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,13 +36,18 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -132,6 +138,24 @@ public Network(OffsetDateTime createdAt, OffsetDateTime updatedAt) { return createdAt; } + public Network description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public Network dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -194,11 +218,21 @@ public Network labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -472,6 +506,7 @@ public boolean equals(Object o) { } Network network = (Network) o; return Objects.equals(this.createdAt, network.createdAt) + && Objects.equals(this.description, network.description) && Objects.equals(this.dhcp, network.dhcp) && Objects.equals(this.gateway, network.gateway) && Objects.equals(this.gatewayv6, network.gatewayv6) @@ -502,6 +537,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) public int hashCode() { return Objects.hash( createdAt, + description, dhcp, gateway, gatewayv6, @@ -531,6 +567,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Network {\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" dhcp: ").append(toIndentedString(dhcp)).append("\n"); sb.append(" gateway: ").append(toIndentedString(gateway)).append("\n"); sb.append(" gatewayv6: ").append(toIndentedString(gatewayv6)).append("\n"); @@ -557,10 +594,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -572,6 +606,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "createdAt", + "description", "dhcp", "gateway", "gatewayv6", @@ -621,6 +656,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } if ((jsonObj.get("gateway") != null && !jsonObj.get("gateway").isJsonNull()) && !jsonObj.get("gateway").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -740,7 +783,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkArea.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkArea.java index 694ffc38..ed3b2d7f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkArea.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkArea.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkArea { public static final String SERIALIZED_NAME_AREA_ID = "areaId"; @@ -139,11 +140,21 @@ public NetworkArea labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -325,10 +336,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -442,7 +450,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkAreaIPv4.java index a9c5cc51..a43db460 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkAreaIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkAreaIPv4.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** The IPv4 properties of a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkAreaIPv4 { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; @@ -325,10 +326,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -460,7 +458,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkAreaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkAreaListResponse.java index a0ac4298..964e958f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkAreaListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkAreaListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Network area list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkAreaListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - NetworkArea.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + NetworkArea.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkListResponse.java index 05d4bb53..16b2df8b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Network list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Network.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Network.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkRange.java index 3d67a133..807b82e4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkRange.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkRange.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a network range. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkRange { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -196,10 +197,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -294,7 +292,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkRangeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkRangeListResponse.java index 1e959756..5586814b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkRangeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/NetworkRangeListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Network Range list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkRangeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - NetworkRange.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + NetworkRange.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkAreaPayload.java index 36c1f9f0..91d016ff 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkAreaPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** PartialUpdateNetworkAreaPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PartialUpdateNetworkAreaPayload { public static final String SERIALIZED_NAME_ADDRESS_FAMILY = "addressFamily"; @@ -75,11 +76,21 @@ public PartialUpdateNetworkAreaPayload labels(@javax.annotation.Nullable Object } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -195,10 +206,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -280,7 +288,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkPayload.java index b72e0dd7..79affc3d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PartialUpdateNetworkPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,13 +32,18 @@ import java.util.Objects; /** Object that represents the request body for a network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_DHCP = "dhcp"; @SerializedName(SERIALIZED_NAME_DHCP) @@ -80,6 +86,24 @@ public void setAddressFamily( this.addressFamily = addressFamily; } + public PartialUpdateNetworkPayload description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description Object. Allows string up to 255 Characters. + * + * @return description + */ + @javax.annotation.Nullable public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + public PartialUpdateNetworkPayload dhcp(@javax.annotation.Nullable Boolean dhcp) { this.dhcp = dhcp; return this; @@ -104,11 +128,21 @@ public PartialUpdateNetworkPayload labels(@javax.annotation.Nullable Object labe } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -210,6 +244,7 @@ public boolean equals(Object o) { } PartialUpdateNetworkPayload partialUpdateNetworkPayload = (PartialUpdateNetworkPayload) o; return Objects.equals(this.addressFamily, partialUpdateNetworkPayload.addressFamily) + && Objects.equals(this.description, partialUpdateNetworkPayload.description) && Objects.equals(this.dhcp, partialUpdateNetworkPayload.dhcp) && Objects.equals(this.labels, partialUpdateNetworkPayload.labels) && Objects.equals(this.name, partialUpdateNetworkPayload.name) @@ -221,7 +256,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(addressFamily, dhcp, labels, name, routed, additionalProperties); + return Objects.hash( + addressFamily, description, dhcp, labels, name, routed, additionalProperties); } @Override @@ -229,6 +265,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PartialUpdateNetworkPayload {\n"); sb.append(" addressFamily: ").append(toIndentedString(addressFamily)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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"); @@ -245,10 +282,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -258,7 +292,13 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet( - Arrays.asList("addressFamily", "dhcp", "labels", "name", "routed")); + Arrays.asList( + "addressFamily", + "description", + "dhcp", + "labels", + "name", + "routed")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -287,6 +327,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("addressFamily") != null && !jsonObj.get("addressFamily").isJsonNull()) { UpdateNetworkAddressFamily.validateJsonElement(jsonObj.get("addressFamily")); } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `description` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("description").toString())); + } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -331,7 +379,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PortRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PortRange.java index 59eb73e5..4b68d89c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PortRange.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PortRange.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ * Object that represents a range of ports (this will be omitted if it covers the full default range * 0/1-65535). */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PortRange { public static final String SERIALIZED_NAME_MAX = "max"; @@ -169,10 +170,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -250,7 +248,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Project.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Project.java index 02fff3ff..7773d42b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Project.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Project.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a STACKIT project. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Project { public static final String SERIALIZED_NAME_AREA_ID = "areaId"; @@ -287,10 +288,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -402,7 +400,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ProjectListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ProjectListResponse.java index 96eae759..939e1360 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ProjectListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ProjectListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Project list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ProjectListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -243,7 +241,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Protocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Protocol.java index 535a2508..ed8ac155 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Protocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Protocol.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The schema for a protocol of a security group rule. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Protocol { public static final String SERIALIZED_NAME_NAME = "name"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -244,7 +242,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIp.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIp.java index c73d44fa..f377d993 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIp.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIp.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -23,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -33,8 +35,13 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicIp { + 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) @@ -55,12 +62,28 @@ public class PublicIp { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public PublicIp() {} - public PublicIp(UUID id, String ip) { + public PublicIp(OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -87,11 +110,21 @@ public PublicIp labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -121,6 +154,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -174,10 +216,12 @@ public boolean equals(Object o) { return false; } PublicIp publicIp = (PublicIp) o; - return Objects.equals(this.id, publicIp.id) + return Objects.equals(this.createdAt, publicIp.createdAt) + && Objects.equals(this.id, publicIp.id) && Objects.equals(this.ip, publicIp.ip) && Objects.equals(this.labels, publicIp.labels) && Objects.equals(this.networkInterface, publicIp.networkInterface) + && Objects.equals(this.updatedAt, publicIp.updatedAt) && Objects.equals(this.additionalProperties, publicIp.additionalProperties); } @@ -192,7 +236,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -206,10 +251,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PublicIp {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\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(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -222,10 +269,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -234,7 +278,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -317,7 +368,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIpListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIpListResponse.java index d9c4933e..439d982d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIpListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicIpListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Public IP list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicIpListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - PublicIp.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + PublicIp.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicNetwork.java index 5b09f349..35c44b0e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicNetwork.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicNetwork.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Public network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicNetwork { public static final String SERIALIZED_NAME_CIDR = "cidr"; @@ -139,10 +140,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -227,7 +225,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicNetworkListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicNetworkListResponse.java index 5f5067f1..8d68c106 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicNetworkListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/PublicNetworkListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Public network list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicNetworkListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - PublicNetwork.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + PublicNetwork.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Quota.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Quota.java index 623015ef..51b18e4d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Quota.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Quota.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a single resource quota. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Quota { public static final String SERIALIZED_NAME_LIMIT = "limit"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/QuotaList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/QuotaList.java index d0373583..48fc1672 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/QuotaList.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/QuotaList.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the quotas for a project. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class QuotaList { public static final String SERIALIZED_NAME_BACKUP_GIGABYTES = "backupGigabytes"; @@ -451,10 +452,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -584,7 +582,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/QuotaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/QuotaListResponse.java index 23ca8f28..e797b860 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/QuotaListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/QuotaListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Quotas list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class QuotaListResponse { public static final String SERIALIZED_NAME_QUOTAS = "quotas"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -224,7 +222,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Request.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Request.java index 74e3e2af..082e8b55 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Request.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Request.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Object that represents a request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Request { public static final String SERIALIZED_NAME_DETAILS = "details"; @@ -296,10 +297,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -387,21 +385,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "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( - java.util.Locale.ROOT, - "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("resources") != null) { + if (!jsonObj.get("resources").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `resources` to be an array in the JSON string but got `%s`", + jsonObj.get("resources").toString())); + } + 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( @@ -443,7 +440,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RequestResource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RequestResource.java index 0a5d9a0a..9283e987 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RequestResource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RequestResource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a resource as part of a request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RequestResource { public static final String SERIALIZED_NAME_ID = "id"; @@ -200,10 +201,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -303,7 +301,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RescueServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RescueServerPayload.java index 9d71cd24..3490c511 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RescueServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RescueServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** RescueServerPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RescueServerPayload { public static final String SERIALIZED_NAME_IMAGE = "image"; @@ -141,10 +142,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -230,7 +228,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ResizeServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ResizeServerPayload.java index 93597d03..78e344e3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ResizeServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ResizeServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ResizeServerPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ResizeServerPayload { public static final String SERIALIZED_NAME_MACHINE_TYPE = "machineType"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -229,7 +227,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ResizeVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ResizeVolumePayload.java index 1dd27906..4456cd3b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ResizeVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ResizeVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ResizeVolumePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ResizeVolumePayload { public static final String SERIALIZED_NAME_SIZE = "size"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -222,7 +220,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Route.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Route.java index e7f89d3b..8baf6b4e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Route.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Route.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object represents a network route. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Route { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -91,11 +92,21 @@ public Route labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -253,10 +264,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -364,7 +372,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RouteListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RouteListResponse.java index eef9045b..a5d4262c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RouteListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/RouteListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Route list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RouteListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Route.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Route.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroup.java index 939310be..82abd98b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroup.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** Object that represents a security group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroup { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -133,11 +134,21 @@ public SecurityGroup labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -307,10 +318,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -440,7 +448,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupListResponse.java index 0d502621..bd905f20 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Security group list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - SecurityGroup.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + SecurityGroup.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRule.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRule.java index 786baa45..fb879e61 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRule.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRule.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a security group rule. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupRule { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -410,10 +411,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -574,7 +572,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRuleListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRuleListResponse.java index c7285a72..491a34df 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRuleListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRuleListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Security group rule list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupRuleListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -153,10 +154,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -201,21 +199,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - SecurityGroupRule.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + SecurityGroupRule.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -253,7 +250,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRuleProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRuleProtocol.java index a98eebf9..ddf34e17 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRuleProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SecurityGroupRuleProtocol.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The internet protocol which the rule matches. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupRuleProtocol { public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; @@ -138,10 +139,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -213,7 +211,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Server.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Server.java index 925d8eb0..a86a0af0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Server.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Server.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ import java.util.UUID; /** Representation of a single server object. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Server { public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; @@ -350,11 +351,21 @@ public Server labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -759,10 +770,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -1012,7 +1020,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerAgent.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerAgent.java index 839df6a3..0032b8cb 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerAgent.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerAgent.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** STACKIT server agent options for a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerAgent { public static final String SERIALIZED_NAME_PROVISIONED = "provisioned"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -209,7 +207,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerConsoleUrl.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerConsoleUrl.java index 4f7328bd..ad0e5379 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerConsoleUrl.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerConsoleUrl.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a server console URL. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerConsoleUrl { public static final String SERIALIZED_NAME_URL = "url"; @@ -139,10 +140,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -228,7 +226,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerListResponse.java index 1dd3e138..e288bf97 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Response object for server list request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Server.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Server.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerMaintenance.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerMaintenance.java index 6f3e0dbc..23c0ee1c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerMaintenance.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerMaintenance.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents the information about the next planned server maintenance window. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerMaintenance { public static final String SERIALIZED_NAME_DETAILS = "details"; @@ -220,10 +221,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -318,7 +316,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetwork.java index a64db7d9..b7128306 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetwork.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetwork.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -24,6 +25,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -34,13 +36,18 @@ import java.util.UUID; /** Describes the object that matches servers to its networks. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_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) @@ -91,8 +98,19 @@ public class ServerNetwork { @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) @javax.annotation.Nullable private List securityGroups = new ArrayList<>(); + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public ServerNetwork() {} + public ServerNetwork(OffsetDateTime createdAt, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + public ServerNetwork allowedAddresses( @javax.annotation.Nullable List allowedAddresses) { this.allowedAddresses = allowedAddresses; @@ -121,6 +139,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public ServerNetwork ipv4(@javax.annotation.Nullable String ipv4) { this.ipv4 = ipv4; return this; @@ -296,6 +323,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou this.securityGroups = securityGroups; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -350,6 +386,7 @@ public boolean equals(Object o) { } ServerNetwork serverNetwork = (ServerNetwork) o; return Objects.equals(this.allowedAddresses, serverNetwork.allowedAddresses) + && Objects.equals(this.createdAt, serverNetwork.createdAt) && Objects.equals(this.ipv4, serverNetwork.ipv4) && Objects.equals(this.ipv6, serverNetwork.ipv6) && Objects.equals(this.mac, serverNetwork.mac) @@ -359,6 +396,7 @@ public boolean equals(Object o) { && Objects.equals(this.nicSecurity, serverNetwork.nicSecurity) && Objects.equals(this.publicIp, serverNetwork.publicIp) && Objects.equals(this.securityGroups, serverNetwork.securityGroups) + && Objects.equals(this.updatedAt, serverNetwork.updatedAt) && Objects.equals(this.additionalProperties, serverNetwork.additionalProperties); } @@ -366,6 +404,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, ipv4, ipv6, mac, @@ -375,6 +414,7 @@ public int hashCode() { nicSecurity, publicIp, securityGroups, + updatedAt, additionalProperties); } @@ -383,6 +423,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ServerNetwork {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).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"); @@ -392,6 +433,7 @@ public String toString() { sb.append(" nicSecurity: ").append(toIndentedString(nicSecurity)).append("\n"); sb.append(" publicIp: ").append(toIndentedString(publicIp)).append("\n"); sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -404,10 +446,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -419,6 +458,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "ipv4", "ipv6", "mac", @@ -427,7 +467,8 @@ private String toIndentedString(Object o) { "nicId", "nicSecurity", "publicIp", - "securityGroups")); + "securityGroups", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = @@ -581,7 +622,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetworking.java index 1e45a82d..2809f710 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetworking.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServerNetworking.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerNetworking extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(ServerNetworking.class.getName()); @@ -212,6 +212,7 @@ public Object getActualInstance() { * @return The actual instance of `CreateServerNetworking` * @throws ClassCastException if the instance is not `CreateServerNetworking` */ + @SuppressWarnings("unchecked") public CreateServerNetworking getCreateServerNetworking() throws ClassCastException { return (CreateServerNetworking) super.getActualInstance(); } @@ -223,6 +224,7 @@ public CreateServerNetworking getCreateServerNetworking() throws ClassCastExcept * @return The actual instance of `CreateServerNetworkingWithNics` * @throws ClassCastException if the instance is not `CreateServerNetworkingWithNics` */ + @SuppressWarnings("unchecked") public CreateServerNetworkingWithNics getCreateServerNetworkingWithNics() throws ClassCastException { return (CreateServerNetworkingWithNics) super.getActualInstance(); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServiceAccountMailListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServiceAccountMailListResponse.java index 1575eac1..17bbf4d5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServiceAccountMailListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/ServiceAccountMailListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Service account mail list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServiceAccountMailListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -151,10 +152,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SetImageSharePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SetImageSharePayload.java index a287e089..ad24322c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SetImageSharePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SetImageSharePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SetImageSharePayload { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -178,10 +179,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -258,7 +256,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Snapshot.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Snapshot.java index c9f90a9f..0bfdfe0b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Snapshot.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Snapshot.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a snapshot. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Snapshot { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -155,11 +156,21 @@ public Snapshot labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -345,10 +356,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -486,7 +494,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SnapshotListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SnapshotListResponse.java index d69b032a..3727c1dc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SnapshotListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/SnapshotListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Snapshot list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SnapshotListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Snapshot.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Snapshot.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAreaAddressFamily.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAreaAddressFamily.java index c2aa0c3d..5d90a45b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAreaAddressFamily.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAreaAddressFamily.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The addressFamily object for a area update request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateAreaAddressFamily { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -138,10 +139,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -213,7 +211,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAreaIPv4.java index cc4f9765..4101e283 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAreaIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAreaIPv4.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** The update object for a IPv4 network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateAreaIPv4 { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; @@ -229,10 +230,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -314,7 +312,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAttachedVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAttachedVolumePayload.java index 612796ee..d2a370fc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAttachedVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateAttachedVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a Volume attachment to a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateAttachedVolumePayload { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -182,10 +183,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -271,7 +269,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateBackupPayload.java index d0541ed2..8c1e1e55 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateBackupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a backup. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateBackupPayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -179,11 +180,21 @@ public UpdateBackupPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -374,10 +385,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -515,7 +523,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImagePayload.java index 938a11aa..e45986db 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImagePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of an Image. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateImagePayload { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -136,11 +137,21 @@ public UpdateImagePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -327,10 +338,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -431,7 +439,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImageSharePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImageSharePayload.java index bec0adc1..d29a9633 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImageSharePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateImageSharePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateImageSharePayload { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -178,10 +179,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -259,7 +257,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateKeyPairPayload.java index b23f84a3..b3cc70ec 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateKeyPairPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a public key of an SSH keypair. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateKeyPairPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -46,11 +47,21 @@ public UpdateKeyPairPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -142,10 +153,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -212,7 +220,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAddressFamily.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAddressFamily.java index b54ddc53..4d7c5a4a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAddressFamily.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAddressFamily.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The addressFamily object for a network update request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNetworkAddressFamily { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -163,10 +164,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -242,7 +240,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAreaRoutePayload.java index 5d5cd69a..3e7fa6da 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAreaRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkAreaRoutePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the request body for a route update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNetworkAreaRoutePayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -46,11 +47,21 @@ public UpdateNetworkAreaRoutePayload labels(@javax.annotation.Nullable Object la } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -144,10 +155,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -217,7 +225,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkIPv4Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkIPv4Body.java index efe5470f..a03b5da1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkIPv4Body.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkIPv4Body.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The config object for a IPv4 network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNetworkIPv4Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -190,10 +191,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -278,7 +276,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkIPv6Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkIPv6Body.java index 43fbb629..43a6bb96 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkIPv6Body.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNetworkIPv6Body.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The config object for a IPv6 network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNetworkIPv6Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -190,10 +191,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -278,7 +276,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNicPayload.java index 974fd652..b0e84d56 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateNicPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** Object that represents a network interface update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNicPayload { public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; @@ -120,11 +121,21 @@ public UpdateNicPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -294,10 +305,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -418,7 +426,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdatePublicIPPayload.java index 5fdb7c71..0834c660 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdatePublicIPPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -23,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -33,8 +35,13 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdatePublicIPPayload { + 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) @@ -55,12 +62,29 @@ public class UpdatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public UpdatePublicIPPayload() {} - public UpdatePublicIPPayload(UUID id, String ip) { + public UpdatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -87,11 +111,21 @@ public UpdatePublicIPPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -122,6 +156,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -175,10 +218,12 @@ public boolean equals(Object o) { return false; } UpdatePublicIPPayload updatePublicIPPayload = (UpdatePublicIPPayload) o; - return Objects.equals(this.id, updatePublicIPPayload.id) + return Objects.equals(this.createdAt, updatePublicIPPayload.createdAt) + && Objects.equals(this.id, updatePublicIPPayload.id) && Objects.equals(this.ip, updatePublicIPPayload.ip) && Objects.equals(this.labels, updatePublicIPPayload.labels) && Objects.equals(this.networkInterface, updatePublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, updatePublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, updatePublicIPPayload.additionalProperties); } @@ -194,7 +239,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -208,10 +254,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\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(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -224,10 +272,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -236,7 +281,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -320,7 +372,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSecurityGroupPayload.java index 1ab40acf..557061fd 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSecurityGroupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a security group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateSecurityGroupPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -74,11 +75,21 @@ public UpdateSecurityGroupPayload labels(@javax.annotation.Nullable Object label } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -192,10 +203,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -279,7 +287,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateServerPayload.java index 6393b9d5..51ca41ea 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateServerPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -56,11 +57,21 @@ public UpdateServerPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -194,10 +205,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -272,7 +280,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSnapshotPayload.java index 98587294..130d7175 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateSnapshotPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a snapshot. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateSnapshotPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -74,11 +75,21 @@ public UpdateSnapshotPayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -192,10 +203,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -278,7 +286,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateVolumePayload.java index bd6eac7e..56df4a12 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/UpdateVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a volume. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateVolumePayload { public static final String SERIALIZED_NAME_BOOTABLE = "bootable"; @@ -120,11 +121,21 @@ public UpdateVolumePayload labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -242,10 +253,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -334,7 +342,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Volume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Volume.java index 71dad1b9..de06d42d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Volume.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/Volume.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Volume { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -255,11 +256,21 @@ public Volume labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -505,10 +516,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -673,7 +681,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeAttachment.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeAttachment.java index 716d3410..fa34ce8d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeAttachment.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeAttachment.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a Volume attachment to a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeAttachment { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -179,10 +180,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -266,7 +264,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeAttachmentListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeAttachmentListResponse.java index 6f1ed17e..d8bdad19 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeAttachmentListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeAttachmentListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Volume attachment list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeAttachmentListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -153,10 +154,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -201,21 +199,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - VolumeAttachment.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + VolumeAttachment.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -253,7 +250,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeEncryptionParameter.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeEncryptionParameter.java index 31592fc4..013a57c4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeEncryptionParameter.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeEncryptionParameter.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -37,7 +38,7 @@ * STACKIT-KMS. These parameter never leave the backend again. So these parameters are not in the * responses. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeEncryptionParameter { public static final String SERIALIZED_NAME_KEK_KEY_ID = "kekKeyId"; @@ -289,10 +290,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -412,7 +410,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeListResponse.java index e13fee47..0178a006 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Volume list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Volume.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Volume.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClass.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClass.java index 2c6de20b..0beaebd1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClass.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClass.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a Volume performance class. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumePerformanceClass { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -103,11 +104,21 @@ public VolumePerformanceClass labels(@javax.annotation.Nullable Object labels) { } /** - * Object that represents the labels of an object. Regex for keys: - * `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: - * `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a - * `null` value for a key will remove that key. The `stackit-` prefix is - * reserved and cannot be used for Keys. + * Object that represents the labels as key-value pairs of a resource. Key constraints: - May + * contain an optional domain prefix separated by a slash (`/`). - Domain prefix must + * be less than or equal to 250 characters. - Domain prefix must ba a valid DNS subdomain + * containing only lowercase alphanumerics (`[a-z0-9]`) and dashes (`-`), + * separated by dots (`.`). - Length (excluding the domain prefix) must be between 1 + * and 63 characters. - Must begin and end with an alphanumerical character + * (`[a-z0-9A-Z]`). - May contain dashes (`-`), underscores (`_`), + * dots (`.`), and alphanumerics in between. - Keys starting with the prefix + * `stackit-` or having a domain prefix of `stackit.cloud` (including its + * subdomains, e.g., `*.stackit.cloud/`) are reserved for system use. Value + * constraints: - Must be less than or equal to 63 characters long (can be empty). - If not + * empty it must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). - May + * contain dashes (`-`), underscores (`_`), dots (`.`), and + * alphanumerics in between. A resource can have a maximum of 64 labels. Reserved labels are + * excluded from this count. Providing a `null` value for a key will remove that key. * * @return labels */ @@ -244,10 +255,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -343,7 +351,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClassListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClassListResponse.java index 9958053b..518b3b36 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClassListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumePerformanceClassListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Volume performance class list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumePerformanceClassListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -153,10 +154,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -202,21 +200,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - VolumePerformanceClass.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + VolumePerformanceClass.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -254,7 +251,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeSource.java index 9ef074c7..1d20d2f1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v1api/model/VolumeSource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The source object of a volume. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -168,10 +169,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -263,7 +261,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ApiClient.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ApiClient.java index 9de74931..1d8f2c05 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ApiClient.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ApiClient.java @@ -397,6 +397,17 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + /** + * Set LocalDateTimeFormat. + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link cloud.stackit.sdk.iaas.v2api.ApiClient} object + */ + public ApiClient setLocalDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateTimeFormat(dateFormat); + return this; + } + /** * Set LenientOnJson. * @@ -597,6 +608,46 @@ public String parameterToString(Object param) { } } + /** + * Format the given parameter object as an ASCII-safe JSON string. + * + * @param param Parameter + * @return JSON representation of the parameter + */ + public String parameterToJsonString(Object param) { + if (param == null) { + return ""; + } + String json = JSON.serialize(param); + int firstUnsafe = -1; + for (int i = 0; i < json.length(); i++) { + if (json.charAt(i) >= 0x7f) { + firstUnsafe = i; + break; + } + } + if (firstUnsafe == -1) { + return json; + } + + StringBuilder escaped = new StringBuilder(json.length()); + escaped.append(json, 0, firstUnsafe); + for (int i = firstUnsafe; i < json.length(); i++) { + char c = json.charAt(i); + if (c >= 0x7f) { + escaped.append("\\u"); + escaped.append(Character.forDigit((c >> 12) & 0xf, 16)); + escaped.append(Character.forDigit((c >> 8) & 0xf, 16)); + escaped.append(Character.forDigit((c >> 4) & 0xf, 16)); + escaped.append(Character.forDigit(c & 0xf, 16)); + } else { + escaped.append(c); + } + } + + return escaped.toString(); + } + /** * Formats the specified query parameter to a list containing a single {@code Pair} object. * diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/JSON.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/JSON.java index e5b97e64..4ead23b2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/JSON.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/JSON.java @@ -32,8 +32,10 @@ import java.text.ParseException; import java.text.ParsePosition; import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -53,6 +55,8 @@ public class JSON { private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static LocalDateTimeTypeAdapter localDateTimeTypeAdapter = + new LocalDateTimeTypeAdapter(); private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") @@ -79,6 +83,10 @@ public static GsonBuilder createGson() { "cidrv6", cloud.stackit.sdk.iaas.v2api.model.DestinationCIDRv6 .class); + classByDiscriminatorValue.put( + "prefixlist", + cloud.stackit.sdk.iaas.v2api.model + .DestinationPrefixList.class); classByDiscriminatorValue.put( "Route_destination", cloud.stackit.sdk.iaas.v2api.model.RouteDestination @@ -163,6 +171,7 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDateTime.class, localDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2api.model.AddRoutesToRoutingTablePayload @@ -288,6 +297,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2api.model.DestinationCIDRv6 .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2api.model.DestinationPrefixList + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2api.model.Error.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -736,6 +748,53 @@ public LocalDate read(JsonReader in) throws IOException { } } + /** Gson TypeAdapter for JSR310 LocalDateTime type */ + public static class LocalDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE_TIME); + } + + public LocalDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + return LocalDateTime.parse(date, formatter); + } catch (DateTimeParseException e) { + if (date.length() > 10 && date.charAt(10) == ' ') { + date = date.substring(0, 10) + 'T' + date.substring(11); + return LocalDateTime.parse(date, formatter); + } + throw e; + } + } + } + } + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); } @@ -744,6 +803,10 @@ public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); } + public static void setLocalDateTimeFormat(DateTimeFormatter dateFormat) { + localDateTimeTypeAdapter.setFormat(dateFormat); + } + /** * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" * format will be used (more efficient than SimpleDateFormat). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/Pair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/Pair.java index e0a8aeef..6d6f5d1c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/Pair.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/Pair.java @@ -12,7 +12,7 @@ package cloud.stackit.sdk.iaas.v2api; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Pair { private final String name; private final String value; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ServerConfiguration.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ServerConfiguration.java index 10d64c77..b6a83e4d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ServerConfiguration.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ServerConfiguration.java @@ -15,7 +15,7 @@ import java.util.Map; /** Representing a Server configuration. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerConfiguration { public String URL; public String description; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ServerVariable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ServerVariable.java index fbbde560..7295884d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ServerVariable.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/ServerVariable.java @@ -15,7 +15,7 @@ import java.util.HashSet; /** Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/StringUtil.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/StringUtil.java index 8c0719b4..0052d7ca 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/StringUtil.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/StringUtil.java @@ -15,7 +15,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AbstractOpenApiSchema.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AbstractOpenApiSchema.java index 9aa9df9e..911a7be7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AbstractOpenApiSchema.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AbstractOpenApiSchema.java @@ -16,7 +16,7 @@ import java.util.Objects; /** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -104,10 +104,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public boolean equals(Object o) { diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutesToRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutesToRoutingTablePayload.java index 1febe468..8723d78f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutesToRoutingTablePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutesToRoutingTablePayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Object represents a request to add network routes. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AddRoutesToRoutingTablePayload { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -152,10 +153,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -200,21 +198,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Route.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Route.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -252,7 +249,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutingTableToAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutingTableToAreaPayload.java index a2834584..fff521a8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutingTableToAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddRoutingTableToAreaPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -36,7 +37,7 @@ * An object representing a routing table. Filterable Fields: `dynamicRoutes`, * `systemRoutes`. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AddRoutingTableToAreaPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -349,10 +350,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -468,7 +466,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddVolumeToServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddVolumeToServerPayload.java index 0430fcf2..b646423c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddVolumeToServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AddVolumeToServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a Volume attachment to a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AddVolumeToServerPayload { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -181,10 +182,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -269,7 +267,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AffinityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AffinityGroup.java index 89c2ef31..83ce1fb3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AffinityGroup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AffinityGroup.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Definition of an affinity group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AffinityGroup { public static final String SERIALIZED_NAME_ID = "id"; @@ -212,10 +213,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -325,7 +323,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AffinityGroupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AffinityGroupListResponse.java index 4f6ac394..16d9c8d2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AffinityGroupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AffinityGroupListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Response object for affinity group list request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AffinityGroupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - AffinityGroup.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + AffinityGroup.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AllowedAddressesInner.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AllowedAddressesInner.java index 64f8ce07..315b3992 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AllowedAddressesInner.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AllowedAddressesInner.java @@ -28,7 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AllowedAddressesInner extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(AllowedAddressesInner.class.getName()); @@ -174,6 +174,7 @@ public Object getActualInstance() { * @return The actual instance of `String` * @throws ClassCastException if the instance is not `String` */ + @SuppressWarnings("unchecked") public String getString() throws ClassCastException { return (String) super.getActualInstance(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AreaId.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AreaId.java index f5e21839..ea033afe 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AreaId.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AreaId.java @@ -28,7 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AreaId extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(AreaId.class.getName()); @@ -197,6 +197,7 @@ public Object getActualInstance() { * @return The actual instance of `UUID` * @throws ClassCastException if the instance is not `UUID` */ + @SuppressWarnings("unchecked") public UUID getUUID() throws ClassCastException { return (UUID) super.getActualInstance(); } @@ -208,6 +209,7 @@ public UUID getUUID() throws ClassCastException { * @return The actual instance of `StaticAreaID` * @throws ClassCastException if the instance is not `StaticAreaID` */ + @SuppressWarnings("unchecked") public StaticAreaID getStaticAreaID() throws ClassCastException { return (StaticAreaID) super.getActualInstance(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AvailabilityZoneListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AvailabilityZoneListResponse.java index 551c501b..776c07f8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AvailabilityZoneListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/AvailabilityZoneListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Availability Zone list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AvailabilityZoneListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -151,10 +152,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Backup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Backup.java index 975e326c..70c4d663 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Backup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Backup.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a backup. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Backup { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -383,10 +384,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -523,7 +521,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BackupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BackupListResponse.java index 89d686b9..1bfc2bde 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BackupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BackupListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Backup list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BackupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Backup.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Backup.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BackupSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BackupSource.java index 87af1349..617caf19 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BackupSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BackupSource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The source object of a backup. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BackupSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -262,7 +260,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BaseSecurityGroupRule.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BaseSecurityGroupRule.java index 5525754c..45ffa719 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BaseSecurityGroupRule.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BaseSecurityGroupRule.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** The base schema for a security group rule. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BaseSecurityGroupRule { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -384,10 +385,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -543,7 +541,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BootVolume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BootVolume.java index a0fdcf83..697b8105 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BootVolume.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BootVolume.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The boot device for the server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BootVolume { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -237,10 +238,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -330,7 +328,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BootVolumeSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BootVolumeSource.java index b509b056..bf318e93 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BootVolumeSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/BootVolumeSource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The source object of a boot volume. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BootVolumeSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -263,7 +261,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateAffinityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateAffinityGroupPayload.java index 7aa4299b..573a11d3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateAffinityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateAffinityGroupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Definition of an affinity group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateAffinityGroupPayload { public static final String SERIALIZED_NAME_ID = "id"; @@ -213,10 +214,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -328,7 +326,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateBackupPayload.java index b8a979d0..c353a968 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateBackupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a backup create request body. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateBackupPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -229,10 +230,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -330,7 +328,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateImagePayload.java index 8d4c7871..508004a9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateImagePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents an Image and its parameters. Used for Creating and returning (get/list). */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateImagePayload { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -522,10 +523,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -681,7 +679,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateIsolatedNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateIsolatedNetworkPayload.java index c879b4e0..5155def4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateIsolatedNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateIsolatedNetworkPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the request body for a single isolated network create. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateIsolatedNetworkPayload { public static final String SERIALIZED_NAME_DHCP = "dhcp"; @@ -231,10 +232,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -327,7 +325,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateKeyPairPayload.java index 1d014271..2402dd29 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateKeyPairPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents the public key of an SSH keypair and its name. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateKeyPairPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -263,10 +264,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -376,7 +374,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaPayload.java index c346cc80..ea23eb28 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the network area create request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkAreaPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -179,10 +180,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -269,7 +267,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRangePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRangePayload.java index da395f88..c485e2a6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRangePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRangePayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** CreateNetworkAreaRangePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkAreaRangePayload { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -242,7 +240,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRegionPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRegionPayload.java index 2742791a..5041d10f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRegionPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRegionPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The basic properties of a regional network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkAreaRegionPayload { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -163,10 +164,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -248,7 +246,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRoutePayload.java index 5e3396e2..6259e1ea 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkAreaRoutePayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Object represents a request to add network routes. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkAreaRoutePayload { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -152,10 +153,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -200,21 +198,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Route.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Route.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -252,7 +249,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4.java index 54a10441..281ef0a4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv4 extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateNetworkIPv4.class.getName()); @@ -215,6 +215,7 @@ public Object getActualInstance() { * @return The actual instance of `CreateNetworkIPv4WithPrefix` * @throws ClassCastException if the instance is not `CreateNetworkIPv4WithPrefix` */ + @SuppressWarnings("unchecked") public CreateNetworkIPv4WithPrefix getCreateNetworkIPv4WithPrefix() throws ClassCastException { return (CreateNetworkIPv4WithPrefix) super.getActualInstance(); } @@ -226,6 +227,7 @@ public CreateNetworkIPv4WithPrefix getCreateNetworkIPv4WithPrefix() throws Class * @return The actual instance of `CreateNetworkIPv4WithPrefixLength` * @throws ClassCastException if the instance is not `CreateNetworkIPv4WithPrefixLength` */ + @SuppressWarnings("unchecked") public CreateNetworkIPv4WithPrefixLength getCreateNetworkIPv4WithPrefixLength() throws ClassCastException { return (CreateNetworkIPv4WithPrefixLength) super.getActualInstance(); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4WithPrefix.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4WithPrefix.java index db19ec19..d50cfd64 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4WithPrefix.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4WithPrefix.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The create request for an IPv4 network with a specified prefix. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv4WithPrefix { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -249,10 +250,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -369,7 +367,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4WithPrefixLength.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4WithPrefixLength.java index 84fd8e8f..aa66bbc1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4WithPrefixLength.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv4WithPrefixLength.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** The create request for an IPv4 network with a wanted prefix length. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv4WithPrefixLength { public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; @@ -208,10 +209,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -315,7 +313,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6.java index 0a1fc0b2..1a0b3a75 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv6 extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateNetworkIPv6.class.getName()); @@ -215,6 +215,7 @@ public Object getActualInstance() { * @return The actual instance of `CreateNetworkIPv6WithPrefix` * @throws ClassCastException if the instance is not `CreateNetworkIPv6WithPrefix` */ + @SuppressWarnings("unchecked") public CreateNetworkIPv6WithPrefix getCreateNetworkIPv6WithPrefix() throws ClassCastException { return (CreateNetworkIPv6WithPrefix) super.getActualInstance(); } @@ -226,6 +227,7 @@ public CreateNetworkIPv6WithPrefix getCreateNetworkIPv6WithPrefix() throws Class * @return The actual instance of `CreateNetworkIPv6WithPrefixLength` * @throws ClassCastException if the instance is not `CreateNetworkIPv6WithPrefixLength` */ + @SuppressWarnings("unchecked") public CreateNetworkIPv6WithPrefixLength getCreateNetworkIPv6WithPrefixLength() throws ClassCastException { return (CreateNetworkIPv6WithPrefixLength) super.getActualInstance(); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6WithPrefix.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6WithPrefix.java index 00b8bd51..472b0c57 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6WithPrefix.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6WithPrefix.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The create request for an IPv6 network with a specified prefix. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv6WithPrefix { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -249,10 +250,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -369,7 +367,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6WithPrefixLength.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6WithPrefixLength.java index 229fd93e..5d593ee0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6WithPrefixLength.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkIPv6WithPrefixLength.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** The create request for an IPv6 network with a wanted prefix length. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv6WithPrefixLength { public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; @@ -208,10 +209,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -315,7 +313,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkPayload.java index 95d1eb06..1953816d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNetworkPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents the request body for a network create. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -365,10 +366,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -497,7 +495,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java index 8c9ab8d5..b28e5e16 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateNicPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -24,6 +25,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -34,13 +36,18 @@ import java.util.UUID; /** Object that represents a network interface. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_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) @@ -106,17 +113,31 @@ public class CreateNicPayload { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreateNicPayload() {} public CreateNicPayload( - UUID device, UUID id, String mac, UUID networkId, String status, String type) { + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public CreateNicPayload allowedAddresses( @@ -147,6 +168,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public CreateNicPayload description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -350,6 +380,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -404,6 +443,7 @@ public boolean equals(Object o) { } CreateNicPayload createNicPayload = (CreateNicPayload) o; return Objects.equals(this.allowedAddresses, createNicPayload.allowedAddresses) + && Objects.equals(this.createdAt, createNicPayload.createdAt) && Objects.equals(this.description, createNicPayload.description) && Objects.equals(this.device, createNicPayload.device) && Objects.equals(this.id, createNicPayload.id) @@ -417,6 +457,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, createNicPayload.securityGroups) && Objects.equals(this.status, createNicPayload.status) && Objects.equals(this.type, createNicPayload.type) + && Objects.equals(this.updatedAt, createNicPayload.updatedAt) && Objects.equals(this.additionalProperties, createNicPayload.additionalProperties); } @@ -424,6 +465,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -437,6 +479,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -445,6 +488,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNicPayload {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -458,6 +502,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -470,10 +515,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -485,6 +527,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -497,7 +540,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -666,7 +710,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateProtocol.java index 7659bf23..44cca533 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateProtocol.java @@ -28,7 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateProtocol extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateProtocol.class.getName()); @@ -212,6 +212,7 @@ public Object getActualInstance() { * @return The actual instance of `Long` * @throws ClassCastException if the instance is not `Long` */ + @SuppressWarnings("unchecked") public Long getLong() throws ClassCastException { return (Long) super.getActualInstance(); } @@ -223,6 +224,7 @@ public Long getLong() throws ClassCastException { * @return The actual instance of `String` * @throws ClassCastException if the instance is not `String` */ + @SuppressWarnings("unchecked") public String getString() throws ClassCastException { return (String) super.getActualInstance(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java index 867752c5..df05c674 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreatePublicIPPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -23,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -33,8 +35,13 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreatePublicIPPayload { + 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) @@ -55,12 +62,29 @@ public class CreatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreatePublicIPPayload() {} - public CreatePublicIPPayload(UUID id, String ip) { + public CreatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -132,6 +156,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -185,10 +218,12 @@ public boolean equals(Object o) { return false; } CreatePublicIPPayload createPublicIPPayload = (CreatePublicIPPayload) o; - return Objects.equals(this.id, createPublicIPPayload.id) + return Objects.equals(this.createdAt, createPublicIPPayload.createdAt) + && Objects.equals(this.id, createPublicIPPayload.id) && Objects.equals(this.ip, createPublicIPPayload.ip) && Objects.equals(this.labels, createPublicIPPayload.labels) && Objects.equals(this.networkInterface, createPublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, createPublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, createPublicIPPayload.additionalProperties); } @@ -204,7 +239,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -218,10 +254,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\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(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -234,10 +272,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -246,7 +281,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -330,7 +372,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupPayload.java index 63aa6299..bff23780 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** Object that represents a security group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSecurityGroupPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -318,10 +319,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -453,7 +451,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupRulePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupRulePayload.java index 38434c2c..f5adde7a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupRulePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupRulePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a request body for security group rule creation. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSecurityGroupRulePayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -418,10 +419,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -585,7 +583,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupRuleProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupRuleProtocol.java index 52da93b8..453d10b2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupRuleProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSecurityGroupRuleProtocol.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The internet protocol which the rule should match. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSecurityGroupRuleProtocol { public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; @@ -141,10 +142,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -218,7 +216,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerNetworking.java index aba029ec..50f437bc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerNetworking.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerNetworking.java @@ -31,7 +31,7 @@ import java.util.UUID; /** The initial networking setup for the server creation with a network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerNetworking { public static final String SERIALIZED_NAME_NETWORK_ID = "networkId"; @@ -89,10 +89,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerNetworkingWithNics.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerNetworkingWithNics.java index 5941e031..6cd01f72 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerNetworkingWithNics.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerNetworkingWithNics.java @@ -33,7 +33,7 @@ import java.util.UUID; /** The initial networking setup for the server creation with a network interface. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerNetworkingWithNics { public static final String SERIALIZED_NAME_NIC_IDS = "nicIds"; @@ -100,10 +100,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayload.java index 5d2020d1..fb0faeb7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ import java.util.UUID; /** Object that represents the request body for a server create. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerPayload { public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; @@ -777,10 +778,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -1030,7 +1028,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayloadAllOfNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayloadAllOfNetworking.java index 2dfaf90c..7a3df314 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayloadAllOfNetworking.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateServerPayloadAllOfNetworking.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerPayloadAllOfNetworking extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateServerPayloadAllOfNetworking.class.getName()); @@ -216,6 +216,7 @@ public Object getActualInstance() { * @return The actual instance of `CreateServerNetworking` * @throws ClassCastException if the instance is not `CreateServerNetworking` */ + @SuppressWarnings("unchecked") public CreateServerNetworking getCreateServerNetworking() throws ClassCastException { return (CreateServerNetworking) super.getActualInstance(); } @@ -227,6 +228,7 @@ public CreateServerNetworking getCreateServerNetworking() throws ClassCastExcept * @return The actual instance of `CreateServerNetworkingWithNics` * @throws ClassCastException if the instance is not `CreateServerNetworkingWithNics` */ + @SuppressWarnings("unchecked") public CreateServerNetworkingWithNics getCreateServerNetworkingWithNics() throws ClassCastException { return (CreateServerNetworkingWithNics) super.getActualInstance(); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSnapshotPayload.java index ef45d7bd..c7acf58a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateSnapshotPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a snapshot. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSnapshotPayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -50,6 +51,11 @@ public class CreateSnapshotPayload { @SerializedName(SERIALIZED_NAME_DESCRIPTION) @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_ENCRYPTED = "encrypted"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED) + @javax.annotation.Nullable private Boolean encrypted; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -91,6 +97,7 @@ public CreateSnapshotPayload() {} public CreateSnapshotPayload( String availabilityZone, OffsetDateTime createdAt, + Boolean encrypted, UUID id, Long size, String status, @@ -98,6 +105,7 @@ public CreateSnapshotPayload( this(); this.availabilityZone = availabilityZone; this.createdAt = createdAt; + this.encrypted = encrypted; this.id = id; this.size = size; this.status = status; @@ -140,6 +148,15 @@ public void setDescription(@javax.annotation.Nullable String description) { this.description = description; } + /** + * Indicates if a volume is encrypted. + * + * @return encrypted + */ + @javax.annotation.Nullable public Boolean getEncrypted() { + return encrypted; + } + /** * Universally Unique Identifier (UUID). * @@ -303,6 +320,7 @@ public boolean equals(Object o) { return Objects.equals(this.availabilityZone, createSnapshotPayload.availabilityZone) && Objects.equals(this.createdAt, createSnapshotPayload.createdAt) && Objects.equals(this.description, createSnapshotPayload.description) + && Objects.equals(this.encrypted, createSnapshotPayload.encrypted) && Objects.equals(this.id, createSnapshotPayload.id) && Objects.equals(this.labels, createSnapshotPayload.labels) && Objects.equals(this.name, createSnapshotPayload.name) @@ -320,6 +338,7 @@ public int hashCode() { availabilityZone, createdAt, description, + encrypted, id, labels, name, @@ -337,6 +356,7 @@ public String toString() { sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" encrypted: ").append(toIndentedString(encrypted)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -356,10 +376,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -373,6 +390,7 @@ private String toIndentedString(Object o) { "availabilityZone", "createdAt", "description", + "encrypted", "id", "labels", "name", @@ -498,7 +516,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateVolumePayload.java index 0dea56e0..66b6c1d9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/CreateVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateVolumePayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -518,10 +519,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -687,7 +685,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv4.java index 20ca4c74..45f0bf49 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv4.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** IPv4 Classless Inter-Domain Routing (CIDR) Object. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DestinationCIDRv4 { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -219,10 +220,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -325,7 +323,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv6.java index 7e691eab..5dd50927 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationCIDRv6.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** IPv6 Classless Inter-Domain Routing (CIDR) Object. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DestinationCIDRv6 { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -219,10 +220,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -325,7 +323,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationPrefixList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationPrefixList.java new file mode 100644 index 00000000..aea554c9 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/DestinationPrefixList.java @@ -0,0 +1,395 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2 + * Contact: stackit-iaas@mail.schwarz + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package cloud.stackit.sdk.iaas.v2api.model; + +import cloud.stackit.sdk.iaas.v2api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonNull; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Prefix List destination reference object. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") +public class DestinationPrefixList { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + PREFIXLIST("prefixlist"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_VALUE = "value"; + + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private UUID value; + + public DestinationPrefixList() {} + + public DestinationPrefixList type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + public DestinationPrefixList value(@javax.annotation.Nonnull UUID value) { + this.value = value; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return value + */ + @javax.annotation.Nonnull + public UUID getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull UUID value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DestinationPrefixList instance itself + */ + public DestinationPrefixList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationPrefixList destinationPrefixList = (DestinationPrefixList) o; + return Objects.equals(this.type, destinationPrefixList.type) + && Objects.equals(this.value, destinationPrefixList.value) + && Objects.equals( + this.additionalProperties, destinationPrefixList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationPrefixList {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("type", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "value")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DestinationPrefixList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DestinationPrefixList.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The required field(s) %s in DestinationPrefixList is not found in the empty JSON string", + DestinationPrefixList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationPrefixList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The required field `%s` is not found in the JSON string: %s", + requiredField, + jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `type` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `value` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationPrefixList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationPrefixList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationPrefixList.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationPrefixList value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : + value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty( + entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DestinationPrefixList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DestinationPrefixList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty( + entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty( + entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty( + entry.getKey(), + entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The field `%s` has unknown primitive type. Value: %s", + entry.getKey(), + entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty( + entry.getKey(), + gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty( + entry.getKey(), + gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationPrefixList given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationPrefixList + * @throws IOException if the JSON string is invalid with respect to DestinationPrefixList + */ + public static DestinationPrefixList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationPrefixList.class); + } + + /** + * Convert an instance of DestinationPrefixList 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/v2api/model/Error.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Error.java index 208d559e..1c1c5b3f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Error.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Error.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Error with HTTP error code and an error message. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Error { public static final String SERIALIZED_NAME_CODE = "code"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -254,7 +252,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/GetServerLog200Response.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/GetServerLog200Response.java index c5b286fe..cb244e23 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/GetServerLog200Response.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/GetServerLog200Response.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** GetServerLog200Response */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetServerLog200Response { public static final String SERIALIZED_NAME_OUTPUT = "output"; @@ -138,10 +139,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -217,7 +215,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ICMPParameters.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ICMPParameters.java index 383a0496..5cea2269 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ICMPParameters.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ICMPParameters.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents ICMP parameters. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ICMPParameters { public static final String SERIALIZED_NAME_CODE = "code"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Image.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Image.java index 125a571e..c1ac3b5d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Image.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Image.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents an Image and its parameters. Used for Creating and returning (get/list). */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Image { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -521,10 +522,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -679,7 +677,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageAgent.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageAgent.java index c0376c38..299e1055 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageAgent.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageAgent.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Support status and default provioning setting for the STACKIT server agent. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageAgent { public static final String SERIALIZED_NAME_PROVISION_BY_DEFAULT = "provisionByDefault"; @@ -165,10 +166,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -234,7 +232,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageChecksum.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageChecksum.java index 63e1e4db..be729756 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageChecksum.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageChecksum.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Representation of an image checksum. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageChecksum { public static final String SERIALIZED_NAME_ALGORITHM = "algorithm"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -262,7 +260,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageConfig.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageConfig.java index 5af39f3d..2ac80844 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageConfig.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageConfig.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Properties to set hardware and scheduling settings for an Image. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageConfig { public static final String SERIALIZED_NAME_ARCHITECTURE = "architecture"; @@ -510,10 +511,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -677,7 +675,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageCreateResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageCreateResponse.java index 972b602d..5c42f7e3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageCreateResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageCreateResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Image creation response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageCreateResponse { public static final String SERIALIZED_NAME_ID = "id"; @@ -169,10 +170,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -265,7 +263,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageFromVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageFromVolumePayload.java index ddbf6557..6399cbb7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageFromVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageFromVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ * Object that represents the upload request of an image to a volume. Used for creating an image * from a volume. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageFromVolumePayload { public static final String SERIALIZED_NAME_DISK_FORMAT = "diskFormat"; @@ -86,7 +87,7 @@ public ImageFromVolumePayload force(@javax.annotation.Nullable Boolean force) { } /** - * When true the image is force created from a volume is currently being used. + * When true the image is force created from a volume that is currently being used. * * @return force */ @@ -221,10 +222,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -318,7 +316,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageListResponse.java index aad7cb41..d53d72e1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Image list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Image.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Image.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageShare.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageShare.java index af1084cd..a69efb51 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageShare.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageShare.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageShare { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -176,10 +177,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -255,7 +253,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageShareConsumer.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageShareConsumer.java index 2ea06a2c..e9721cf8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageShareConsumer.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ImageShareConsumer.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** The details of an Image share consumer. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageShareConsumer { public static final String SERIALIZED_NAME_CONSUMER_PROJECT_ID = "consumerProjectId"; @@ -193,10 +194,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -282,7 +280,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/KeyPairListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/KeyPairListResponse.java index 9a8bd9c3..926872dc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/KeyPairListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/KeyPairListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** SSH keypair list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class KeyPairListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Keypair.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Keypair.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Keypair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Keypair.java index eb8c2ba0..1e8bd29c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Keypair.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Keypair.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents the public key of an SSH keypair and its name. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Keypair { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -261,10 +262,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -373,7 +371,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/MachineType.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/MachineType.java index 25683ad6..3beab189 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/MachineType.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/MachineType.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ * Machine Type. Filterable Fields: `disk`, `extraSpecs`, `name`, * `ram`, `vcpus`. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class MachineType { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -273,10 +274,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -371,7 +369,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/MachineTypeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/MachineTypeListResponse.java index 2ec47d50..dad693c1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/MachineTypeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/MachineTypeListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Machine type list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class MachineTypeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - MachineType.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + MachineType.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java index e10738e7..c675e94c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NIC.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -24,6 +25,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -34,13 +36,18 @@ import java.util.UUID; /** Object that represents a network interface. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_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) @@ -106,16 +113,31 @@ public class NIC { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public NIC() {} - public NIC(UUID device, UUID id, String mac, UUID networkId, String status, String type) { + public NIC( + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public NIC allowedAddresses( @@ -146,6 +168,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public NIC description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -349,6 +380,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -403,6 +443,7 @@ public boolean equals(Object o) { } NIC NIC = (NIC) o; return Objects.equals(this.allowedAddresses, NIC.allowedAddresses) + && Objects.equals(this.createdAt, NIC.createdAt) && Objects.equals(this.description, NIC.description) && Objects.equals(this.device, NIC.device) && Objects.equals(this.id, NIC.id) @@ -416,6 +457,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, NIC.securityGroups) && Objects.equals(this.status, NIC.status) && Objects.equals(this.type, NIC.type) + && Objects.equals(this.updatedAt, NIC.updatedAt) && Objects.equals(this.additionalProperties, NIC.additionalProperties); } @@ -423,6 +465,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -436,6 +479,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -444,6 +488,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NIC {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -457,6 +502,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -469,10 +515,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -484,6 +527,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -496,7 +540,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -664,7 +709,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NICListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NICListResponse.java index f10f0355..1c70507d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NICListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NICListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** NIC list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NICListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -149,10 +150,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -196,21 +194,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - NIC.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + NIC.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -246,7 +243,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Network.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Network.java index d6858a3a..353b2bb7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Network.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Network.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -36,7 +37,7 @@ * Object that represents a network. If no routing table is specified, the default routing table is * used. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Network { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -466,10 +467,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -615,7 +613,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkArea.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkArea.java index 8d1d0c11..5e53fade 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkArea.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkArea.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkArea { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -254,10 +255,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -353,7 +351,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkAreaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkAreaListResponse.java index b50f8e52..66d6137a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkAreaListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkAreaListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Network area list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkAreaListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - NetworkArea.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + NetworkArea.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkIPv4.java index f1761736..f6638910 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkIPv4.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents the IPv4 part of a network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkIPv4 { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -274,10 +275,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -408,7 +406,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkIPv6.java index dc75b7c4..ce83e978 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkIPv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkIPv6.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents the IPv6 part of a network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkIPv6 { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -253,10 +254,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -374,7 +372,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkListResponse.java index 0e1b1d1b..75f20c72 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Network list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Network.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Network.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkRange.java index bf13f44f..eb9181be 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkRange.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkRange.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a network range of a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkRange { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -196,10 +197,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -293,7 +291,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkRangeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkRangeListResponse.java index c9aa4c83..ede4e22e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkRangeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NetworkRangeListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Network Range list response of a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkRangeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - NetworkRange.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + NetworkRange.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopBlackhole.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopBlackhole.java index 2c50b704..704f69b3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopBlackhole.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopBlackhole.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents a blackhole route. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NexthopBlackhole { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -191,10 +192,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -290,7 +288,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv4.java index 0d66cd3e..f0be4e4d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv4.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents an IPv4 address. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NexthopIPv4 { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -218,10 +219,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -323,7 +321,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv6.java index 3aa87dd8..7d9f33ad 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopIPv6.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents an IPv6 address. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NexthopIPv6 { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -218,10 +219,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -323,7 +321,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopInternet.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopInternet.java index 2ea53c9c..9ee46edc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopInternet.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/NexthopInternet.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents a route to the internet. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NexthopInternet { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -191,10 +192,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -290,7 +288,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkAreaPayload.java index 827939c3..2627da85 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkAreaPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the network area update request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PartialUpdateNetworkAreaPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -179,10 +180,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -260,7 +258,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkPayload.java index 58a43238..0b725a3d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PartialUpdateNetworkPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents the request body for a network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PartialUpdateNetworkPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -339,10 +340,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -453,7 +451,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PortRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PortRange.java index 8af81830..e53a832a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PortRange.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PortRange.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ * Object that represents a range of ports (this will be omitted if it covers the full default range * 0/1-65535). */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PortRange { public static final String SERIALIZED_NAME_MAX = "max"; @@ -169,10 +170,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -250,7 +248,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Project.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Project.java index 94c3a950..d36a37e6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Project.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Project.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a STACKIT project. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Project { public static final String SERIALIZED_NAME_AREA_ID = "areaId"; @@ -319,10 +320,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -442,7 +440,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ProjectListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ProjectListResponse.java index 10d09e82..5ae22a0d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ProjectListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ProjectListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Project list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ProjectListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -243,7 +241,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Protocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Protocol.java index e3e9205c..61ec0046 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Protocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Protocol.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The schema for a protocol of a security group rule. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Protocol { public static final String SERIALIZED_NAME_NAME = "name"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -244,7 +242,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java index 6cdeb4ef..2b02a9f1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIp.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -23,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -33,8 +35,13 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicIp { + 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) @@ -55,12 +62,28 @@ public class PublicIp { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public PublicIp() {} - public PublicIp(UUID id, String ip) { + public PublicIp(OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -131,6 +154,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -184,10 +216,12 @@ public boolean equals(Object o) { return false; } PublicIp publicIp = (PublicIp) o; - return Objects.equals(this.id, publicIp.id) + return Objects.equals(this.createdAt, publicIp.createdAt) + && Objects.equals(this.id, publicIp.id) && Objects.equals(this.ip, publicIp.ip) && Objects.equals(this.labels, publicIp.labels) && Objects.equals(this.networkInterface, publicIp.networkInterface) + && Objects.equals(this.updatedAt, publicIp.updatedAt) && Objects.equals(this.additionalProperties, publicIp.additionalProperties); } @@ -202,7 +236,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -216,10 +251,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PublicIp {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\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(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -232,10 +269,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -244,7 +278,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -327,7 +368,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIpListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIpListResponse.java index 814a1934..0ef443fa 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIpListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicIpListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Public IP list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicIpListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - PublicIp.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + PublicIp.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicNetwork.java index 2fefeef9..0a77335e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicNetwork.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicNetwork.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Public network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicNetwork { public static final String SERIALIZED_NAME_CIDR = "cidr"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -261,7 +259,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicNetworkListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicNetworkListResponse.java index 35f6d630..a891c3d3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicNetworkListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/PublicNetworkListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Public network list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicNetworkListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - PublicNetwork.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + PublicNetwork.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Quota.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Quota.java index 0aae6fd7..adec1456 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Quota.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Quota.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a single resource quota. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Quota { public static final String SERIALIZED_NAME_LIMIT = "limit"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/QuotaList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/QuotaList.java index 610d97af..c38942af 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/QuotaList.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/QuotaList.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the quotas for a project. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class QuotaList { public static final String SERIALIZED_NAME_BACKUP_GIGABYTES = "backupGigabytes"; @@ -451,10 +452,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -584,7 +582,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/QuotaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/QuotaListResponse.java index 53b05b60..81d91dd4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/QuotaListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/QuotaListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Quotas list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class QuotaListResponse { public static final String SERIALIZED_NAME_QUOTAS = "quotas"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -224,7 +222,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalArea.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalArea.java index f8c12934..2c87fe39 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalArea.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalArea.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The basic properties of a regional network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RegionalArea { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -160,10 +161,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -241,7 +239,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalAreaIPv4.java index d16c1589..1160435a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalAreaIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalAreaIPv4.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** The regional IPv4 config of a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RegionalAreaIPv4 { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; @@ -301,10 +302,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -373,21 +371,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "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( - java.util.Locale.ROOT, - "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("networkRanges") != null) { + if (!jsonObj.get("networkRanges").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `networkRanges` to be an array in the JSON string but got `%s`", + jsonObj.get("networkRanges").toString())); + } + 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("transferNetwork").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -430,7 +427,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalAreaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalAreaListResponse.java index 00ee8304..0f2391a9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalAreaListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RegionalAreaListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Regional area list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RegionalAreaListResponse { public static final String SERIALIZED_NAME_REGIONS = "regions"; @@ -149,10 +150,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -232,7 +230,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Request.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Request.java index 12a0315d..f582b213 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Request.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Request.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Object that represents a request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Request { public static final String SERIALIZED_NAME_DETAILS = "details"; @@ -296,10 +297,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -387,21 +385,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "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( - java.util.Locale.ROOT, - "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("resources") != null) { + if (!jsonObj.get("resources").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `resources` to be an array in the JSON string but got `%s`", + jsonObj.get("resources").toString())); + } + 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( @@ -443,7 +440,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RequestResource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RequestResource.java index 7e5dabea..1341ffae 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RequestResource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RequestResource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a resource as part of a request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RequestResource { public static final String SERIALIZED_NAME_ID = "id"; @@ -200,10 +201,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -303,7 +301,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RescueServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RescueServerPayload.java index 5c624992..979f4745 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RescueServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RescueServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** RescueServerPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RescueServerPayload { public static final String SERIALIZED_NAME_IMAGE = "image"; @@ -141,10 +142,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -230,7 +228,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ResizeServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ResizeServerPayload.java index 244cf474..d9b137d3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ResizeServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ResizeServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ResizeServerPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ResizeServerPayload { public static final String SERIALIZED_NAME_MACHINE_TYPE = "machineType"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -229,7 +227,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ResizeVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ResizeVolumePayload.java index 08b4af3b..648a0fc3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ResizeVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ResizeVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ResizeVolumePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ResizeVolumePayload { public static final String SERIALIZED_NAME_SIZE = "size"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -222,7 +220,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Route.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Route.java index 590d2c0c..d5c1f3a8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Route.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Route.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object represents a network route. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Route { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -263,10 +264,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -364,7 +362,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteDestination.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteDestination.java index 71f30dd1..526c330b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteDestination.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteDestination.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RouteDestination extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(RouteDestination.class.getName()); @@ -43,6 +43,8 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv4.class)); final TypeAdapter adapterDestinationCIDRv6 = gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv6.class)); + final TypeAdapter adapterDestinationPrefixList = + gson.getDelegateAdapter(this, TypeToken.get(DestinationPrefixList.class)); return (TypeAdapter) new TypeAdapter() { @@ -70,8 +72,16 @@ public void write(JsonWriter out, RouteDestination value) elementAdapter.write(out, element); return; } + // check if the actual instance is of the type `DestinationPrefixList` + if (value.getActualInstance() instanceof DestinationPrefixList) { + JsonElement element = + adapterDestinationPrefixList.toJsonTree( + (DestinationPrefixList) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: DestinationCIDRv4, DestinationCIDRv6"); + "Failed to serialize as the type doesn't match oneOf schemas: DestinationCIDRv4, DestinationCIDRv6, DestinationPrefixList"); } @Override @@ -125,6 +135,27 @@ public RouteDestination read(JsonReader in) throws IOException { "Input data does not match schema 'DestinationCIDRv6'", e); } + // deserialize DestinationPrefixList + try { + // validate the JSON object to see if any exception is thrown + DestinationPrefixList.validateJsonElement(jsonElement); + actualAdapter = adapterDestinationPrefixList; + match++; + log.log( + Level.FINER, + "Input data matches schema 'DestinationPrefixList'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for DestinationPrefixList failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'DestinationPrefixList'", + e); + } if (match == 1) { RouteDestination ret = new RouteDestination(); @@ -159,6 +190,7 @@ public RouteDestination(Object o) { static { schemas.put("DestinationCIDRv4", DestinationCIDRv4.class); schemas.put("DestinationCIDRv6", DestinationCIDRv6.class); + schemas.put("DestinationPrefixList", DestinationPrefixList.class); } @Override @@ -168,7 +200,7 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: DestinationCIDRv4, DestinationCIDRv6 + * against the oneOf child schemas: DestinationCIDRv4, DestinationCIDRv6, DestinationPrefixList * *

It could be an instance of the 'oneOf' schemas. */ @@ -184,14 +216,20 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof DestinationPrefixList) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( - "Invalid instance type. Must be DestinationCIDRv4, DestinationCIDRv6"); + "Invalid instance type. Must be DestinationCIDRv4, DestinationCIDRv6, DestinationPrefixList"); } /** - * Get the actual instance, which can be the following: DestinationCIDRv4, DestinationCIDRv6 + * Get the actual instance, which can be the following: DestinationCIDRv4, DestinationCIDRv6, + * DestinationPrefixList * - * @return The actual instance (DestinationCIDRv4, DestinationCIDRv6) + * @return The actual instance (DestinationCIDRv4, DestinationCIDRv6, DestinationPrefixList) */ @SuppressWarnings("unchecked") @Override @@ -206,6 +244,7 @@ public Object getActualInstance() { * @return The actual instance of `DestinationCIDRv4` * @throws ClassCastException if the instance is not `DestinationCIDRv4` */ + @SuppressWarnings("unchecked") public DestinationCIDRv4 getDestinationCIDRv4() throws ClassCastException { return (DestinationCIDRv4) super.getActualInstance(); } @@ -217,10 +256,23 @@ public DestinationCIDRv4 getDestinationCIDRv4() throws ClassCastException { * @return The actual instance of `DestinationCIDRv6` * @throws ClassCastException if the instance is not `DestinationCIDRv6` */ + @SuppressWarnings("unchecked") public DestinationCIDRv6 getDestinationCIDRv6() throws ClassCastException { return (DestinationCIDRv6) super.getActualInstance(); } + /** + * Get the actual instance of `DestinationPrefixList`. If the actual instance is not + * `DestinationPrefixList`, the ClassCastException will be thrown. + * + * @return The actual instance of `DestinationPrefixList` + * @throws ClassCastException if the instance is not `DestinationPrefixList` + */ + @SuppressWarnings("unchecked") + public DestinationPrefixList getDestinationPrefixList() throws ClassCastException { + return (DestinationPrefixList) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -255,11 +307,23 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with DestinationPrefixList + try { + DestinationPrefixList.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for DestinationPrefixList failed with `%s`.", + e.getMessage())); + // continue to the next one + } if (validCount != 1) { throw new IOException( String.format( java.util.Locale.ROOT, - "The JSON string is invalid for RouteDestination with oneOf schemas: DestinationCIDRv4, DestinationCIDRv6. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", + "The JSON string is invalid for RouteDestination with oneOf schemas: DestinationCIDRv4, DestinationCIDRv6, DestinationPrefixList. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteListResponse.java index 55890337..de0b06ac 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Route list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RouteListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Route.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Route.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteNexthop.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteNexthop.java index de60ecb4..8dbe2b68 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteNexthop.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RouteNexthop.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RouteNexthop extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(RouteNexthop.class.getName()); @@ -274,6 +274,7 @@ public Object getActualInstance() { * @return The actual instance of `NexthopIPv4` * @throws ClassCastException if the instance is not `NexthopIPv4` */ + @SuppressWarnings("unchecked") public NexthopIPv4 getNexthopIPv4() throws ClassCastException { return (NexthopIPv4) super.getActualInstance(); } @@ -285,6 +286,7 @@ public NexthopIPv4 getNexthopIPv4() throws ClassCastException { * @return The actual instance of `NexthopIPv6` * @throws ClassCastException if the instance is not `NexthopIPv6` */ + @SuppressWarnings("unchecked") public NexthopIPv6 getNexthopIPv6() throws ClassCastException { return (NexthopIPv6) super.getActualInstance(); } @@ -296,6 +298,7 @@ public NexthopIPv6 getNexthopIPv6() throws ClassCastException { * @return The actual instance of `NexthopInternet` * @throws ClassCastException if the instance is not `NexthopInternet` */ + @SuppressWarnings("unchecked") public NexthopInternet getNexthopInternet() throws ClassCastException { return (NexthopInternet) super.getActualInstance(); } @@ -307,6 +310,7 @@ public NexthopInternet getNexthopInternet() throws ClassCastException { * @return The actual instance of `NexthopBlackhole` * @throws ClassCastException if the instance is not `NexthopBlackhole` */ + @SuppressWarnings("unchecked") public NexthopBlackhole getNexthopBlackhole() throws ClassCastException { return (NexthopBlackhole) super.getActualInstance(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTable.java index fe47a0da..7e8a028c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTable.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTable.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -36,7 +37,7 @@ * An object representing a routing table. Filterable Fields: `dynamicRoutes`, * `systemRoutes`. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RoutingTable { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -344,10 +345,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -459,7 +457,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTableListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTableListResponse.java index 21698d40..7fa150a5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTableListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/RoutingTableListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Routing table response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RoutingTableListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - RoutingTable.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + RoutingTable.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroup.java index 341e1be0..4796780c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroup.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** Object that represents a security group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroup { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -317,10 +318,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -450,7 +448,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupListResponse.java index 1ffcf25f..cae3fad9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Security group list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - SecurityGroup.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + SecurityGroup.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRule.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRule.java index e8c00314..09b15b4f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRule.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRule.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a security group rule. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupRule { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -410,10 +411,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -574,7 +572,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRuleListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRuleListResponse.java index 5086c39c..e9a73717 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRuleListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRuleListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Security group rule list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupRuleListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -153,10 +154,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -201,21 +199,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - SecurityGroupRule.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + SecurityGroupRule.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -253,7 +250,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRuleProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRuleProtocol.java index a296a086..c90676ab 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRuleProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SecurityGroupRuleProtocol.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The internet protocol which the rule matches. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupRuleProtocol { public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; @@ -138,10 +139,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -213,7 +211,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Server.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Server.java index 739974f3..543a2581 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Server.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Server.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ import java.util.UUID; /** Representation of a single server object. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Server { public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; @@ -769,10 +770,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -1022,7 +1020,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerAgent.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerAgent.java index 9e37470b..e8365ab2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerAgent.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerAgent.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** STACKIT server agent options for a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerAgent { public static final String SERIALIZED_NAME_PROVISIONED = "provisioned"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -209,7 +207,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerConsoleUrl.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerConsoleUrl.java index ceb20584..7d9f7f7d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerConsoleUrl.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerConsoleUrl.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a server console URL. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerConsoleUrl { public static final String SERIALIZED_NAME_URL = "url"; @@ -139,10 +140,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -228,7 +226,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerListResponse.java index efeb8947..bb05f418 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Response object for server list request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Server.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Server.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerMaintenance.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerMaintenance.java index 1017d6dc..05adcfef 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerMaintenance.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerMaintenance.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents the information about the next planned server maintenance window. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerMaintenance { public static final String SERIALIZED_NAME_DETAILS = "details"; @@ -220,10 +221,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -318,7 +316,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetwork.java index fe727811..f755dd36 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetwork.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetwork.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -24,6 +25,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -34,13 +36,18 @@ import java.util.UUID; /** Describes the object that matches servers to its networks. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_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) @@ -91,8 +98,19 @@ public class ServerNetwork { @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) @javax.annotation.Nullable private List securityGroups = new ArrayList<>(); + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public ServerNetwork() {} + public ServerNetwork(OffsetDateTime createdAt, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + public ServerNetwork allowedAddresses( @javax.annotation.Nullable List allowedAddresses) { this.allowedAddresses = allowedAddresses; @@ -121,6 +139,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public ServerNetwork ipv4(@javax.annotation.Nullable String ipv4) { this.ipv4 = ipv4; return this; @@ -296,6 +323,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou this.securityGroups = securityGroups; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -350,6 +386,7 @@ public boolean equals(Object o) { } ServerNetwork serverNetwork = (ServerNetwork) o; return Objects.equals(this.allowedAddresses, serverNetwork.allowedAddresses) + && Objects.equals(this.createdAt, serverNetwork.createdAt) && Objects.equals(this.ipv4, serverNetwork.ipv4) && Objects.equals(this.ipv6, serverNetwork.ipv6) && Objects.equals(this.mac, serverNetwork.mac) @@ -359,6 +396,7 @@ public boolean equals(Object o) { && Objects.equals(this.nicSecurity, serverNetwork.nicSecurity) && Objects.equals(this.publicIp, serverNetwork.publicIp) && Objects.equals(this.securityGroups, serverNetwork.securityGroups) + && Objects.equals(this.updatedAt, serverNetwork.updatedAt) && Objects.equals(this.additionalProperties, serverNetwork.additionalProperties); } @@ -366,6 +404,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, ipv4, ipv6, mac, @@ -375,6 +414,7 @@ public int hashCode() { nicSecurity, publicIp, securityGroups, + updatedAt, additionalProperties); } @@ -383,6 +423,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ServerNetwork {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).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"); @@ -392,6 +433,7 @@ public String toString() { sb.append(" nicSecurity: ").append(toIndentedString(nicSecurity)).append("\n"); sb.append(" publicIp: ").append(toIndentedString(publicIp)).append("\n"); sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -404,10 +446,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -419,6 +458,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "ipv4", "ipv6", "mac", @@ -427,7 +467,8 @@ private String toIndentedString(Object o) { "nicId", "nicSecurity", "publicIp", - "securityGroups")); + "securityGroups", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = @@ -581,7 +622,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetworking.java index 6344d547..d3a62b5a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetworking.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServerNetworking.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerNetworking extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(ServerNetworking.class.getName()); @@ -212,6 +212,7 @@ public Object getActualInstance() { * @return The actual instance of `CreateServerNetworking` * @throws ClassCastException if the instance is not `CreateServerNetworking` */ + @SuppressWarnings("unchecked") public CreateServerNetworking getCreateServerNetworking() throws ClassCastException { return (CreateServerNetworking) super.getActualInstance(); } @@ -223,6 +224,7 @@ public CreateServerNetworking getCreateServerNetworking() throws ClassCastExcept * @return The actual instance of `CreateServerNetworkingWithNics` * @throws ClassCastException if the instance is not `CreateServerNetworkingWithNics` */ + @SuppressWarnings("unchecked") public CreateServerNetworkingWithNics getCreateServerNetworkingWithNics() throws ClassCastException { return (CreateServerNetworkingWithNics) super.getActualInstance(); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServiceAccountMailListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServiceAccountMailListResponse.java index 82ff80fb..a2a5fb1d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServiceAccountMailListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/ServiceAccountMailListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Service account mail list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServiceAccountMailListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -151,10 +152,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SetImageSharePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SetImageSharePayload.java index 6453553c..caa6fa94 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SetImageSharePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SetImageSharePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SetImageSharePayload { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -178,10 +179,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -258,7 +256,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Snapshot.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Snapshot.java index 087133d6..192e25d9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Snapshot.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Snapshot.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a snapshot. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Snapshot { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -50,6 +51,11 @@ public class Snapshot { @SerializedName(SERIALIZED_NAME_DESCRIPTION) @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_ENCRYPTED = "encrypted"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED) + @javax.annotation.Nullable private Boolean encrypted; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -91,6 +97,7 @@ public Snapshot() {} public Snapshot( String availabilityZone, OffsetDateTime createdAt, + Boolean encrypted, UUID id, Long size, String status, @@ -98,6 +105,7 @@ public Snapshot( this(); this.availabilityZone = availabilityZone; this.createdAt = createdAt; + this.encrypted = encrypted; this.id = id; this.size = size; this.status = status; @@ -140,6 +148,15 @@ public void setDescription(@javax.annotation.Nullable String description) { this.description = description; } + /** + * Indicates if a volume is encrypted. + * + * @return encrypted + */ + @javax.annotation.Nullable public Boolean getEncrypted() { + return encrypted; + } + /** * Universally Unique Identifier (UUID). * @@ -303,6 +320,7 @@ public boolean equals(Object o) { return Objects.equals(this.availabilityZone, snapshot.availabilityZone) && Objects.equals(this.createdAt, snapshot.createdAt) && Objects.equals(this.description, snapshot.description) + && Objects.equals(this.encrypted, snapshot.encrypted) && Objects.equals(this.id, snapshot.id) && Objects.equals(this.labels, snapshot.labels) && Objects.equals(this.name, snapshot.name) @@ -319,6 +337,7 @@ public int hashCode() { availabilityZone, createdAt, description, + encrypted, id, labels, name, @@ -336,6 +355,7 @@ public String toString() { sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" encrypted: ").append(toIndentedString(encrypted)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -355,10 +375,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -372,6 +389,7 @@ private String toIndentedString(Object o) { "availabilityZone", "createdAt", "description", + "encrypted", "id", "labels", "name", @@ -496,7 +514,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SnapshotListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SnapshotListResponse.java index f5b3c5f8..49d487db 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SnapshotListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/SnapshotListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Snapshot list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SnapshotListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Snapshot.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Snapshot.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateAttachedVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateAttachedVolumePayload.java index d23198d9..23b685c6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateAttachedVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateAttachedVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a Volume attachment to a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateAttachedVolumePayload { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -182,10 +183,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -271,7 +269,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateBackupPayload.java index ab514e70..278063ad 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateBackupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a backup. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateBackupPayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -384,10 +385,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -525,7 +523,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImagePayload.java index c8ce74a7..68185995 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImagePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of an Image. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateImagePayload { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -337,10 +338,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -441,7 +439,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImageSharePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImageSharePayload.java index 2e494f54..3525baf2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImageSharePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateImageSharePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateImageSharePayload { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -178,10 +179,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -259,7 +257,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateKeyPairPayload.java index 45d9c546..90d4ce27 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateKeyPairPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a public key of an SSH keypair. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateKeyPairPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -152,10 +153,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -222,7 +220,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRegionPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRegionPayload.java index 683e2b80..1bd09a38 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRegionPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRegionPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the request body for a regional network area update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNetworkAreaRegionPayload { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -141,10 +142,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -218,7 +216,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRoutePayload.java index ee0b44ab..ffb50d23 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkAreaRoutePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the request body for a route update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNetworkAreaRoutePayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -154,10 +155,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -227,7 +225,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkIPv4Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkIPv4Body.java index 6cdf3dac..452efa8e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkIPv4Body.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkIPv4Body.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The config object for a IPv4 network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNetworkIPv4Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -190,10 +191,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -278,7 +276,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkIPv6Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkIPv6Body.java index 0939a87f..b96d8b8e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkIPv6Body.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNetworkIPv6Body.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The config object for a IPv6 network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNetworkIPv6Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -190,10 +191,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -278,7 +276,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNicPayload.java index 60d6fa19..1053c342 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateNicPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** Object that represents a network interface update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNicPayload { public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; @@ -304,10 +305,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -428,7 +426,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java index 9b9c73f9..84f0eb53 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdatePublicIPPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -23,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -33,8 +35,13 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdatePublicIPPayload { + 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) @@ -55,12 +62,29 @@ public class UpdatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public UpdatePublicIPPayload() {} - public UpdatePublicIPPayload(UUID id, String ip) { + public UpdatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -132,6 +156,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -185,10 +218,12 @@ public boolean equals(Object o) { return false; } UpdatePublicIPPayload updatePublicIPPayload = (UpdatePublicIPPayload) o; - return Objects.equals(this.id, updatePublicIPPayload.id) + return Objects.equals(this.createdAt, updatePublicIPPayload.createdAt) + && Objects.equals(this.id, updatePublicIPPayload.id) && Objects.equals(this.ip, updatePublicIPPayload.ip) && Objects.equals(this.labels, updatePublicIPPayload.labels) && Objects.equals(this.networkInterface, updatePublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, updatePublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, updatePublicIPPayload.additionalProperties); } @@ -204,7 +239,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -218,10 +254,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\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(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -234,10 +272,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -246,7 +281,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -330,7 +372,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRegionalAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRegionalAreaIPv4.java index 75147046..914664f6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRegionalAreaIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRegionalAreaIPv4.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ /** * Object that represents the request body for a regional network area IPv4 configuration update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateRegionalAreaIPv4 { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; @@ -233,10 +234,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -319,7 +317,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRouteOfRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRouteOfRoutingTablePayload.java index ed71d0a6..f7d15979 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRouteOfRoutingTablePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRouteOfRoutingTablePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the request body for a route update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateRouteOfRoutingTablePayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -154,10 +155,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -227,7 +225,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRoutingTableOfAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRoutingTableOfAreaPayload.java index 954ace36..0561c183 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRoutingTableOfAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateRoutingTableOfAreaPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the request body for a routing table update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateRoutingTableOfAreaPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -260,10 +261,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -352,7 +350,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSecurityGroupPayload.java index 72ebffc5..ec4b9d7f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSecurityGroupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a security group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateSecurityGroupPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -202,10 +203,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -289,7 +287,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateServerPayload.java index c13c1e87..765b5d61 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateServerPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -204,10 +205,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -282,7 +280,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSnapshotPayload.java index 56864c0b..2fb6a08e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateSnapshotPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a snapshot. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateSnapshotPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -202,10 +203,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -288,7 +286,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateVolumePayload.java index 867b8324..3b0b90ee 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/UpdateVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a volume. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateVolumePayload { public static final String SERIALIZED_NAME_BOOTABLE = "bootable"; @@ -252,10 +253,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -344,7 +342,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Volume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Volume.java index 0c63d3dd..1841f649 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Volume.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/Volume.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Volume { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -515,10 +516,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -683,7 +681,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeAttachment.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeAttachment.java index 0184b35f..fbd7c256 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeAttachment.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeAttachment.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a Volume attachment to a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeAttachment { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -179,10 +180,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -266,7 +264,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeAttachmentListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeAttachmentListResponse.java index 23fb81e8..8bc948f1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeAttachmentListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeAttachmentListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Volume attachment list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeAttachmentListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -153,10 +154,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -201,21 +199,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - VolumeAttachment.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + VolumeAttachment.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -253,7 +250,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeEncryptionParameter.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeEncryptionParameter.java index 9f04d382..4750e7ca 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeEncryptionParameter.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeEncryptionParameter.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -37,7 +38,7 @@ * STACKIT-KMS. These parameter never leave the backend again. So these parameters are not in the * responses. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeEncryptionParameter { public static final String SERIALIZED_NAME_KEK_KEY_ID = "kekKeyId"; @@ -289,10 +290,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -412,7 +410,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeListResponse.java index a1d9bc63..d775d196 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Volume list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Volume.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Volume.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClass.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClass.java index 104e7c76..9cc6d2d9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClass.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClass.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a Volume performance class. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumePerformanceClass { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -254,10 +255,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -353,7 +351,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClassListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClassListResponse.java index d36249d6..61be469d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClassListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumePerformanceClassListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Volume performance class list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumePerformanceClassListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -153,10 +154,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -202,21 +200,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - VolumePerformanceClass.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + VolumePerformanceClass.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -254,7 +251,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeSource.java index 7aee1bd9..8cbf7533 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2api/model/VolumeSource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The source object of a volume. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -168,10 +169,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -263,7 +261,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ApiClient.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ApiClient.java index f72abeed..131558cb 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ApiClient.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ApiClient.java @@ -397,6 +397,17 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + /** + * Set LocalDateTimeFormat. + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link cloud.stackit.sdk.iaas.v2beta1api.ApiClient} object + */ + public ApiClient setLocalDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateTimeFormat(dateFormat); + return this; + } + /** * Set LenientOnJson. * @@ -597,6 +608,46 @@ public String parameterToString(Object param) { } } + /** + * Format the given parameter object as an ASCII-safe JSON string. + * + * @param param Parameter + * @return JSON representation of the parameter + */ + public String parameterToJsonString(Object param) { + if (param == null) { + return ""; + } + String json = JSON.serialize(param); + int firstUnsafe = -1; + for (int i = 0; i < json.length(); i++) { + if (json.charAt(i) >= 0x7f) { + firstUnsafe = i; + break; + } + } + if (firstUnsafe == -1) { + return json; + } + + StringBuilder escaped = new StringBuilder(json.length()); + escaped.append(json, 0, firstUnsafe); + for (int i = firstUnsafe; i < json.length(); i++) { + char c = json.charAt(i); + if (c >= 0x7f) { + escaped.append("\\u"); + escaped.append(Character.forDigit((c >> 12) & 0xf, 16)); + escaped.append(Character.forDigit((c >> 8) & 0xf, 16)); + escaped.append(Character.forDigit((c >> 4) & 0xf, 16)); + escaped.append(Character.forDigit(c & 0xf, 16)); + } else { + escaped.append(c); + } + } + + return escaped.toString(); + } + /** * Formats the specified query parameter to a list containing a single {@code Pair} object. * diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/JSON.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/JSON.java index 6edbb0c8..31a04000 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/JSON.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/JSON.java @@ -32,8 +32,10 @@ import java.text.ParseException; import java.text.ParsePosition; import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -53,6 +55,8 @@ public class JSON { private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static LocalDateTimeTypeAdapter localDateTimeTypeAdapter = + new LocalDateTimeTypeAdapter(); private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") @@ -80,6 +84,10 @@ public static GsonBuilder createGson() { "cidrv6", cloud.stackit.sdk.iaas.v2beta1api.model .DestinationCIDRv6.class); + classByDiscriminatorValue.put( + "prefixlist", + cloud.stackit.sdk.iaas.v2beta1api.model + .DestinationPrefixList.class); classByDiscriminatorValue.put( "Route_destination", cloud.stackit.sdk.iaas.v2beta1api.model @@ -164,6 +172,7 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDateTime.class, localDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2beta1api.model.AddRoutesToRoutingTablePayload @@ -288,6 +297,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2beta1api.model.DestinationCIDRv6 .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new cloud.stackit.sdk.iaas.v2beta1api.model.DestinationPrefixList + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new cloud.stackit.sdk.iaas.v2beta1api.model.Error.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -759,6 +771,53 @@ public LocalDate read(JsonReader in) throws IOException { } } + /** Gson TypeAdapter for JSR310 LocalDateTime type */ + public static class LocalDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE_TIME); + } + + public LocalDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + return LocalDateTime.parse(date, formatter); + } catch (DateTimeParseException e) { + if (date.length() > 10 && date.charAt(10) == ' ') { + date = date.substring(0, 10) + 'T' + date.substring(11); + return LocalDateTime.parse(date, formatter); + } + throw e; + } + } + } + } + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); } @@ -767,6 +826,10 @@ public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); } + public static void setLocalDateTimeFormat(DateTimeFormatter dateFormat) { + localDateTimeTypeAdapter.setFormat(dateFormat); + } + /** * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" * format will be used (more efficient than SimpleDateFormat). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/Pair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/Pair.java index 8d36a5c0..5ae218d0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/Pair.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/Pair.java @@ -12,7 +12,7 @@ package cloud.stackit.sdk.iaas.v2beta1api; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Pair { private final String name; private final String value; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ServerConfiguration.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ServerConfiguration.java index 4d63cf89..450b7341 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ServerConfiguration.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ServerConfiguration.java @@ -15,7 +15,7 @@ import java.util.Map; /** Representing a Server configuration. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerConfiguration { public String URL; public String description; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ServerVariable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ServerVariable.java index 87f6ec17..5299b761 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ServerVariable.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/ServerVariable.java @@ -15,7 +15,7 @@ import java.util.HashSet; /** Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/StringUtil.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/StringUtil.java index 0b313d1d..51207359 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/StringUtil.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/StringUtil.java @@ -15,7 +15,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AbstractOpenApiSchema.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AbstractOpenApiSchema.java index 3deec862..bc7b5d16 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AbstractOpenApiSchema.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AbstractOpenApiSchema.java @@ -16,7 +16,7 @@ import java.util.Objects; /** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -104,10 +104,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public boolean equals(Object o) { diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutesToRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutesToRoutingTablePayload.java index b4fe9fac..d3f9d0c1 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutesToRoutingTablePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutesToRoutingTablePayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Object represents a request to add network routes. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AddRoutesToRoutingTablePayload { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -152,10 +153,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -200,21 +198,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Route.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Route.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -252,7 +249,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutingTableToAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutingTableToAreaPayload.java index b8ba78c7..819dddb4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutingTableToAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddRoutingTableToAreaPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -36,7 +37,7 @@ * An object representing a routing table. Filterable Fields: `dynamicRoutes`, * `systemRoutes`. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AddRoutingTableToAreaPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -349,10 +350,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -468,7 +466,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddVolumeToServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddVolumeToServerPayload.java index d2d054b9..f151b2c8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddVolumeToServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AddVolumeToServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a Volume attachment to a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AddVolumeToServerPayload { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -181,10 +182,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -269,7 +267,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AffinityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AffinityGroup.java index 67113a67..02c57dae 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AffinityGroup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AffinityGroup.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Definition of an affinity group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AffinityGroup { public static final String SERIALIZED_NAME_ID = "id"; @@ -212,10 +213,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -325,7 +323,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AffinityGroupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AffinityGroupListResponse.java index 544b984f..f01b2c58 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AffinityGroupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AffinityGroupListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Response object for affinity group list request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AffinityGroupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - AffinityGroup.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + AffinityGroup.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AllowedAddressesInner.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AllowedAddressesInner.java index 0a005403..aed1dfa8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AllowedAddressesInner.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AllowedAddressesInner.java @@ -28,7 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AllowedAddressesInner extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(AllowedAddressesInner.class.getName()); @@ -174,6 +174,7 @@ public Object getActualInstance() { * @return The actual instance of `String` * @throws ClassCastException if the instance is not `String` */ + @SuppressWarnings("unchecked") public String getString() throws ClassCastException { return (String) super.getActualInstance(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AreaId.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AreaId.java index 2227dadd..26cf222e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AreaId.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AreaId.java @@ -28,7 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AreaId extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(AreaId.class.getName()); @@ -197,6 +197,7 @@ public Object getActualInstance() { * @return The actual instance of `UUID` * @throws ClassCastException if the instance is not `UUID` */ + @SuppressWarnings("unchecked") public UUID getUUID() throws ClassCastException { return (UUID) super.getActualInstance(); } @@ -208,6 +209,7 @@ public UUID getUUID() throws ClassCastException { * @return The actual instance of `StaticAreaID` * @throws ClassCastException if the instance is not `StaticAreaID` */ + @SuppressWarnings("unchecked") public StaticAreaID getStaticAreaID() throws ClassCastException { return (StaticAreaID) super.getActualInstance(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AvailabilityZoneListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AvailabilityZoneListResponse.java index 520b9b5b..7a8521b8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AvailabilityZoneListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/AvailabilityZoneListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Availability Zone list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class AvailabilityZoneListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -151,10 +152,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Backup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Backup.java index 35f9ca7c..8a8279d9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Backup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Backup.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a backup. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Backup { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -383,10 +384,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -523,7 +521,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BackupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BackupListResponse.java index 3e7b01f4..0f8bbf73 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BackupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BackupListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Backup list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BackupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Backup.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Backup.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BackupSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BackupSource.java index a0b7b95c..eee5e43b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BackupSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BackupSource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The source object of a backup. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BackupSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -262,7 +260,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BaseSecurityGroupRule.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BaseSecurityGroupRule.java index fe3f636f..bb8da5c4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BaseSecurityGroupRule.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BaseSecurityGroupRule.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** The base schema for a security group rule. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BaseSecurityGroupRule { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -384,10 +385,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -543,7 +541,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BootVolume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BootVolume.java index 74056c1b..da4384b2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BootVolume.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BootVolume.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The boot device for the server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BootVolume { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -237,10 +238,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -330,7 +328,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BootVolumeSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BootVolumeSource.java index a470c5fb..fb32f1bc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BootVolumeSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/BootVolumeSource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The source object of a boot volume. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class BootVolumeSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -263,7 +261,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateAffinityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateAffinityGroupPayload.java index 0ddf26ff..a9bb9944 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateAffinityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateAffinityGroupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Definition of an affinity group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateAffinityGroupPayload { public static final String SERIALIZED_NAME_ID = "id"; @@ -213,10 +214,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -328,7 +326,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateBackupPayload.java index d9264843..cda61ca4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateBackupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a backup create request body. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateBackupPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -229,10 +230,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -330,7 +328,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateImagePayload.java index e905f9f4..7b33ab23 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateImagePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents an Image and its parameters. Used for Creating and returning (get/list). */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateImagePayload { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -522,10 +523,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -681,7 +679,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateIsolatedNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateIsolatedNetworkPayload.java index 2b45dbe7..f2f99c91 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateIsolatedNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateIsolatedNetworkPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the request body for a single isolated network create. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateIsolatedNetworkPayload { public static final String SERIALIZED_NAME_DHCP = "dhcp"; @@ -231,10 +232,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -327,7 +325,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateKeyPairPayload.java index ab7e7f15..336a0bf8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateKeyPairPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents the public key of an SSH keypair and its name. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateKeyPairPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -263,10 +264,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -376,7 +374,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaPayload.java index 936e3f4d..e20c45d2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the network area create request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkAreaPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -179,10 +180,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -269,7 +267,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaRangePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaRangePayload.java index 51d4939b..76c5facd 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaRangePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaRangePayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** CreateNetworkAreaRangePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkAreaRangePayload { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -242,7 +240,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaRoutePayload.java index 27688c73..1fd15643 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkAreaRoutePayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Object represents a request to add network routes. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkAreaRoutePayload { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -152,10 +153,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -200,21 +198,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Route.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Route.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -252,7 +249,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4.java index fda8343b..12286cdc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv4 extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateNetworkIPv4.class.getName()); @@ -215,6 +215,7 @@ public Object getActualInstance() { * @return The actual instance of `CreateNetworkIPv4WithPrefix` * @throws ClassCastException if the instance is not `CreateNetworkIPv4WithPrefix` */ + @SuppressWarnings("unchecked") public CreateNetworkIPv4WithPrefix getCreateNetworkIPv4WithPrefix() throws ClassCastException { return (CreateNetworkIPv4WithPrefix) super.getActualInstance(); } @@ -226,6 +227,7 @@ public CreateNetworkIPv4WithPrefix getCreateNetworkIPv4WithPrefix() throws Class * @return The actual instance of `CreateNetworkIPv4WithPrefixLength` * @throws ClassCastException if the instance is not `CreateNetworkIPv4WithPrefixLength` */ + @SuppressWarnings("unchecked") public CreateNetworkIPv4WithPrefixLength getCreateNetworkIPv4WithPrefixLength() throws ClassCastException { return (CreateNetworkIPv4WithPrefixLength) super.getActualInstance(); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4WithPrefix.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4WithPrefix.java index ba17baba..49d5695d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4WithPrefix.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4WithPrefix.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The create request for an IPv4 network with a specified prefix. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv4WithPrefix { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -249,10 +250,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -369,7 +367,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4WithPrefixLength.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4WithPrefixLength.java index d6a59278..2b4ad5c8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4WithPrefixLength.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv4WithPrefixLength.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** The create request for an IPv4 network with a wanted prefix length. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv4WithPrefixLength { public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; @@ -208,10 +209,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -315,7 +313,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6.java index bd2e6b46..515713d5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv6 extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateNetworkIPv6.class.getName()); @@ -215,6 +215,7 @@ public Object getActualInstance() { * @return The actual instance of `CreateNetworkIPv6WithPrefix` * @throws ClassCastException if the instance is not `CreateNetworkIPv6WithPrefix` */ + @SuppressWarnings("unchecked") public CreateNetworkIPv6WithPrefix getCreateNetworkIPv6WithPrefix() throws ClassCastException { return (CreateNetworkIPv6WithPrefix) super.getActualInstance(); } @@ -226,6 +227,7 @@ public CreateNetworkIPv6WithPrefix getCreateNetworkIPv6WithPrefix() throws Class * @return The actual instance of `CreateNetworkIPv6WithPrefixLength` * @throws ClassCastException if the instance is not `CreateNetworkIPv6WithPrefixLength` */ + @SuppressWarnings("unchecked") public CreateNetworkIPv6WithPrefixLength getCreateNetworkIPv6WithPrefixLength() throws ClassCastException { return (CreateNetworkIPv6WithPrefixLength) super.getActualInstance(); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6WithPrefix.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6WithPrefix.java index f4195392..0c1bbd54 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6WithPrefix.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6WithPrefix.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The create request for an IPv6 network with a specified prefix. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv6WithPrefix { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -249,10 +250,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -369,7 +367,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6WithPrefixLength.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6WithPrefixLength.java index db19f3d9..d84321c4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6WithPrefixLength.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkIPv6WithPrefixLength.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** The create request for an IPv6 network with a wanted prefix length. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkIPv6WithPrefixLength { public static final String SERIALIZED_NAME_NAMESERVERS = "nameservers"; @@ -208,10 +209,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -315,7 +313,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkPayload.java index 8633f8de..dcb2fc18 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNetworkPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents the request body for a network create. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateNetworkPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -365,10 +366,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -497,7 +495,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java index 510d3693..a6e4312f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateNicPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -24,6 +25,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -34,13 +36,18 @@ import java.util.UUID; /** Object that represents a network interface. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_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) @@ -106,17 +113,31 @@ public class CreateNicPayload { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreateNicPayload() {} public CreateNicPayload( - UUID device, UUID id, String mac, UUID networkId, String status, String type) { + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public CreateNicPayload allowedAddresses( @@ -147,6 +168,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public CreateNicPayload description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -350,6 +380,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -404,6 +443,7 @@ public boolean equals(Object o) { } CreateNicPayload createNicPayload = (CreateNicPayload) o; return Objects.equals(this.allowedAddresses, createNicPayload.allowedAddresses) + && Objects.equals(this.createdAt, createNicPayload.createdAt) && Objects.equals(this.description, createNicPayload.description) && Objects.equals(this.device, createNicPayload.device) && Objects.equals(this.id, createNicPayload.id) @@ -417,6 +457,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, createNicPayload.securityGroups) && Objects.equals(this.status, createNicPayload.status) && Objects.equals(this.type, createNicPayload.type) + && Objects.equals(this.updatedAt, createNicPayload.updatedAt) && Objects.equals(this.additionalProperties, createNicPayload.additionalProperties); } @@ -424,6 +465,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -437,6 +479,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -445,6 +488,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateNicPayload {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -458,6 +502,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -470,10 +515,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -485,6 +527,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -497,7 +540,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -666,7 +710,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateProtocol.java index 4bed6aca..4431874a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateProtocol.java @@ -28,7 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateProtocol extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateProtocol.class.getName()); @@ -212,6 +212,7 @@ public Object getActualInstance() { * @return The actual instance of `Long` * @throws ClassCastException if the instance is not `Long` */ + @SuppressWarnings("unchecked") public Long getLong() throws ClassCastException { return (Long) super.getActualInstance(); } @@ -223,6 +224,7 @@ public Long getLong() throws ClassCastException { * @return The actual instance of `String` * @throws ClassCastException if the instance is not `String` */ + @SuppressWarnings("unchecked") public String getString() throws ClassCastException { return (String) super.getActualInstance(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java index 52050a4e..32e8d8c0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreatePublicIPPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -23,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -33,8 +35,13 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreatePublicIPPayload { + 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) @@ -55,12 +62,29 @@ public class CreatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public CreatePublicIPPayload() {} - public CreatePublicIPPayload(UUID id, String ip) { + public CreatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -132,6 +156,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -185,10 +218,12 @@ public boolean equals(Object o) { return false; } CreatePublicIPPayload createPublicIPPayload = (CreatePublicIPPayload) o; - return Objects.equals(this.id, createPublicIPPayload.id) + return Objects.equals(this.createdAt, createPublicIPPayload.createdAt) + && Objects.equals(this.id, createPublicIPPayload.id) && Objects.equals(this.ip, createPublicIPPayload.ip) && Objects.equals(this.labels, createPublicIPPayload.labels) && Objects.equals(this.networkInterface, createPublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, createPublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, createPublicIPPayload.additionalProperties); } @@ -204,7 +239,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -218,10 +254,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\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(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -234,10 +272,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -246,7 +281,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -330,7 +372,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupPayload.java index 8874ce9b..ca383b1c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** Object that represents a security group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSecurityGroupPayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -318,10 +319,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -453,7 +451,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupRulePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupRulePayload.java index d5906a64..1cea2cb2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupRulePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupRulePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a request body for security group rule creation. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSecurityGroupRulePayload { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -418,10 +419,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -585,7 +583,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupRuleProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupRuleProtocol.java index 7ec5f542..82c250f2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupRuleProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateSecurityGroupRuleProtocol.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The internet protocol which the rule should match. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateSecurityGroupRuleProtocol { public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; @@ -141,10 +142,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -218,7 +216,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerNetworking.java index 50b24852..d7ea44a8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerNetworking.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerNetworking.java @@ -31,7 +31,7 @@ import java.util.UUID; /** The initial networking setup for the server creation with a network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerNetworking { public static final String SERIALIZED_NAME_NETWORK_ID = "networkId"; @@ -89,10 +89,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerNetworkingWithNics.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerNetworkingWithNics.java index da353160..62f2d9eb 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerNetworkingWithNics.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerNetworkingWithNics.java @@ -33,7 +33,7 @@ import java.util.UUID; /** The initial networking setup for the server creation with a network interface. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerNetworkingWithNics { public static final String SERIALIZED_NAME_NIC_IDS = "nicIds"; @@ -100,10 +100,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayload.java index 0f7f2386..c5a7c94b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ import java.util.UUID; /** Object that represents the request body for a server create. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerPayload { public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; @@ -777,10 +778,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -1030,7 +1028,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayloadAllOfNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayloadAllOfNetworking.java index 9a4f7421..7b854f1a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayloadAllOfNetworking.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateServerPayloadAllOfNetworking.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateServerPayloadAllOfNetworking extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(CreateServerPayloadAllOfNetworking.class.getName()); @@ -216,6 +216,7 @@ public Object getActualInstance() { * @return The actual instance of `CreateServerNetworking` * @throws ClassCastException if the instance is not `CreateServerNetworking` */ + @SuppressWarnings("unchecked") public CreateServerNetworking getCreateServerNetworking() throws ClassCastException { return (CreateServerNetworking) super.getActualInstance(); } @@ -227,6 +228,7 @@ public CreateServerNetworking getCreateServerNetworking() throws ClassCastExcept * @return The actual instance of `CreateServerNetworkingWithNics` * @throws ClassCastException if the instance is not `CreateServerNetworkingWithNics` */ + @SuppressWarnings("unchecked") public CreateServerNetworkingWithNics getCreateServerNetworkingWithNics() throws ClassCastException { return (CreateServerNetworkingWithNics) super.getActualInstance(); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateVolumePayload.java index eb2515a9..df0eca24 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/CreateVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class CreateVolumePayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -518,10 +519,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -687,7 +685,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv4.java index 786c669a..ee5506d0 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv4.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** IPv4 Classless Inter-Domain Routing (CIDR) Object. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DestinationCIDRv4 { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -219,10 +220,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -325,7 +323,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv6.java index ae32c063..c3f674ad 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationCIDRv6.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** IPv6 Classless Inter-Domain Routing (CIDR) Object. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class DestinationCIDRv6 { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -219,10 +220,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -325,7 +323,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationPrefixList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationPrefixList.java new file mode 100644 index 00000000..dfab96f5 --- /dev/null +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/DestinationPrefixList.java @@ -0,0 +1,395 @@ +/* + * STACKIT IaaS API + * This API allows you to create and modify IaaS resources. + * + * The version of the OpenAPI document: 2beta1 + * 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.v2beta1api.model; + +import cloud.stackit.sdk.iaas.v2beta1api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonNull; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Prefix List destination reference object. */ +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") +public class DestinationPrefixList { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + PREFIXLIST("prefixlist"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_VALUE = "value"; + + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private UUID value; + + public DestinationPrefixList() {} + + public DestinationPrefixList type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + public DestinationPrefixList value(@javax.annotation.Nonnull UUID value) { + this.value = value; + return this; + } + + /** + * Universally Unique Identifier (UUID). + * + * @return value + */ + @javax.annotation.Nonnull + public UUID getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull UUID value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DestinationPrefixList instance itself + */ + public DestinationPrefixList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationPrefixList destinationPrefixList = (DestinationPrefixList) o; + return Objects.equals(this.type, destinationPrefixList.type) + && Objects.equals(this.value, destinationPrefixList.value) + && Objects.equals( + this.additionalProperties, destinationPrefixList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationPrefixList {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("type", "value")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "value")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DestinationPrefixList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DestinationPrefixList.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The required field(s) %s in DestinationPrefixList is not found in the empty JSON string", + DestinationPrefixList.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationPrefixList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The required field `%s` is not found in the JSON string: %s", + requiredField, + jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `type` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `value` to be a primitive type in the JSON string but got `%s`", + jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationPrefixList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationPrefixList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationPrefixList.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationPrefixList value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : + value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty( + entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DestinationPrefixList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DestinationPrefixList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty( + entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty( + entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty( + entry.getKey(), + entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "The field `%s` has unknown primitive type. Value: %s", + entry.getKey(), + entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty( + entry.getKey(), + gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty( + entry.getKey(), + gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationPrefixList given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationPrefixList + * @throws IOException if the JSON string is invalid with respect to DestinationPrefixList + */ + public static DestinationPrefixList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationPrefixList.class); + } + + /** + * Convert an instance of DestinationPrefixList 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/v2beta1api/model/Error.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Error.java index 56b66ec3..8f7c193e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Error.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Error.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Error with HTTP error code and an error message. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Error { public static final String SERIALIZED_NAME_CODE = "code"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -254,7 +252,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/GetServerLog200Response.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/GetServerLog200Response.java index 6b6cc538..d66529e6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/GetServerLog200Response.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/GetServerLog200Response.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** GetServerLog200Response */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class GetServerLog200Response { public static final String SERIALIZED_NAME_OUTPUT = "output"; @@ -138,10 +139,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -217,7 +215,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ICMPParameters.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ICMPParameters.java index 0d2ff2a7..509947db 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ICMPParameters.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ICMPParameters.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents ICMP parameters. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ICMPParameters { public static final String SERIALIZED_NAME_CODE = "code"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Image.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Image.java index 728030bc..c5bc2098 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Image.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Image.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents an Image and its parameters. Used for Creating and returning (get/list). */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Image { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -521,10 +522,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -679,7 +677,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageAgent.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageAgent.java index 96f99c5e..1d18f3a5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageAgent.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageAgent.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Support status and default provioning setting for the STACKIT server agent. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageAgent { public static final String SERIALIZED_NAME_PROVISION_BY_DEFAULT = "provisionByDefault"; @@ -165,10 +166,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -234,7 +232,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageChecksum.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageChecksum.java index 94bf3ebf..4f862004 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageChecksum.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageChecksum.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Representation of an image checksum. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageChecksum { public static final String SERIALIZED_NAME_ALGORITHM = "algorithm"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -262,7 +260,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageConfig.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageConfig.java index 5a57597e..17e3e455 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageConfig.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageConfig.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Properties to set hardware and scheduling settings for an Image. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageConfig { public static final String SERIALIZED_NAME_ARCHITECTURE = "architecture"; @@ -510,10 +511,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -677,7 +675,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageCreateResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageCreateResponse.java index 3f7f13b8..060a4316 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageCreateResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageCreateResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Image creation response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageCreateResponse { public static final String SERIALIZED_NAME_ID = "id"; @@ -169,10 +170,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -265,7 +263,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageListResponse.java index 373ca65d..a2df0c3a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Image list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Image.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Image.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageShare.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageShare.java index 4a411d6d..536ef9ea 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageShare.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageShare.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageShare { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -176,10 +177,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -255,7 +253,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageShareConsumer.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageShareConsumer.java index 0c7dcf14..58b72ab9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageShareConsumer.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ImageShareConsumer.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** The details of an Image share consumer. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ImageShareConsumer { public static final String SERIALIZED_NAME_CONSUMER_PROJECT_ID = "consumerProjectId"; @@ -193,10 +194,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -282,7 +280,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/KeyPairListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/KeyPairListResponse.java index 279b3cd3..b3d24c21 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/KeyPairListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/KeyPairListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** SSH keypair list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class KeyPairListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Keypair.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Keypair.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Keypair.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Keypair.java index 55b25152..fc856022 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Keypair.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Keypair.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents the public key of an SSH keypair and its name. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Keypair { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -261,10 +262,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -373,7 +371,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/MachineType.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/MachineType.java index d3fcbf13..fd146f2d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/MachineType.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/MachineType.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ * Machine Type. Filterable Fields: `disk`, `extraSpecs`, `name`, * `ram`, `vcpus`. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class MachineType { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -273,10 +274,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -371,7 +369,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/MachineTypeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/MachineTypeListResponse.java index d801d3ce..2e6c3041 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/MachineTypeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/MachineTypeListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Machine type list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class MachineTypeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - MachineType.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + MachineType.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java index 41578843..d10194a9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NIC.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -24,6 +25,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -34,13 +36,18 @@ import java.util.UUID; /** Object that represents a network interface. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_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) @@ -106,16 +113,31 @@ public class NIC { @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public NIC() {} - public NIC(UUID device, UUID id, String mac, UUID networkId, String status, String type) { + public NIC( + OffsetDateTime createdAt, + UUID device, + UUID id, + String mac, + UUID networkId, + String status, + String type, + OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.device = device; this.id = id; this.mac = mac; this.networkId = networkId; this.status = status; this.type = type; + this.updatedAt = updatedAt; } public NIC allowedAddresses( @@ -146,6 +168,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public NIC description(@javax.annotation.Nullable String description) { this.description = description; return this; @@ -349,6 +380,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou return type; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -403,6 +443,7 @@ public boolean equals(Object o) { } NIC NIC = (NIC) o; return Objects.equals(this.allowedAddresses, NIC.allowedAddresses) + && Objects.equals(this.createdAt, NIC.createdAt) && Objects.equals(this.description, NIC.description) && Objects.equals(this.device, NIC.device) && Objects.equals(this.id, NIC.id) @@ -416,6 +457,7 @@ public boolean equals(Object o) { && Objects.equals(this.securityGroups, NIC.securityGroups) && Objects.equals(this.status, NIC.status) && Objects.equals(this.type, NIC.type) + && Objects.equals(this.updatedAt, NIC.updatedAt) && Objects.equals(this.additionalProperties, NIC.additionalProperties); } @@ -423,6 +465,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, description, device, id, @@ -436,6 +479,7 @@ public int hashCode() { securityGroups, status, type, + updatedAt, additionalProperties); } @@ -444,6 +488,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NIC {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" device: ").append(toIndentedString(device)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -457,6 +502,7 @@ public String toString() { sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -469,10 +515,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -484,6 +527,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "description", "device", "id", @@ -496,7 +540,8 @@ private String toIndentedString(Object o) { "nicSecurity", "securityGroups", "status", - "type")); + "type", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -664,7 +709,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NICListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NICListResponse.java index 6e2eab84..9276b820 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NICListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NICListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** NIC list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NICListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -149,10 +150,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -196,21 +194,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - NIC.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + NIC.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -246,7 +243,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Network.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Network.java index 4bcdf878..66813cdf 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Network.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Network.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -36,7 +37,7 @@ * Object that represents a network. If no routing table is specified, the default routing table is * used. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Network { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -466,10 +467,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -615,7 +613,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkArea.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkArea.java index 1874dd34..814d55d2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkArea.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkArea.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkArea { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -254,10 +255,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -353,7 +351,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkAreaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkAreaListResponse.java index ec9a6bfa..00617146 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkAreaListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkAreaListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Network area list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkAreaListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - NetworkArea.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + NetworkArea.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkIPv4.java index 2b1e8607..7d197ebc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkIPv4.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents the IPv4 part of a network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkIPv4 { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -274,10 +275,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -408,7 +406,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkIPv6.java index 329afc28..ca3838c9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkIPv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkIPv6.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents the IPv6 part of a network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkIPv6 { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -253,10 +254,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -374,7 +372,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkListResponse.java index 70ac577b..1e08d166 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Network list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Network.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Network.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkRange.java index 683820d2..c8ddb2bb 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkRange.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkRange.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a network range of a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkRange { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -196,10 +197,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -293,7 +291,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkRangeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkRangeListResponse.java index c6dfcabb..c71e6f3e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkRangeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NetworkRangeListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Network Range list response of a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NetworkRangeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - NetworkRange.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + NetworkRange.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopBlackhole.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopBlackhole.java index e82b3729..0e84e472 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopBlackhole.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopBlackhole.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents a blackhole route. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NexthopBlackhole { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -191,10 +192,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -290,7 +288,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv4.java index c5c43f29..da68d442 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv4.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents an IPv4 address. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NexthopIPv4 { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -218,10 +219,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -323,7 +321,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv6.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv6.java index 99da3a1c..fccc9d25 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv6.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopIPv6.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents an IPv6 address. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NexthopIPv6 { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -218,10 +219,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -323,7 +321,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopInternet.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopInternet.java index 7e54a337..d55425c2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopInternet.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/NexthopInternet.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents a route to the internet. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class NexthopInternet { /** Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) @@ -191,10 +192,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -290,7 +288,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkAreaPayload.java index 81399222..b69b439c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkAreaPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the network area update request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PartialUpdateNetworkAreaPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -179,10 +180,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -260,7 +258,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkPayload.java index a8133d4d..9352da87 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PartialUpdateNetworkPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents the request body for a network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PartialUpdateNetworkPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -339,10 +340,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -453,7 +451,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PortRange.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PortRange.java index 7546c185..3428fb20 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PortRange.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PortRange.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ * Object that represents a range of ports (this will be omitted if it covers the full default range * 0/1-65535). */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PortRange { public static final String SERIALIZED_NAME_MAX = "max"; @@ -169,10 +170,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -250,7 +248,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Project.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Project.java index 360503ba..4d75d133 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Project.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Project.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a STACKIT project. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Project { public static final String SERIALIZED_NAME_AREA_ID = "areaId"; @@ -319,10 +320,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -442,7 +440,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ProjectListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ProjectListResponse.java index d20024f2..e9887626 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ProjectListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ProjectListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Project list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ProjectListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -243,7 +241,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Protocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Protocol.java index c120a5d3..c8dfb801 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Protocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Protocol.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The schema for a protocol of a security group rule. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Protocol { public static final String SERIALIZED_NAME_NAME = "name"; @@ -167,10 +168,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -244,7 +242,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java index b0511655..d8b74de9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIp.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -23,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -33,8 +35,13 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicIp { + 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) @@ -55,12 +62,28 @@ public class PublicIp { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public PublicIp() {} - public PublicIp(UUID id, String ip) { + public PublicIp(OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -131,6 +154,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -184,10 +216,12 @@ public boolean equals(Object o) { return false; } PublicIp publicIp = (PublicIp) o; - return Objects.equals(this.id, publicIp.id) + return Objects.equals(this.createdAt, publicIp.createdAt) + && Objects.equals(this.id, publicIp.id) && Objects.equals(this.ip, publicIp.ip) && Objects.equals(this.labels, publicIp.labels) && Objects.equals(this.networkInterface, publicIp.networkInterface) + && Objects.equals(this.updatedAt, publicIp.updatedAt) && Objects.equals(this.additionalProperties, publicIp.additionalProperties); } @@ -202,7 +236,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -216,10 +251,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PublicIp {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\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(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -232,10 +269,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -244,7 +278,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -327,7 +368,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIpListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIpListResponse.java index 58e874bd..216c3a9a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIpListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicIpListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Public IP list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicIpListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - PublicIp.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + PublicIp.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicNetwork.java index fad7aad1..6f316793 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicNetwork.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicNetwork.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Public network. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicNetwork { public static final String SERIALIZED_NAME_CIDR = "cidr"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -261,7 +259,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicNetworkListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicNetworkListResponse.java index 98081246..d3d8c7a3 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicNetworkListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/PublicNetworkListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Public network list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class PublicNetworkListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - PublicNetwork.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + PublicNetwork.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Quota.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Quota.java index abfb8c48..77703827 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Quota.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Quota.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a single resource quota. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Quota { public static final String SERIALIZED_NAME_LIMIT = "limit"; @@ -166,10 +167,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/QuotaList.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/QuotaList.java index abca0c6e..d88c2b02 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/QuotaList.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/QuotaList.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the quotas for a project. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class QuotaList { public static final String SERIALIZED_NAME_BACKUP_GIGABYTES = "backupGigabytes"; @@ -451,10 +452,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -584,7 +582,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/QuotaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/QuotaListResponse.java index b4855f95..9263da21 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/QuotaListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/QuotaListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Quotas list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class QuotaListResponse { public static final String SERIALIZED_NAME_QUOTAS = "quotas"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -224,7 +222,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalArea.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalArea.java index 179392cb..baa680ee 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalArea.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalArea.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The basic properties of a regional network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RegionalArea { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -160,10 +161,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -241,7 +239,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalAreaIPv4.java index 175ec609..51c813c2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalAreaIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalAreaIPv4.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** The regional IPv4 config of a network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RegionalAreaIPv4 { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; @@ -301,10 +302,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -373,21 +371,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "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( - java.util.Locale.ROOT, - "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("networkRanges") != null) { + if (!jsonObj.get("networkRanges").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `networkRanges` to be an array in the JSON string but got `%s`", + jsonObj.get("networkRanges").toString())); + } + 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("transferNetwork").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -430,7 +427,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalAreaListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalAreaListResponse.java index 306b4568..573ab450 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalAreaListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RegionalAreaListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Regional area list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RegionalAreaListResponse { public static final String SERIALIZED_NAME_REGIONS = "regions"; @@ -149,10 +150,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -232,7 +230,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Request.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Request.java index 4183a89e..ddd00e30 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Request.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Request.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Object that represents a request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Request { public static final String SERIALIZED_NAME_DETAILS = "details"; @@ -296,10 +297,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -387,21 +385,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "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( - java.util.Locale.ROOT, - "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("resources") != null) { + if (!jsonObj.get("resources").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `resources` to be an array in the JSON string but got `%s`", + jsonObj.get("resources").toString())); + } + 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( @@ -443,7 +440,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RequestResource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RequestResource.java index 506e545f..6c883dd4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RequestResource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RequestResource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a resource as part of a request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RequestResource { public static final String SERIALIZED_NAME_ID = "id"; @@ -200,10 +201,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -303,7 +301,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RescueServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RescueServerPayload.java index e94c4110..39afb8b7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RescueServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RescueServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** RescueServerPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RescueServerPayload { public static final String SERIALIZED_NAME_IMAGE = "image"; @@ -141,10 +142,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -230,7 +228,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ResizeServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ResizeServerPayload.java index a6f87b75..2e2546c2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ResizeServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ResizeServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ResizeServerPayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ResizeServerPayload { public static final String SERIALIZED_NAME_MACHINE_TYPE = "machineType"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -229,7 +227,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ResizeVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ResizeVolumePayload.java index d214e4b9..4f00bef6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ResizeVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ResizeVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** ResizeVolumePayload */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ResizeVolumePayload { public static final String SERIALIZED_NAME_SIZE = "size"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -222,7 +220,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Route.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Route.java index 0ec8d173..d3dd7ece 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Route.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Route.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object represents a network route. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Route { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -263,10 +264,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -364,7 +362,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteDestination.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteDestination.java index 54fb2f1c..e1279f75 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteDestination.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteDestination.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RouteDestination extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(RouteDestination.class.getName()); @@ -43,6 +43,8 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv4.class)); final TypeAdapter adapterDestinationCIDRv6 = gson.getDelegateAdapter(this, TypeToken.get(DestinationCIDRv6.class)); + final TypeAdapter adapterDestinationPrefixList = + gson.getDelegateAdapter(this, TypeToken.get(DestinationPrefixList.class)); return (TypeAdapter) new TypeAdapter() { @@ -70,8 +72,16 @@ public void write(JsonWriter out, RouteDestination value) elementAdapter.write(out, element); return; } + // check if the actual instance is of the type `DestinationPrefixList` + if (value.getActualInstance() instanceof DestinationPrefixList) { + JsonElement element = + adapterDestinationPrefixList.toJsonTree( + (DestinationPrefixList) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas: DestinationCIDRv4, DestinationCIDRv6"); + "Failed to serialize as the type doesn't match oneOf schemas: DestinationCIDRv4, DestinationCIDRv6, DestinationPrefixList"); } @Override @@ -125,6 +135,27 @@ public RouteDestination read(JsonReader in) throws IOException { "Input data does not match schema 'DestinationCIDRv6'", e); } + // deserialize DestinationPrefixList + try { + // validate the JSON object to see if any exception is thrown + DestinationPrefixList.validateJsonElement(jsonElement); + actualAdapter = adapterDestinationPrefixList; + match++; + log.log( + Level.FINER, + "Input data matches schema 'DestinationPrefixList'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for DestinationPrefixList failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'DestinationPrefixList'", + e); + } if (match == 1) { RouteDestination ret = new RouteDestination(); @@ -159,6 +190,7 @@ public RouteDestination(Object o) { static { schemas.put("DestinationCIDRv4", DestinationCIDRv4.class); schemas.put("DestinationCIDRv6", DestinationCIDRv6.class); + schemas.put("DestinationPrefixList", DestinationPrefixList.class); } @Override @@ -168,7 +200,7 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: DestinationCIDRv4, DestinationCIDRv6 + * against the oneOf child schemas: DestinationCIDRv4, DestinationCIDRv6, DestinationPrefixList * *

It could be an instance of the 'oneOf' schemas. */ @@ -184,14 +216,20 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof DestinationPrefixList) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( - "Invalid instance type. Must be DestinationCIDRv4, DestinationCIDRv6"); + "Invalid instance type. Must be DestinationCIDRv4, DestinationCIDRv6, DestinationPrefixList"); } /** - * Get the actual instance, which can be the following: DestinationCIDRv4, DestinationCIDRv6 + * Get the actual instance, which can be the following: DestinationCIDRv4, DestinationCIDRv6, + * DestinationPrefixList * - * @return The actual instance (DestinationCIDRv4, DestinationCIDRv6) + * @return The actual instance (DestinationCIDRv4, DestinationCIDRv6, DestinationPrefixList) */ @SuppressWarnings("unchecked") @Override @@ -206,6 +244,7 @@ public Object getActualInstance() { * @return The actual instance of `DestinationCIDRv4` * @throws ClassCastException if the instance is not `DestinationCIDRv4` */ + @SuppressWarnings("unchecked") public DestinationCIDRv4 getDestinationCIDRv4() throws ClassCastException { return (DestinationCIDRv4) super.getActualInstance(); } @@ -217,10 +256,23 @@ public DestinationCIDRv4 getDestinationCIDRv4() throws ClassCastException { * @return The actual instance of `DestinationCIDRv6` * @throws ClassCastException if the instance is not `DestinationCIDRv6` */ + @SuppressWarnings("unchecked") public DestinationCIDRv6 getDestinationCIDRv6() throws ClassCastException { return (DestinationCIDRv6) super.getActualInstance(); } + /** + * Get the actual instance of `DestinationPrefixList`. If the actual instance is not + * `DestinationPrefixList`, the ClassCastException will be thrown. + * + * @return The actual instance of `DestinationPrefixList` + * @throws ClassCastException if the instance is not `DestinationPrefixList` + */ + @SuppressWarnings("unchecked") + public DestinationPrefixList getDestinationPrefixList() throws ClassCastException { + return (DestinationPrefixList) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -255,11 +307,23 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with DestinationPrefixList + try { + DestinationPrefixList.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + java.util.Locale.ROOT, + "Deserialization for DestinationPrefixList failed with `%s`.", + e.getMessage())); + // continue to the next one + } if (validCount != 1) { throw new IOException( String.format( java.util.Locale.ROOT, - "The JSON string is invalid for RouteDestination with oneOf schemas: DestinationCIDRv4, DestinationCIDRv6. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", + "The JSON string is invalid for RouteDestination with oneOf schemas: DestinationCIDRv4, DestinationCIDRv6, DestinationPrefixList. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteListResponse.java index 27484b71..bc97e602 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Route list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RouteListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Route.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Route.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteNexthop.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteNexthop.java index 0bd0074a..f10e8e0f 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteNexthop.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RouteNexthop.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RouteNexthop extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(RouteNexthop.class.getName()); @@ -274,6 +274,7 @@ public Object getActualInstance() { * @return The actual instance of `NexthopIPv4` * @throws ClassCastException if the instance is not `NexthopIPv4` */ + @SuppressWarnings("unchecked") public NexthopIPv4 getNexthopIPv4() throws ClassCastException { return (NexthopIPv4) super.getActualInstance(); } @@ -285,6 +286,7 @@ public NexthopIPv4 getNexthopIPv4() throws ClassCastException { * @return The actual instance of `NexthopIPv6` * @throws ClassCastException if the instance is not `NexthopIPv6` */ + @SuppressWarnings("unchecked") public NexthopIPv6 getNexthopIPv6() throws ClassCastException { return (NexthopIPv6) super.getActualInstance(); } @@ -296,6 +298,7 @@ public NexthopIPv6 getNexthopIPv6() throws ClassCastException { * @return The actual instance of `NexthopInternet` * @throws ClassCastException if the instance is not `NexthopInternet` */ + @SuppressWarnings("unchecked") public NexthopInternet getNexthopInternet() throws ClassCastException { return (NexthopInternet) super.getActualInstance(); } @@ -307,6 +310,7 @@ public NexthopInternet getNexthopInternet() throws ClassCastException { * @return The actual instance of `NexthopBlackhole` * @throws ClassCastException if the instance is not `NexthopBlackhole` */ + @SuppressWarnings("unchecked") public NexthopBlackhole getNexthopBlackhole() throws ClassCastException { return (NexthopBlackhole) super.getActualInstance(); } diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTable.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTable.java index fdc59c17..ddf0b2b6 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTable.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTable.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -36,7 +37,7 @@ * An object representing a routing table. Filterable Fields: `dynamicRoutes`, * `systemRoutes`. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RoutingTable { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -344,10 +345,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -459,7 +457,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTableListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTableListResponse.java index 3c4548da..3f8c9db2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTableListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/RoutingTableListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Routing table response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class RoutingTableListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - RoutingTable.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + RoutingTable.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroup.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroup.java index 09ccaa84..2fc9dd94 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroup.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroup.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** Object that represents a security group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroup { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -317,10 +318,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -450,7 +448,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupListResponse.java index f8909b05..86f0e256 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Security group list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - SecurityGroup.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + SecurityGroup.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -248,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRule.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRule.java index a1691bcd..de71bbc2 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRule.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRule.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a security group rule. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupRule { public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @@ -410,10 +411,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -574,7 +572,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRuleListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRuleListResponse.java index a9d91166..ce1c0c72 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRuleListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRuleListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Security group rule list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupRuleListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -153,10 +154,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -201,21 +199,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - SecurityGroupRule.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + SecurityGroupRule.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -253,7 +250,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRuleProtocol.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRuleProtocol.java index 0bdac8cc..0de937df 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRuleProtocol.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SecurityGroupRuleProtocol.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The internet protocol which the rule matches. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SecurityGroupRuleProtocol { public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; @@ -138,10 +139,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -213,7 +211,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Server.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Server.java index 3dc1edcc..694eb4d5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Server.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Server.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ import java.util.UUID; /** Representation of a single server object. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Server { public static final String SERIALIZED_NAME_AFFINITY_GROUP = "affinityGroup"; @@ -769,10 +770,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -1022,7 +1020,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerAgent.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerAgent.java index 06ae4da2..5cfadb8a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerAgent.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerAgent.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** STACKIT server agent options for a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerAgent { public static final String SERIALIZED_NAME_PROVISIONED = "provisioned"; @@ -140,10 +141,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -209,7 +207,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerConsoleUrl.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerConsoleUrl.java index 20715b2b..e7388b12 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerConsoleUrl.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerConsoleUrl.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a server console URL. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerConsoleUrl { public static final String SERIALIZED_NAME_URL = "url"; @@ -139,10 +140,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -228,7 +226,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerListResponse.java index cb50c51d..e34ec31b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Response object for server list request. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Server.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Server.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerMaintenance.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerMaintenance.java index ae9fe126..a78436fa 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerMaintenance.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerMaintenance.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Object that represents the information about the next planned server maintenance window. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerMaintenance { public static final String SERIALIZED_NAME_DETAILS = "details"; @@ -220,10 +221,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -318,7 +316,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetwork.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetwork.java index be063539..e951eec7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetwork.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetwork.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -24,6 +25,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -34,13 +36,18 @@ import java.util.UUID; /** Describes the object that matches servers to its networks. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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_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) @@ -91,8 +98,19 @@ public class ServerNetwork { @SerializedName(SERIALIZED_NAME_SECURITY_GROUPS) @javax.annotation.Nullable private List securityGroups = new ArrayList<>(); + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public ServerNetwork() {} + public ServerNetwork(OffsetDateTime createdAt, OffsetDateTime updatedAt) { + this(); + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + public ServerNetwork allowedAddresses( @javax.annotation.Nullable List allowedAddresses) { this.allowedAddresses = allowedAddresses; @@ -121,6 +139,15 @@ public void setAllowedAddresses( this.allowedAddresses = allowedAddresses; } + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; + } + public ServerNetwork ipv4(@javax.annotation.Nullable String ipv4) { this.ipv4 = ipv4; return this; @@ -296,6 +323,15 @@ public void setSecurityGroups(@javax.annotation.Nullable List securityGrou this.securityGroups = securityGroups; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -350,6 +386,7 @@ public boolean equals(Object o) { } ServerNetwork serverNetwork = (ServerNetwork) o; return Objects.equals(this.allowedAddresses, serverNetwork.allowedAddresses) + && Objects.equals(this.createdAt, serverNetwork.createdAt) && Objects.equals(this.ipv4, serverNetwork.ipv4) && Objects.equals(this.ipv6, serverNetwork.ipv6) && Objects.equals(this.mac, serverNetwork.mac) @@ -359,6 +396,7 @@ public boolean equals(Object o) { && Objects.equals(this.nicSecurity, serverNetwork.nicSecurity) && Objects.equals(this.publicIp, serverNetwork.publicIp) && Objects.equals(this.securityGroups, serverNetwork.securityGroups) + && Objects.equals(this.updatedAt, serverNetwork.updatedAt) && Objects.equals(this.additionalProperties, serverNetwork.additionalProperties); } @@ -366,6 +404,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( allowedAddresses, + createdAt, ipv4, ipv6, mac, @@ -375,6 +414,7 @@ public int hashCode() { nicSecurity, publicIp, securityGroups, + updatedAt, additionalProperties); } @@ -383,6 +423,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ServerNetwork {\n"); sb.append(" allowedAddresses: ").append(toIndentedString(allowedAddresses)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).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"); @@ -392,6 +433,7 @@ public String toString() { sb.append(" nicSecurity: ").append(toIndentedString(nicSecurity)).append("\n"); sb.append(" publicIp: ").append(toIndentedString(publicIp)).append("\n"); sb.append(" securityGroups: ").append(toIndentedString(securityGroups)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -404,10 +446,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -419,6 +458,7 @@ private String toIndentedString(Object o) { new HashSet( Arrays.asList( "allowedAddresses", + "createdAt", "ipv4", "ipv6", "mac", @@ -427,7 +467,8 @@ private String toIndentedString(Object o) { "nicId", "nicSecurity", "publicIp", - "securityGroups")); + "securityGroups", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = @@ -581,7 +622,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetworking.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetworking.java index 6ee0d554..f0a1997e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetworking.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServerNetworking.java @@ -27,7 +27,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServerNetworking extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(ServerNetworking.class.getName()); @@ -212,6 +212,7 @@ public Object getActualInstance() { * @return The actual instance of `CreateServerNetworking` * @throws ClassCastException if the instance is not `CreateServerNetworking` */ + @SuppressWarnings("unchecked") public CreateServerNetworking getCreateServerNetworking() throws ClassCastException { return (CreateServerNetworking) super.getActualInstance(); } @@ -223,6 +224,7 @@ public CreateServerNetworking getCreateServerNetworking() throws ClassCastExcept * @return The actual instance of `CreateServerNetworkingWithNics` * @throws ClassCastException if the instance is not `CreateServerNetworkingWithNics` */ + @SuppressWarnings("unchecked") public CreateServerNetworkingWithNics getCreateServerNetworkingWithNics() throws ClassCastException { return (CreateServerNetworkingWithNics) super.getActualInstance(); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServiceAccountMailListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServiceAccountMailListResponse.java index a92b79f7..5af22381 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServiceAccountMailListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/ServiceAccountMailListResponse.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.Objects; /** Service account mail list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class ServiceAccountMailListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -151,10 +152,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -247,7 +245,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SetImageSharePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SetImageSharePayload.java index b0f4a458..513a3f89 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SetImageSharePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SetImageSharePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SetImageSharePayload { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -178,10 +179,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -258,7 +256,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Snapshot.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Snapshot.java index a160c4bc..a6e084b5 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Snapshot.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Snapshot.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a snapshot. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Snapshot { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -50,6 +51,11 @@ public class Snapshot { @SerializedName(SERIALIZED_NAME_DESCRIPTION) @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_ENCRYPTED = "encrypted"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED) + @javax.annotation.Nullable private Boolean encrypted; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -91,6 +97,7 @@ public Snapshot() {} public Snapshot( String availabilityZone, OffsetDateTime createdAt, + Boolean encrypted, UUID id, Long size, String status, @@ -98,6 +105,7 @@ public Snapshot( this(); this.availabilityZone = availabilityZone; this.createdAt = createdAt; + this.encrypted = encrypted; this.id = id; this.size = size; this.status = status; @@ -140,6 +148,15 @@ public void setDescription(@javax.annotation.Nullable String description) { this.description = description; } + /** + * Indicates if a volume is encrypted. + * + * @return encrypted + */ + @javax.annotation.Nullable public Boolean getEncrypted() { + return encrypted; + } + /** * Universally Unique Identifier (UUID). * @@ -303,6 +320,7 @@ public boolean equals(Object o) { return Objects.equals(this.availabilityZone, snapshot.availabilityZone) && Objects.equals(this.createdAt, snapshot.createdAt) && Objects.equals(this.description, snapshot.description) + && Objects.equals(this.encrypted, snapshot.encrypted) && Objects.equals(this.id, snapshot.id) && Objects.equals(this.labels, snapshot.labels) && Objects.equals(this.name, snapshot.name) @@ -319,6 +337,7 @@ public int hashCode() { availabilityZone, createdAt, description, + encrypted, id, labels, name, @@ -336,6 +355,7 @@ public String toString() { sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" encrypted: ").append(toIndentedString(encrypted)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -355,10 +375,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -372,6 +389,7 @@ private String toIndentedString(Object o) { "availabilityZone", "createdAt", "description", + "encrypted", "id", "labels", "name", @@ -496,7 +514,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SnapshotListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SnapshotListResponse.java index 7ec1347f..eb0836b8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SnapshotListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/SnapshotListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Snapshot list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class SnapshotListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Snapshot.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Snapshot.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateAttachedVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateAttachedVolumePayload.java index bbc90b14..c43acd9c 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateAttachedVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateAttachedVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a Volume attachment to a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateAttachedVolumePayload { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -182,10 +183,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -271,7 +269,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImagePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImagePayload.java index ffb0dc7f..9cae23b7 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImagePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImagePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of an Image. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateImagePayload { public static final String SERIALIZED_NAME_AGENT = "agent"; @@ -337,10 +338,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -441,7 +439,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImageSharePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImageSharePayload.java index 8603efa6..13ee991e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImageSharePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateImageSharePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateImageSharePayload { public static final String SERIALIZED_NAME_PARENT_ORGANIZATION = "parentOrganization"; @@ -178,10 +179,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -259,7 +257,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateKeyPairPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateKeyPairPayload.java index 5d42b311..1d49a352 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateKeyPairPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateKeyPairPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a public key of an SSH keypair. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateKeyPairPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -152,10 +153,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -222,7 +220,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNetworkIPv4Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNetworkIPv4Body.java index 8903caa6..6e973c6d 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNetworkIPv4Body.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNetworkIPv4Body.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The config object for a IPv4 network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNetworkIPv4Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -190,10 +191,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -278,7 +276,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNetworkIPv6Body.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNetworkIPv6Body.java index 84f774b6..f858bbad 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNetworkIPv6Body.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNetworkIPv6Body.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import org.openapitools.jackson.nullable.JsonNullable; /** The config object for a IPv6 network update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNetworkIPv6Body { public static final String SERIALIZED_NAME_GATEWAY = "gateway"; @@ -190,10 +191,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -278,7 +276,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNicPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNicPayload.java index 46cb04bc..49924592 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNicPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateNicPayload.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ import java.util.UUID; /** Object that represents a network interface update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateNicPayload { public static final String SERIALIZED_NAME_ALLOWED_ADDRESSES = "allowedAddresses"; @@ -304,10 +305,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -428,7 +426,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java index b4b23169..8364aa40 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdatePublicIPPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -23,6 +24,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -33,8 +35,13 @@ import org.openapitools.jackson.nullable.JsonNullable; /** Object that represents a public IP. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdatePublicIPPayload { + 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) @@ -55,12 +62,29 @@ public class UpdatePublicIPPayload { @SerializedName(SERIALIZED_NAME_NETWORK_INTERFACE) @javax.annotation.Nullable private UUID networkInterface; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable private OffsetDateTime updatedAt; + public UpdatePublicIPPayload() {} - public UpdatePublicIPPayload(UUID id, String ip) { + public UpdatePublicIPPayload( + OffsetDateTime createdAt, UUID id, String ip, OffsetDateTime updatedAt) { this(); + this.createdAt = createdAt; this.id = id; this.ip = ip; + this.updatedAt = updatedAt; + } + + /** + * Date-time when resource was created. + * + * @return createdAt + */ + @javax.annotation.Nullable public OffsetDateTime getCreatedAt() { + return createdAt; } /** @@ -132,6 +156,15 @@ public void setNetworkInterface(@javax.annotation.Nullable UUID networkInterface this.networkInterface = networkInterface; } + /** + * Date-time when resource was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -185,10 +218,12 @@ public boolean equals(Object o) { return false; } UpdatePublicIPPayload updatePublicIPPayload = (UpdatePublicIPPayload) o; - return Objects.equals(this.id, updatePublicIPPayload.id) + return Objects.equals(this.createdAt, updatePublicIPPayload.createdAt) + && Objects.equals(this.id, updatePublicIPPayload.id) && Objects.equals(this.ip, updatePublicIPPayload.ip) && Objects.equals(this.labels, updatePublicIPPayload.labels) && Objects.equals(this.networkInterface, updatePublicIPPayload.networkInterface) + && Objects.equals(this.updatedAt, updatePublicIPPayload.updatedAt) && Objects.equals( this.additionalProperties, updatePublicIPPayload.additionalProperties); } @@ -204,7 +239,8 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, ip, labels, networkInterface, additionalProperties); + return Objects.hash( + createdAt, id, ip, labels, networkInterface, updatedAt, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -218,10 +254,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdatePublicIPPayload {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\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(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); @@ -234,10 +272,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -246,7 +281,14 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = - new HashSet(Arrays.asList("id", "ip", "labels", "networkInterface")); + new HashSet( + Arrays.asList( + "createdAt", + "id", + "ip", + "labels", + "networkInterface", + "updatedAt")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(0); @@ -330,7 +372,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRegionalAreaIPv4.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRegionalAreaIPv4.java index beba024d..0277333e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRegionalAreaIPv4.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRegionalAreaIPv4.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -34,7 +35,7 @@ /** * Object that represents the request body for a regional network area IPv4 configuration update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateRegionalAreaIPv4 { public static final String SERIALIZED_NAME_DEFAULT_NAMESERVERS = "defaultNameservers"; @@ -233,10 +234,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -319,7 +317,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRouteOfRoutingTablePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRouteOfRoutingTablePayload.java index 0c33ea8d..0d96e675 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRouteOfRoutingTablePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRouteOfRoutingTablePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the request body for a route update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateRouteOfRoutingTablePayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -154,10 +155,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -227,7 +225,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRoutingTableOfAreaPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRoutingTableOfAreaPayload.java index e9bb58f8..a5e4e447 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRoutingTableOfAreaPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateRoutingTableOfAreaPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the request body for a routing table update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateRoutingTableOfAreaPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -260,10 +261,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -352,7 +350,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateServerPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateServerPayload.java index c28a96fc..f7fc5202 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateServerPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateServerPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateServerPayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -204,10 +205,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -282,7 +280,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateVolumePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateVolumePayload.java index 11a136b8..b0a802cc 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateVolumePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/UpdateVolumePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a volume. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class UpdateVolumePayload { public static final String SERIALIZED_NAME_BOOTABLE = "bootable"; @@ -252,10 +253,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -344,7 +342,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateNetworkAreaRegionPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateNetworkAreaRegionPayload.java index a93f74eb..1d7a21ff 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateNetworkAreaRegionPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateNetworkAreaRegionPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** The basic properties of a regional network area. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class V2beta1CreateNetworkAreaRegionPayload { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -164,10 +165,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -251,7 +249,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateSnapshotPayload.java index 553e3de1..3a5939a9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1CreateSnapshotPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a snapshot. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class V2beta1CreateSnapshotPayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -50,6 +51,11 @@ public class V2beta1CreateSnapshotPayload { @SerializedName(SERIALIZED_NAME_DESCRIPTION) @javax.annotation.Nullable private String description; + public static final String SERIALIZED_NAME_ENCRYPTED = "encrypted"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED) + @javax.annotation.Nullable private Boolean encrypted; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -91,6 +97,7 @@ public V2beta1CreateSnapshotPayload() {} public V2beta1CreateSnapshotPayload( String availabilityZone, OffsetDateTime createdAt, + Boolean encrypted, UUID id, Long size, String status, @@ -98,6 +105,7 @@ public V2beta1CreateSnapshotPayload( this(); this.availabilityZone = availabilityZone; this.createdAt = createdAt; + this.encrypted = encrypted; this.id = id; this.size = size; this.status = status; @@ -140,6 +148,15 @@ public void setDescription(@javax.annotation.Nullable String description) { this.description = description; } + /** + * Indicates if a volume is encrypted. + * + * @return encrypted + */ + @javax.annotation.Nullable public Boolean getEncrypted() { + return encrypted; + } + /** * Universally Unique Identifier (UUID). * @@ -304,6 +321,7 @@ public boolean equals(Object o) { return Objects.equals(this.availabilityZone, v2beta1CreateSnapshotPayload.availabilityZone) && Objects.equals(this.createdAt, v2beta1CreateSnapshotPayload.createdAt) && Objects.equals(this.description, v2beta1CreateSnapshotPayload.description) + && Objects.equals(this.encrypted, v2beta1CreateSnapshotPayload.encrypted) && Objects.equals(this.id, v2beta1CreateSnapshotPayload.id) && Objects.equals(this.labels, v2beta1CreateSnapshotPayload.labels) && Objects.equals(this.name, v2beta1CreateSnapshotPayload.name) @@ -322,6 +340,7 @@ public int hashCode() { availabilityZone, createdAt, description, + encrypted, id, labels, name, @@ -339,6 +358,7 @@ public String toString() { sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" encrypted: ").append(toIndentedString(encrypted)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -358,10 +378,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -375,6 +392,7 @@ private String toIndentedString(Object o) { "availabilityZone", "createdAt", "description", + "encrypted", "id", "labels", "name", @@ -503,7 +521,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateBackupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateBackupPayload.java index 336cd5cc..2818a039 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateBackupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateBackupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.UUID; /** Object that represents a backup. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class V2beta1UpdateBackupPayload { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -384,10 +385,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -526,7 +524,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRegionPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRegionPayload.java index 5c46658b..7df2ea1e 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRegionPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRegionPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the request body for a regional network area update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class V2beta1UpdateNetworkAreaRegionPayload { public static final String SERIALIZED_NAME_IPV4 = "ipv4"; @@ -141,10 +142,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -220,7 +218,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRoutePayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRoutePayload.java index 328b44ba..42fb9770 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRoutePayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateNetworkAreaRoutePayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents the request body for a route update. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class V2beta1UpdateNetworkAreaRoutePayload { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -154,10 +155,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -229,7 +227,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSecurityGroupPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSecurityGroupPayload.java index f82d8699..807b19b8 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSecurityGroupPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSecurityGroupPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a security group. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class V2beta1UpdateSecurityGroupPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -205,10 +206,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -295,7 +293,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSnapshotPayload.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSnapshotPayload.java index 453579b3..856b13b4 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSnapshotPayload.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/V2beta1UpdateSnapshotPayload.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents an update request body of a snapshot. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class V2beta1UpdateSnapshotPayload { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -204,10 +205,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -293,7 +291,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Volume.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Volume.java index fee2566d..2626101b 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Volume.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/Volume.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -35,7 +36,7 @@ /** * Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class Volume { public static final String SERIALIZED_NAME_AVAILABILITY_ZONE = "availabilityZone"; @@ -515,10 +516,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -683,7 +681,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeAttachment.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeAttachment.java index 49d6a5a7..f0a7a830 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeAttachment.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeAttachment.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** Object that represents a Volume attachment to a server. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeAttachment { public static final String SERIALIZED_NAME_DELETE_ON_TERMINATION = "deleteOnTermination"; @@ -179,10 +180,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -266,7 +264,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeAttachmentListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeAttachmentListResponse.java index fc3e4b83..e6b5b118 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeAttachmentListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeAttachmentListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Volume attachment list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeAttachmentListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -153,10 +154,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -201,21 +199,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - VolumeAttachment.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + VolumeAttachment.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -253,7 +250,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeEncryptionParameter.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeEncryptionParameter.java index dc748948..313e84ef 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeEncryptionParameter.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeEncryptionParameter.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -37,7 +38,7 @@ * STACKIT-KMS. These parameter never leave the backend again. So these parameters are not in the * responses. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeEncryptionParameter { public static final String SERIALIZED_NAME_KEK_KEY_ID = "kekKeyId"; @@ -289,10 +290,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -412,7 +410,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeListResponse.java index 76098c82..5dff2955 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Volume list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -150,10 +151,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -197,21 +195,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - Volume.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + Volume.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -247,7 +244,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClass.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClass.java index 43d7a75f..5ddc25a9 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClass.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClass.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -31,7 +32,7 @@ import java.util.Objects; /** Object that represents a Volume performance class. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumePerformanceClass { public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @@ -254,10 +255,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -353,7 +351,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClassListResponse.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClassListResponse.java index 3bc18395..d806b505 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClassListResponse.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumePerformanceClassListResponse.java @@ -16,6 +16,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -33,7 +34,7 @@ import java.util.Objects; /** Volume performance class list response. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumePerformanceClassListResponse { public static final String SERIALIZED_NAME_ITEMS = "items"; @@ -153,10 +154,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -202,21 +200,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - java.util.Locale.ROOT, - "Expected the field `items` to be an array in the JSON string but got `%s`", - jsonObj.get("items").toString())); - } - - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - // validate the required field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - VolumePerformanceClass.validateJsonElement(jsonArrayitems.get(i)); + if (jsonObj.get("items") != null) { + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + java.util.Locale.ROOT, + "Expected the field `items` to be an array in the JSON string but got `%s`", + jsonObj.get("items").toString())); + } + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + VolumePerformanceClass.validateJsonElement(jsonArrayitems.get(i)); + } } - ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -254,7 +251,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject()); diff --git a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeSource.java b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeSource.java index 4359c981..d58c400a 100644 --- a/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeSource.java +++ b/services/iaas/src/main/java/cloud/stackit/sdk/iaas/v2beta1api/model/VolumeSource.java @@ -15,6 +15,7 @@ import cloud.stackit.sdk.iaas.v2beta1api.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -32,7 +33,7 @@ import java.util.UUID; /** The source object of a volume. */ -@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0") +@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0") public class VolumeSource { public static final String SERIALIZED_NAME_ID = "id"; @@ -168,10 +169,7 @@ public String toString() { * line). */ private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } public static HashSet openapiFields; @@ -263,7 +261,9 @@ else if (entry.getValue() instanceof Character) entry.getKey(), (Character) entry.getValue()); else { JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { + if (jsonElement.isJsonNull()) { + obj.add(entry.getKey(), JsonNull.INSTANCE); + } else if (jsonElement.isJsonArray()) { obj.add(entry.getKey(), jsonElement.getAsJsonArray()); } else { obj.add(entry.getKey(), jsonElement.getAsJsonObject());